add CA conf for private registry

This commit is contained in:
Kevin TIBI 2017-11-10 14:25:37 +00:00
parent 1b96a20895
commit b73b0b8a4d
5 changed files with 32 additions and 0 deletions

View File

@ -17,3 +17,9 @@ docker_storage_volume_thinpool_meta: docker-thinpoolmeta
# Size of the docker storage metadata LVM volume (see lvol module size
# argument).
docker_storage_volume_thinpool_meta_size: 1%VG
# URL of docker registry
docker_registry:
# CA of docker registry
docker_registry_ca:

View File

@ -25,5 +25,11 @@ docker_storage_thinpool_autoextend_threshold: 80
# Percentage by which to extend thin-provisioned docker storage volumes.
docker_storage_thinpool_autoextend_percent: 20
# URL of docker registry
docker_registry:
# CA of docker registry
docker_registry_ca:
# MTU to pass through to containers not using net=host
docker_daemon_mtu: 1500

View File

@ -4,3 +4,9 @@
name: docker
state: restarted
become: True
- name: reload docker service
service:
name: docker
state: reloaded
become: True

View File

@ -5,3 +5,11 @@
dest: /etc/docker/daemon.json
become: True
notify: restart docker service
- name: Ensure the CA file for private registry exists
copy:
src: "{{ docker_registry_ca }}"
dest: "/etc/docker/certs.d/{{ docker_registry }}/ca.crt"
become: True
when: docker_registry is not none and docker_registry_ca is not none
notify: reload docker service

View File

@ -22,6 +22,12 @@
# argument).
#docker_storage_volume_thinpool_meta_size:
# URL of docker registry
#docker_registry:
# CA of docker registry
#docker_registry_ca:
###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes