thinlinc-server: Use Let's Encrypt certs if available

This commit is contained in:
Timo Makinen 2021-03-22 21:04:37 +00:00
parent ca3270d89b
commit 00088239fa

View file

@ -62,21 +62,27 @@
- name: copy private key
copy:
dest: /opt/thinlinc/etc/tlwebaccess/server.key
src: "/srv/ca/private/{{ inventory_hostname }}.key"
src: "{{ item }}"
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
with_first_found:
- "/srv/letsencrypt/live/{{ inventory_hostname }}/privkey.pem"
- "/srv/ca/certs/{{ inventory_hostname }}.key"
tags: certificates
notify: restart tlwebaccess
- name: copy certificate
copy:
dest: /opt/thinlinc/etc/tlwebaccess/server.crt
src: "/srv/ca/certs/{{ inventory_hostname }}.crt"
src: "{{ item }}"
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
validate: /usr/bin/openssl x509 -in %s -noout
with_first_found:
- "/srv/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem"
- "/srv/ca/private/{{ inventory_hostname }}.crt"
tags: certificates
notify: restart tlwebaccess