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 | |
Jan Benedikt | 2dcd298 | 2020-02-10 15:44:01 +0100 | [diff] [blame] | 7 | - name: Stop systemd-resolved daemon - Ubuntu |
| 8 | systemd: |
| 9 | name: systemd-resolved |
| 10 | state: stopped |
| 11 | when: ansible_distribution in ["Ubuntu","Debian"] |
| 12 | |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 13 | - name: Create simulated hostnames file |
| 14 | template: |
| 15 | src: simulated_hosts.j2 |
| 16 | dest: "{{ app_data_path }}/cfg/simulated_hosts" |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 17 | notify: Run dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 18 | |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 19 | - name: Load dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 20 | docker_image: |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 21 | name: "{{ dns_server_image }}" |
| 22 | load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}" |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 23 | state: present |
| 24 | timeout: 120 |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 25 | notify: Run dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 26 | |
Bartek Grzybowski | 25d56e3 | 2019-05-10 09:29:10 +0200 | [diff] [blame] | 27 | - name: Enumerate running containers |
| 28 | docker_list_containers: |
| 29 | register: containers_list |
| 30 | |
| 31 | - name: Ensure dns container is running |
| 32 | command: /bin/true |
| 33 | notify: Run dns server container |
| 34 | when: "'dns-server' not in containers_list.containers" |
Michal Ptacek | b1fe785 | 2019-05-21 08:01:33 +0000 | [diff] [blame] | 35 | |
| 36 | - name: Force notified handlers to run at this point |
| 37 | meta: flush_handlers |