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
|
owner: root
|
||||||
group: docker
|
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
|
- name: start service
|
||||||
service:
|
service:
|
||||||
name: docker-distribution
|
name: docker-distribution
|
||||||
|
|
|
@ -7,6 +7,12 @@ storage:
|
||||||
layerinfo: inmemory
|
layerinfo: inmemory
|
||||||
filesystem:
|
filesystem:
|
||||||
rootdirectory: /srv/registry
|
rootdirectory: /srv/registry
|
||||||
|
{% if htpasswd is defined %}
|
||||||
|
auth:
|
||||||
|
htpasswd:
|
||||||
|
realm: Authentication Required
|
||||||
|
path: /etc/docker-distribution/registry/htpasswd
|
||||||
|
{% endif %}
|
||||||
http:
|
http:
|
||||||
addr: :5000
|
addr: :5000
|
||||||
{% if docker_distribution_secret is defined %}
|
{% if docker_distribution_secret is defined %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue