summaryrefslogtreecommitdiffstats
path: root/ansible/roles/dns
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/dns')
-rw-r--r--ansible/roles/dns/defaults/main.yml3
-rw-r--r--ansible/roles/dns/handlers/main.yml6
-rw-r--r--ansible/roles/dns/tasks/main.yml16
3 files changed, 14 insertions, 11 deletions
diff --git a/ansible/roles/dns/defaults/main.yml b/ansible/roles/dns/defaults/main.yml
new file mode 100644
index 00000000..f69d965d
--- /dev/null
+++ b/ansible/roles/dns/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+# Default rule for tarball naming translation
+dns_server_image_tar: "{{ dns_server_image | regex_replace('(\\/|\\:)', '_') }}.tar"
diff --git a/ansible/roles/dns/handlers/main.yml b/ansible/roles/dns/handlers/main.yml
index ac3209dc..9d77893a 100644
--- a/ansible/roles/dns/handlers/main.yml
+++ b/ansible/roles/dns/handlers/main.yml
@@ -1,8 +1,8 @@
---
-- name: Restart dnsmasq container
+- name: Restart dns server container
docker_container:
- name: dnsmasq
- image: andyshinn/dnsmasq:2.76
+ name: dns-server
+ image: "{{ dns_server_image }}"
command: -H /simulated_hosts --log-facility=-
capabilities: NET_ADMIN
volumes:
diff --git a/ansible/roles/dns/tasks/main.yml b/ansible/roles/dns/tasks/main.yml
index 2bc05648..3eba9fdb 100644
--- a/ansible/roles/dns/tasks/main.yml
+++ b/ansible/roles/dns/tasks/main.yml
@@ -8,21 +8,21 @@
template:
src: simulated_hosts.j2
dest: "{{ app_data_path }}/cfg/simulated_hosts"
- notify: Restart dnsmasq container
+ notify: Restart dns server container
-- name: Load dnsmasq container
+- name: Load dns server container
docker_image:
- name: andyshinn/dnsmasq:2.76
- load_path: "{{ app_data_path }}/offline_data/docker_images_infra/andyshinn_dnsmasq_2.76.tar"
+ name: "{{ dns_server_image }}"
+ load_path: "{{ infra_images_path }}/{{ dns_server_image_tar }}"
state: present
timeout: 120
- notify: Restart dnsmasq container
+ notify: Restart dns server container
-- name: Start dnsmasq container
+- name: Start dns server container
docker_container:
- name: dnsmasq
+ name: dns-server
network_mode: host
- image: andyshinn/dnsmasq:2.76
+ image: "{{ dns_server_image }}"
command: -H /simulated_hosts --log-facility=-
capabilities: NET_ADMIN
dns_servers: