✨ Add a role to allow letsencrypt access in Apache2
This commit is contained in:
parent
17d7aa704a
commit
1fe6526898
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