From 009d2ffc6c7c5fafeb950293e96a60b6a9b986de Mon Sep 17 00:00:00 2001 From: rongzhang Date: Sat, 8 Sep 2018 18:13:33 +0800 Subject: [PATCH] Add insecure_registry config to docker options --- inventory/sample/group_vars/all/docker.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inventory/sample/group_vars/all/docker.yml b/inventory/sample/group_vars/all/docker.yml index 3fb169e33..fcc628b7c 100644 --- a/inventory/sample/group_vars/all/docker.yml +++ b/inventory/sample/group_vars/all/docker.yml @@ -15,10 +15,17 @@ docker_daemon_graph: "/var/lib/docker" ## A string of extra options to pass to the docker daemon. ## This string should be exactly as you wish it to appear. -## An obvious use case is allowing insecure-registry access -## to self hosted registries like so: +## An obvious use case is allowing insecure-registry access to self hosted registries. +## Can be ipddress and domain_name. +## example define 172.19.16.11 or mirror.registry.io +#insecure_registries: +# - mirror.registry.io +# - 172.19.16.11 docker_options: >- - --insecure-registry={{ kube_service_addresses }} --graph={{ docker_daemon_graph }} {{ docker_log_opts }} + {%- if insecure_registries is defined %} + {{ insecure_registries | map('regex_replace', '^(.*)$', '--insecure-registry=\1' ) | list | join(' ') }} + {%- endif -%} + --graph={{ docker_daemon_graph }} {{ docker_log_opts }} {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd