| --- |
| - name: Ensure cfg directory exist |
| file: |
| path: "{{ app_data_path }}/cfg" |
| state: directory |
| |
| - name: Create simulated hostnames file |
| template: |
| src: simulated_hosts.j2 |
| dest: "{{ app_data_path }}/cfg/simulated_hosts" |
| notify: Run dns server container |
| |
| - name: Load dns server container |
| docker_image: |
| name: "{{ dns_server_image }}" |
| load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}" |
| state: present |
| timeout: 120 |
| notify: Run dns server container |
| |
| - name: Enumerate running containers |
| docker_list_containers: |
| register: containers_list |
| |
| - name: Ensure dns container is running |
| command: /bin/true |
| notify: Run dns server container |
| when: "'dns-server' not in containers_list.containers" |