Merge pull request ' Add a role to allow letsencrypt access in Apache2' (!72) from apache-letsencrypt into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/72
Reviewed-by: dkdent <dkdent@netz39.de>
This commit is contained in:
Stefan Haun 2022-09-06 15:54:30 +00:00
commit 0d3907d332
4 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# Defaults for role apache-letsencrypt
---
dehydrated_location: "/usr/local/etc/dehydrated"

View file

@ -0,0 +1,6 @@
# Handlers for role apache-letsencrypt
---
- name: restart apache2
service:
name: apache2
state: restarted

View file

@ -0,0 +1,20 @@
# Tasks for role apache-letsencrypt
---
- name: Create configuration for access to dehydrated location
ansible.builtin.template:
src: templates/letsencrypt-directory.conf.j2
dest: /etc/apache2/conf-available/letsencrypt-directory.conf
mode: "0644"
owner: root
group: root
notify: restart apache2
- name: Add symlink to enable configuration
ansible.builtin.file:
src: /etc/apache2/conf-available/letsencrypt-directory.conf
dest: /etc/apache2/conf-enabled/letsencrypt-directory.conf
state: link
mode: "0644"
owner: root
group: root
notify: restart apache2

View file

@ -0,0 +1,3 @@
<Directory {{ dehydrated_location }}/challenge>
Require all granted
</Directory>