Don't write docker proxy config if docker_mirror undef

If docker_mirror isn't set, we set one. But if we do it when mirror_fqdn
isn't set, we get a bogus value. Put in guards for that so that we don't
write out bad values.

Change-Id: Ie56d9a83fbabcc99420ce28a8a8f1bb562db0470
This commit is contained in:
Monty Taylor 2018-07-16 12:46:44 -05:00
parent 899bd89833
commit b640d5c97a
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@
- name: Set docker_mirror fact for upstream docker
when:
- docker_mirror is not defined
- mirror_fqdn is defined
- use_upstream_docker
set_fact:
docker_mirror: "http://{{ mirror_fqdn }}:8082"
@ -14,12 +15,15 @@
- name: Set docker_mirror fact for distro docker
when:
- docker_mirror is not defined
- mirror_fqdn is defined
- not use_upstream_docker
set_fact:
docker_mirror: "http://{{ mirror_fqdn }}:8081/registry-1.docker/"
- name: Install dockerhub proxy configuration
become: yes
when:
- docker_mirror is defined
template:
dest: /etc/docker/daemon.json
group: root