docker-registry: Add basic auth support
This commit is contained in:
parent
c2107bb294
commit
951711bf07
2 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Reference in a new issue