use certbot plugin for apache
This commit is contained in:
parent
0dfc47f0db
commit
751a0aebec
1 changed files with 7 additions and 10 deletions
|
@ -1,19 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: Stop Apache
|
- name: Ensure certbot software is installed
|
||||||
service:
|
package:
|
||||||
name: apache2
|
name:
|
||||||
state: stopped
|
- certbot
|
||||||
|
- python3-certbot-apache
|
||||||
|
state: latest
|
||||||
|
|
||||||
- name: Ensure SSL certificate exists
|
- name: Ensure SSL certificate exists
|
||||||
shell: "certbot certonly --agree-tos --email certs@susurrando.com -n --standalone -d {{ item.vhostname }}"
|
shell: "certbot certonly --agree-tos --email certs@susurrando.com -n --apache -d {{ item.vhostname }}"
|
||||||
args:
|
args:
|
||||||
creates: "/etc/letsencrypt/archive/{{ item.vhostname }}"
|
creates: "/etc/letsencrypt/archive/{{ item.vhostname }}"
|
||||||
when:
|
when:
|
||||||
- "'ssl' in item"
|
- "'ssl' in item"
|
||||||
- item['ssl']
|
- item['ssl']
|
||||||
loop: "{{ vhosts }}"
|
loop: "{{ vhosts }}"
|
||||||
|
|
||||||
- name: Start Apache
|
|
||||||
service:
|
|
||||||
name: apache2
|
|
||||||
state: started
|
|
||||||
|
|
Loading…
Reference in a new issue