Skip to content
Snippets Groups Projects
Commit 8de91140 authored by jurgenhaas's avatar jurgenhaas
Browse files

Simplify proxy certificates with letsencrypt, only define them once

parent 0a8468a1
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
src='/etc/letsencrypt/live/{{ item.domain }}' src='/etc/letsencrypt/live/{{ item.domain }}'
dest='/etc/haproxy/certs/{{ item.domain }}.pem' dest='/etc/haproxy/certs/{{ item.domain }}.pem'
regexp='(fullchain)|(privkey)\.pem' regexp='(fullchain)|(privkey)\.pem'
with_items: '{{ proxy_certificates_letsencrypt|default([]) }}' with_items: '{{ proxy_certificates|default([]) }}'
when: item.active|default(true) when: item.letsencrypt|default(false) and item.active|default(true)
notify: notify:
- "Restart HAProxy" - "Restart HAProxy"
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
- name: "Install Certs" - name: "Install Certs"
include: '../../letsencrypt/tasks/cert.yml' include: '../../letsencrypt/tasks/cert.yml'
with_items: '{{ proxy_certificates_letsencrypt|default([]) }}' with_items: '{{ proxy_certificates|default([]) }}'
loop_control: loop_control:
loop_var: domain loop_var: domain
when: domain.active|default(true) when: domain.letsencrypt|default(false) and domain.active|default(true)
- name: "Renew Existing Cert" - name: "Renew Existing Cert"
include: '../../letsencrypt/tasks/renew.yml' include: '../../letsencrypt/tasks/renew.yml'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment