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" |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 11 | notify: Restart 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 |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 19 | notify: Restart dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 20 | |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 21 | - name: Start dns server container |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 22 | docker_container: |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 23 | name: dns-server |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 24 | network_mode: host |
Tomáš Levora | a0ad5c1 | 2019-03-28 17:45:55 +0100 | [diff] [blame] | 25 | image: "{{ dns_server_image }}" |
Tomáš Levora | 290bf40 | 2018-12-19 15:47:04 +0100 | [diff] [blame] | 26 | 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 |