mirror of
https://github.com/luzifer-ansible/docker.git
synced 2024-12-22 17:01:16 +00:00
Add option for docker-mirrors
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f346ee7c80
commit
962a2adb58
2 changed files with 9 additions and 1 deletions
|
@ -14,4 +14,6 @@ docker_auth_config_homedir: /root
|
||||||
docker_start_opts:
|
docker_start_opts:
|
||||||
- -H unix:///var/run/docker.sock
|
- -H unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
docker_registry_mirrors: []
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
|
@ -22,12 +22,18 @@
|
||||||
dest: /etc/systemd/system/docker.service.d/docker-startopts.conf
|
dest: /etc/systemd/system/docker.service.d/docker-startopts.conf
|
||||||
register: docker_startopts
|
register: docker_startopts
|
||||||
|
|
||||||
|
- name: Configure registry mirrors
|
||||||
|
copy:
|
||||||
|
content: '{"registry-mirrors": {{ docker_registry_mirrors | to_json }}}'
|
||||||
|
dest: /etc/docker/daemon.json
|
||||||
|
register: docker_mirrors
|
||||||
|
|
||||||
- name: Restart docker to apply new config
|
- name: Restart docker to apply new config
|
||||||
systemd:
|
systemd:
|
||||||
name: docker.service
|
name: docker.service
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
when: docker_startopts.changed
|
when: docker_startopts.changed or docker_mirrors.changed
|
||||||
|
|
||||||
- name: Create docker configuration dir
|
- name: Create docker configuration dir
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Reference in a new issue