aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/docker
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-03-06 19:34:41 +0000
committerpmikus <pmikus@cisco.com>2021-03-07 18:49:29 +0000
commit86cf937bde2df8c6879e7dfb695ecb8bb2bec0c0 (patch)
tree046c37957ac2e5a8cf8ab0ac74e82f50817f3387 /resources/tools/testbed-setup/ansible/roles/docker
parentf7825e80ea0688fa337b8a36086df2e577ca6101 (diff)
Infra: Docker DNS on Nomad hosts
+ Make the host default resolver Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: Ifadb8901c66b65b2213878180c87370262ab22f0
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/docker')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml8
-rw-r--r--resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml12
-rw-r--r--resources/tools/testbed-setup/ansible/roles/docker/templates/daemon.json.j21
3 files changed, 20 insertions, 1 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml
index 8343558238..e665860dfb 100644
--- a/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml
@@ -35,4 +35,10 @@ docker_daemon_environment_http:
- "NO_PROXY={{ proxy_env.no_proxy }}"
docker_daemon_environment_https:
- "HTTPS_PROXY={{ proxy_env.https_proxy }}"
- - "NO_PROXY={{ proxy_env.no_proxy }}" \ No newline at end of file
+ - "NO_PROXY={{ proxy_env.no_proxy }}"
+
+docker_daemon:
+ # https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
+ dns: [ "172.17.0.1" ]
+ dns-opts: []
+ dns-search: [ "{{ansible_hostname}}" ] \ No newline at end of file
diff --git a/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
index 8158af51b4..5a96b7a7c5 100644
--- a/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/docker/tasks/main.yaml
@@ -29,6 +29,18 @@
tags:
- docker-conf-service
+- name: Conf - Docker Daemon
+ template:
+ src: "templates/daemon.json.j2"
+ dest: "/etc/docker/daemon.json"
+ owner: "root"
+ group: "root"
+ mode: "0644"
+ when: >
+ docker_daemon is defined
+ tags:
+ - docker-conf-daemon
+
- name: Conf - Docker HTTP Proxy
template:
src: "templates/docker.service.proxy.http"
diff --git a/resources/tools/testbed-setup/ansible/roles/docker/templates/daemon.json.j2 b/resources/tools/testbed-setup/ansible/roles/docker/templates/daemon.json.j2
new file mode 100644
index 0000000000..becc2b1af7
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/docker/templates/daemon.json.j2
@@ -0,0 +1 @@
+{{ docker_daemon | to_nice_json }} \ No newline at end of file