Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 1 | --- |
| 2 | - name: Ensure cfg directory exist |
| 3 | file: |
| 4 | path: "{{ app_data_path }}/cfg" |
| 5 | state: directory |
| 6 | |
| 7 | - name: Create simulated hostnames file |
| 8 | template: |
| 9 | src: simulated_hosts.j2 |
| 10 | dest: "{{ app_data_path }}/cfg/simulated_hosts" |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 11 | notify: Run dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 12 | |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 13 | - name: Load dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 14 | docker_image: |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 15 | name: "{{ dns_server_image }}" |
| 16 | load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}" |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 17 | state: present |
| 18 | timeout: 120 |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 19 | notify: Run dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 20 | |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 21 | - name: Enumerate running containers |
| 22 | docker_list_containers: |
| 23 | register: containers_list |
| 24 | |
| 25 | - name: Ensure dns container is running |
| 26 | command: /bin/true |
| 27 | notify: Run dns server container |
| 28 | when: "'dns-server' not in containers_list.containers" |