docker-registry: Add basic auth support

This commit is contained in:
Timo Makinen 2021-09-14 20:00:00 +00:00
parent c2107bb294
commit 951711bf07
2 changed files with 16 additions and 0 deletions

View file

@ -54,6 +54,16 @@
owner: root
group: docker
- name: copy access file
copy:
dest: /etc/docker-distribution/registry/htpasswd
src: "{{ htpasswd }}"
mode: 0640
owner: root
group: docker
when: htpasswd is defined
notify: restart docker-distribution
- name: start service
service:
name: docker-distribution

View file

@ -7,6 +7,12 @@ storage:
layerinfo: inmemory
filesystem:
rootdirectory: /srv/registry
{% if htpasswd is defined %}
auth:
htpasswd:
realm: Authentication Required
path: /etc/docker-distribution/registry/htpasswd
{% endif %}
http:
addr: :5000
{% if docker_distribution_secret is defined %}