Add certbot apache conf
This commit is contained in:
parent
437be396b3
commit
fd1f692b88
2 changed files with 25 additions and 1 deletions
10
roles/certbot/files/acme.conf
Normal file
10
roles/certbot/files/acme.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Alias /.well-known/acme-challenge /var/www/acme/.well-known/acme-challenge
|
||||||
|
<Location /.well-known/acme-challenge>
|
||||||
|
Require all granted
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine off
|
||||||
|
</IfModule>
|
||||||
|
</Location>
|
||||||
|
<IfModule mod_proxy.c>
|
||||||
|
ProxyPass /.well-known/acme-challenge !
|
||||||
|
</IfModule>
|
|
@ -6,8 +6,22 @@
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
- name: Create acme dir
|
- name: Create acme directory
|
||||||
become: true
|
become: true
|
||||||
file:
|
file:
|
||||||
path: /var/www/acme
|
path: /var/www/acme
|
||||||
state: directory
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Copy acme apache conf
|
||||||
|
become: true
|
||||||
|
copy:
|
||||||
|
src: acme.conf
|
||||||
|
dest: /etc/apache2/conf-available/acme.conf
|
||||||
|
|
||||||
|
- name: Activate acme apache conf
|
||||||
|
become: true
|
||||||
|
command: a2enconf acme
|
||||||
|
register: result
|
||||||
|
changed_when: "'already enabled' not in result.stdout"
|
||||||
|
notify: Reload apache2 service
|
||||||
|
|
Loading…
Reference in a new issue