add client side ssl auth option to docker-registry-proxy role
Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
parent
b6dec401db
commit
514c1dcc6e
3 changed files with 28 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
servername: "registry.example.com"
|
servername: "registry.example.com"
|
||||||
ssl:
|
ssl:
|
||||||
destdir: "/etc/pki/docker-registry/"
|
destdir: "/etc/pki/docker-registry"
|
||||||
certfile_src: "ssl.cert"
|
certfile_src: "ssl.cert"
|
||||||
certfile_dest: "ssl.cert"
|
certfile_dest: "ssl.cert"
|
||||||
keyfile_src: "ssl.key"
|
keyfile_src: "ssl.key"
|
||||||
|
@ -12,8 +12,12 @@ ssl:
|
||||||
auth:
|
auth:
|
||||||
type: basic
|
type: basic
|
||||||
basic:
|
basic:
|
||||||
dest_dir:
|
dest_dir: "/etc/httpd"
|
||||||
userfile_src: /etc/httpd/users.htpasswd
|
userfile_src: users.htpasswd
|
||||||
userfile_dest: /etc/httpd/users.htpasswd
|
userfile_dest: users.htpasswd
|
||||||
|
ssl:
|
||||||
|
dest_dir: "/etc/pki/docker-registry"
|
||||||
|
authca_dest: "/etc/pki/docker-registry/authca.cert"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,18 @@
|
||||||
dest: "{{ auth.basic.destdir }}/{{ auth.basic.userfile_dest }}"
|
dest: "{{ auth.basic.destdir }}/{{ auth.basic.userfile_dest }}"
|
||||||
when: auth.type == "basic"
|
when: auth.type == "basic"
|
||||||
|
|
||||||
|
- name: ensure ssl auth dest dir exists
|
||||||
|
file:
|
||||||
|
path: "{{ auth.ssl.destdir }}"
|
||||||
|
state: directory
|
||||||
|
when: auth.type == "ssl"
|
||||||
|
|
||||||
|
- name: place authca file
|
||||||
|
copy:
|
||||||
|
src: "{{ auth.ssl.authca_src }}"
|
||||||
|
dest: "{{ auth.ssl.destdir }}/{{ auth.ssl.authca_dest }}"
|
||||||
|
when: auth.type == "ssl"
|
||||||
|
|
||||||
- name: Configure the vhost
|
- name: Configure the vhost
|
||||||
template:
|
template:
|
||||||
src: "docker-registry-vhost.conf.j2"
|
src: "docker-registry-vhost.conf.j2"
|
||||||
|
|
|
@ -39,6 +39,10 @@
|
||||||
Allow from all
|
Allow from all
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
|
{% if auth.type == "ssl" %}
|
||||||
|
SSLVerifyClient none
|
||||||
|
SSLCACertificateFile {{ auth.ssl.authca_dest }}
|
||||||
|
{% endif %}
|
||||||
<Location /v2>
|
<Location /v2>
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
Allow from all
|
Allow from all
|
||||||
|
@ -47,6 +51,10 @@
|
||||||
AuthType basic
|
AuthType basic
|
||||||
AuthUserFile {{ auth.basic.userfile_dest }}
|
AuthUserFile {{ auth.basic.userfile_dest }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if auth.type == "ssl" %}
|
||||||
|
SSLVerifyClient require
|
||||||
|
SSLVerifyDepth 1
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
## Read access to authentified users
|
## Read access to authentified users
|
||||||
#<Limit GET HEAD>
|
#<Limit GET HEAD>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue