ansible-role-apache_ssl_vhosts/tasks/configure_certificate.yml

17 lines
416 B
YAML
Raw Normal View History

2023-02-09 19:40:08 +01:00
---
2023-05-09 09:24:11 +02:00
- name: Ensure certbot software is installed
package:
name:
- certbot
- python3-certbot-apache
state: latest
2023-02-09 19:40:08 +01:00
- name: Ensure SSL certificate exists
2023-05-09 09:24:11 +02:00
shell: "certbot certonly --agree-tos --email certs@susurrando.com -n --apache -d {{ item.vhostname }}"
2023-02-09 19:40:08 +01:00
args:
creates: "/etc/letsencrypt/archive/{{ item.vhostname }}"
when:
- "'ssl' in item"
2023-09-24 09:12:28 +02:00
- item.ssl
2023-02-09 19:42:32 +01:00
loop: "{{ vhosts }}"