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
|
||||
service:
|
||||
name: apache2
|
||||
state: stopped
|
||||
- name: Ensure certbot software is installed
|
||||
package:
|
||||
name:
|
||||
- certbot
|
||||
- python3-certbot-apache
|
||||
state: latest
|
||||
|
||||
- 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:
|
||||
creates: "/etc/letsencrypt/archive/{{ item.vhostname }}"
|
||||
when:
|
||||
- "'ssl' in item"
|
||||
- item['ssl']
|
||||
loop: "{{ vhosts }}"
|
||||
|
||||
- name: Start Apache
|
||||
service:
|
||||
name: apache2
|
||||
state: started
|
||||
|
|
Loading…
Reference in a new issue