Add post-hook for letsencrypt certificate

This commit is contained in:
Tunui Franken 2024-03-07 16:45:44 +01:00
parent 0226b9a0a2
commit 2b80d8b762
3 changed files with 4 additions and 0 deletions

View file

@ -3,3 +3,4 @@
virtual_domain: tunuifranken.info virtual_domain: tunuifranken.info
letsencrypt_email: "dns@{{ virtual_domain }}" letsencrypt_email: "dns@{{ virtual_domain }}"
letsencrypt_domain: "{{ ansible_hostname }}.{{ virtual_domain }}" letsencrypt_domain: "{{ ansible_hostname }}.{{ virtual_domain }}"
letsencrypt_post_hook: systemctl restart postfix dovecot

View file

@ -41,6 +41,8 @@
- -m - -m
- "{{ letsencrypt_email }}" - "{{ letsencrypt_email }}"
- --agree-tos - --agree-tos
- --post-hook
- "{{ letsencrypt_post_hook }}"
- name: Set letsencrypt dns-01 challenge argv (staging) - name: Set letsencrypt dns-01 challenge argv (staging)
when: ansible_hostname.endswith('-test') when: ansible_hostname.endswith('-test')

View file

@ -5,6 +5,7 @@
vars: vars:
letsencrypt_domain: "{{ forgejo_domain }}" letsencrypt_domain: "{{ forgejo_domain }}"
letsencrypt_email: "{{ forgejo_server_admin }}" letsencrypt_email: "{{ forgejo_server_admin }}"
letsencrypt_post_hook: systemctl restart apache2
- name: Include apache2 tasks - name: Include apache2 tasks
ansible.builtin.include_tasks: apache2.yml ansible.builtin.include_tasks: apache2.yml