19 lines
430 B
YAML
19 lines
430 B
YAML
---
|
|
- name: Stop Apache
|
|
service:
|
|
name: apache2
|
|
state: stopped
|
|
|
|
- name: Ensure SSL certificate exists
|
|
shell: "certbot certonly --agree-tos --email certs@susurrando.com -n --standalone -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
|