adds functionality for insecure registries
This commit is contained in:
parent
ef6a59bbd3
commit
ed824da856
2 changed files with 14 additions and 0 deletions
|
@ -128,3 +128,8 @@ dns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(2)|ipaddr('address')
|
|||
#http_proxy: ""
|
||||
#https_proxy: ""
|
||||
#no_proxy: ""
|
||||
|
||||
##An list of insecure registries to allow docker to connect to
|
||||
##This may be helpful if you are running your own internal registry
|
||||
#insecure_registry:
|
||||
# - "xxx.yyy.zzz:5000"
|
||||
|
|
|
@ -58,6 +58,15 @@
|
|||
when: ansible_service_mgr == "systemd" and
|
||||
(http_proxy is defined or https_proxy is defined or no_proxy is defined)
|
||||
|
||||
- name: create docker defaults file
|
||||
file: path=/etc/default/docker state=touch
|
||||
when: insecure_registry is defined
|
||||
|
||||
- name: allow for insecure registries in docker defaults
|
||||
lineinfile: dest=/etc/default/docker line="INSECURE_REGISTRY=\"{% for registry in insecure_registry %}--insecure-registry={{ registry }} {% endfor %}\""
|
||||
when: insecure_registry is defined
|
||||
notify: restart docker
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: ensure docker service is started and enabled
|
||||
|
|
Loading…
Reference in a new issue