blob: 3eba9fdb347dd0b9e542d0bbd77f15e488a148c2 [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"
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010011 notify: Restart 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
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010019 notify: Restart dns server container
Tomáš Levora290bf402018-12-19 15:47:04 +010020
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010021- name: Start dns server container
Tomáš Levora290bf402018-12-19 15:47:04 +010022 docker_container:
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010023 name: dns-server
Tomáš Levora290bf402018-12-19 15:47:04 +010024 network_mode: host
Tomáš Levoraa0ad5c12019-03-28 17:45:55 +010025 image: "{{ dns_server_image }}"
Tomáš Levora290bf402018-12-19 15:47:04 +010026 command: -H /simulated_hosts --log-facility=-
27 capabilities: NET_ADMIN
28 dns_servers:
29 - 127.0.0.1
30 volumes:
31 - "{{ app_data_path }}/cfg/simulated_hosts:/simulated_hosts:ro"
32 ports:
33 - "53:53/tcp"
34 - "53:53/udp"
35 state: started
36 restart_policy: unless-stopped