blob: 8a7f8bca217025c777a9e2cf7743df1d8df9ce9a [file] [log] [blame]
Tomáš Levora290bf402018-12-19 15:47:04 +01001---
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 Grzybowski25d56e32019-05-10 09:29:10 +020011 notify: Run dns server container
Tomáš Levora290bf402018-12-19 15:47:04 +010012
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010013- name: Load dns server container
Tomáš Levora290bf402018-12-19 15:47:04 +010014 docker_image:
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010015 name: "{{ dns_server_image }}"
16 load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}"
Tomáš Levora290bf402018-12-19 15:47:04 +010017 state: present
18 timeout: 120
Bartek Grzybowski25d56e32019-05-10 09:29:10 +020019 notify: Run dns server container
Tomáš Levora290bf402018-12-19 15:47:04 +010020
Bartek Grzybowski25d56e32019-05-10 09:29:10 +020021- 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"
Michal Ptacekb1fe7852019-05-21 08:01:33 +000029
30- name: Force notified handlers to run at this point
31 meta: flush_handlers