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" |
| 11 | notify: Restart dnsmasq container |
| 12 | |
| 13 | - name: Load dnsmasq container |
| 14 | docker_image: |
| 15 | name: andyshinn/dnsmasq:2.76 |
| 16 | load_path: "{{ app_data_path }}/offline_data/docker_images_infra/andyshinn_dnsmasq_2.76.tar" |
| 17 | state: present |
| 18 | timeout: 120 |
| 19 | notify: Restart dnsmasq container |
| 20 | |
| 21 | - name: Start dnsmasq container |
| 22 | docker_container: |
| 23 | name: dnsmasq |
| 24 | network_mode: host |
| 25 | image: andyshinn/dnsmasq:2.76 |
| 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 |