Support for multiple insecure registries
Co-Authored-By: @samdoran Closes #1
This commit is contained in:
parent
275e075f9b
commit
9f4336318a
@ -7,7 +7,7 @@ deploy_docker_distribution: true
|
||||
deployment_user: centos
|
||||
docker_options: '--log-driver=journald --signature-verification=false --iptables=false --live-restore'
|
||||
enable_container_images_build: true
|
||||
insecure_registries: ''
|
||||
insecure_registries: []
|
||||
network_options: ''
|
||||
registry_host: localhost
|
||||
registry_mirror: ''
|
||||
|
@ -52,10 +52,11 @@
|
||||
lineinfile:
|
||||
path: /etc/sysconfig/docker
|
||||
regexp: '^INSECURE_REGISTRY='
|
||||
line: "INSECURE_REGISTRY='--insecure-registry {{ item }}'"
|
||||
with_items: "{{ insecure_registries }}"
|
||||
when: insecure_registries != ""
|
||||
line: "INSECURE_REGISTRY='{{ registry_flags }}'"
|
||||
when: insecure_registries | length > 0
|
||||
notify: restart docker service
|
||||
vars:
|
||||
registry_flags: "{% for reg in insecure_registries %}--insecure-registry {{ reg }}{% if not loop.last %} {% endif %}{% endfor %}"
|
||||
|
||||
# There is no native way to edit JSON so we use a template.
|
||||
- name: manage /etc/docker/daemon.json
|
||||
|
Loading…
x
Reference in New Issue
Block a user