Skip to content

Commit 5b3d8b3

Browse files
committed
Improve ansible roles
1 parent a2a1d6b commit 5b3d8b3

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

roles/docker-registry-proxy/defaults/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ docker_proxy_ecr_access_id:
99
docker_proxy_ecr_secret_key:
1010
docker_proxy_ecr_region:
1111

12-
docker_proxy_ssl_enabled:
12+
# ssl config
13+
docker_proxy_ssl_enabled: false
14+
docker_proxy_ssl_copy_certs: false
1315
docker_proxy_ssl_host_path: /registry
16+
docker_proxy_ssl_host_cert_name: certificate.pem
17+
docker_proxy_ssl_host_key_name: key.pem
1418
docker_proxy_ssl_container_path: /opt/nginx

roles/docker-registry-proxy/tasks/main.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
with_items:
1111
- certificate.pem
1212
- key.pem
13-
when: docker_proxy_ssl_enabled | bool
13+
when:
14+
- docker_proxy_ssl_enabled | bool
15+
- docker_proxy_ssl_copy_certs | bool
1416

1517
- name: Print current cache directory size information
1618
become: true
@@ -44,8 +46,8 @@
4446
-v {{ docker_proxy_cache_path }}:/cache
4547
4648
{% if docker_proxy_ssl_enabled | bool %}
47-
-v {{ docker_proxy_ssl_host_path }}/certificate.pem:{{ docker_proxy_ssl_container_path }}/certificate.pem
48-
-v {{ docker_proxy_ssl_host_path }}/key.pem:{{ docker_proxy_ssl_container_path }}/key.pem
49+
-v {{ docker_proxy_ssl_host_path }}/{{ docker_proxy_ssl_host_cert_name }}:{{ docker_proxy_ssl_container_path }}/certificate.pem
50+
-v {{ docker_proxy_ssl_host_path }}/{{ docker_proxy_ssl_host_key_name }}:{{ docker_proxy_ssl_container_path }}/key.pem
4951
5052
-e ENABLE_SSL=true
5153
-e REGISTRY_HTTP_TLS_KEY={{ docker_proxy_ssl_container_path }}/key.pem

syntax-check.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo "Performing syntax check on ansible playbooks"
6+
7+
ansible-playbook -i hosts --syntax-check playbook-docker-registry-proxy.yaml

0 commit comments

Comments
 (0)