summaryrefslogtreecommitdiffstats
path: root/ansible/roles/dns/tasks/main.yml
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2018-12-20 07:55:13 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-20 07:55:13 +0000
commit3476fd534de89fef9b5119a36ba2ed30f78bf8f0 (patch)
tree374e4fd1ef23008bae725f1a2422a8b2ba33798e /ansible/roles/dns/tasks/main.yml
parent19ce4b9e57f294dd7d2345fbb814945a042bded1 (diff)
parent290bf4088ac26232076f0eec1255d89687399539 (diff)
Merge "Add ansible role for dns simulation"
Diffstat (limited to 'ansible/roles/dns/tasks/main.yml')
-rw-r--r--ansible/roles/dns/tasks/main.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/ansible/roles/dns/tasks/main.yml b/ansible/roles/dns/tasks/main.yml
new file mode 100644
index 00000000..2bc05648
--- /dev/null
+++ b/ansible/roles/dns/tasks/main.yml
@@ -0,0 +1,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