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:
commit
0d3907d332
4 changed files with 32 additions and 0 deletions
3
roles/apache-letsencrypt/defaults/main.yml
Normal file
3
roles/apache-letsencrypt/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Defaults for role apache-letsencrypt
|
||||||
|
---
|
||||||
|
dehydrated_location: "/usr/local/etc/dehydrated"
|
6
roles/apache-letsencrypt/handlers/main.yml
Normal file
6
roles/apache-letsencrypt/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
# Handlers for role apache-letsencrypt
|
||||||
|
---
|
||||||
|
- name: restart apache2
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: restarted
|
20
roles/apache-letsencrypt/tasks/main.yml
Normal file
20
roles/apache-letsencrypt/tasks/main.yml
Normal 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
|
|
@ -0,0 +1,3 @@
|
||||||
|
<Directory {{ dehydrated_location }}/challenge>
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
Loading…
Reference in a new issue