summaryrefslogtreecommitdiffstats
path: root/ansible/roles/dns/tasks/main.yml
blob: 2bc05648be39a3a3eddd07e2ec73dcbf27e8901a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- 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: Restart dnsmasq container

- name: Load dnsmasq container
  docker_image:
    name: andyshinn/dnsmasq:2.76
    load_path: "{{ app_data_path }}/offline_data/docker_images_infra/andyshinn_dnsmasq_2.76.tar"
    state: present
    timeout: 120
  notify: Restart dnsmasq container

- name: Start dnsmasq container
  docker_container:
    name: dnsmasq
    network_mode: host
    image: andyshinn/dnsmasq:2.76
    command: -H /simulated_hosts --log-facility=-
    capabilities: NET_ADMIN
    dns_servers:
      - 127.0.0.1
    volumes:
      - "{{ app_data_path }}/cfg/simulated_hosts:/simulated_hosts:ro"
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    state: started
    restart_policy: unless-stopped