zuul-jobs/roles/install-docker/tasks/mirror.yaml
Monty Taylor b640d5c97a
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
2018-07-16 12:47:06 -05:00

33 lines
761 B
YAML

- name: Create docker directory
become: yes
file:
state: directory
path: /etc/docker
- 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"
- 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
mode: 0644
owner: root
src: daemon.json.j2