infra/roles/common-letsencrypt/tasks/common-letsencrypt.yml

39 lines
920 B
YAML

---
- name: install current letsencrypt wildcards where they should be installed
copy:
src: "/usr/local/etc/letsencrypt/live/{{ item }}"
dest: "/usr/local/etc/certs/"
owner: root
group: root
mode: 0755
tags:
- letsencrypt
- letsencrypt-wildcard
- letsencrypt-certs
#notify: reload nginx
vars:
prediff_cmd: echo
with_items: "{{ letsencrypt_domains }}"
when: letsencrypt_wildcards
loop_control:
label: "{{ item }}"
- name: ensure wildcards dont exist on hosts that shouldnt have them
file:
path: /usr/local/etc/certs/{{ item }}
state: absent
#notify: reload nginx
with_items: "{{ letsencrypt_domains }}"
when:
- false
- not (letsencrypt_allow_wildcards == true or letsencrypt_wildcards == true)
vars:
prediff_cmd: echo
loop_control:
label: "{{ item }}"
tags:
- letsencrypt
- letsencrypt-wildcard
- letsencrypt-certs