|
|
@@ -1,26 +0,0 @@
|
|
|
-- hosts: local
|
|
|
- become: true
|
|
|
- tasks:
|
|
|
- - name: Create the containers
|
|
|
- lxc_container:
|
|
|
- template: ubuntu
|
|
|
- name: "{{ item.name }}"
|
|
|
- state: started
|
|
|
- with_items: "{{ containers }}"
|
|
|
- register: containers_info
|
|
|
-
|
|
|
- - name: Wait for the network to be setup in the containers
|
|
|
- when: containers_info|changed
|
|
|
- pause: seconds=10
|
|
|
-
|
|
|
- - name: Get containers info now that IPs are available
|
|
|
- lxc_container:
|
|
|
- name: "{{ item.name }}"
|
|
|
- with_items: "{{ containers }}"
|
|
|
- register: containers_info
|
|
|
-
|
|
|
- - name: Register the hosts in the inventory
|
|
|
- add_host:
|
|
|
- name: "{{ item.lxc_container.ips.0 }}"
|
|
|
- group: "{{ item.item.service }}"
|
|
|
- with_items: "{{ containers_info.results }}"
|