2022-10-11 09:19:07 +02:00
|
|
|
---
|
|
|
|
- name: Ensure UFW is enabled and accepting HTTPS traffic
|
|
|
|
ufw:
|
|
|
|
state: enabled
|
|
|
|
policy: deny
|
|
|
|
rule: allow
|
|
|
|
to_port: '443'
|
|
|
|
|
|
|
|
- name: Ensure UFW is enabled and accepting HTTP traffic
|
|
|
|
ufw:
|
|
|
|
state: enabled
|
|
|
|
policy: deny
|
|
|
|
rule: allow
|
|
|
|
to_port: '80'
|
|
|
|
|
|
|
|
- name: Ensure certbot is installed
|
|
|
|
apt:
|
|
|
|
name: certbot
|
|
|
|
|
|
|
|
- name: Stop Apache2 to request certificate
|
|
|
|
service:
|
|
|
|
name: apache2
|
|
|
|
state: stopped
|
|
|
|
|
|
|
|
- name: Request certificate for node-metrics
|
2023-08-23 12:22:35 +02:00
|
|
|
shell: "certbot certonly --agree-tos --email {{ letsencrypt_account_email }} --standalone -n -d node-metrics-{{ ansible_fqdn }}"
|
2022-10-11 09:19:07 +02:00
|
|
|
args:
|
2023-08-23 12:22:35 +02:00
|
|
|
creates: "/etc/letsencrypt/live/node-metrics-{{ ansible_fqdn }}/fullchain.pem"
|
2022-10-11 09:19:07 +02:00
|
|
|
|
|
|
|
- name: Request certificate for postfix-metrics
|
2023-08-23 12:22:35 +02:00
|
|
|
shell: "certbot certonly --agree-tos --email {{ letsencrypt_account_email }} --standalone -n -d postfix-metrics-{{ ansible_fqdn }}"
|
2022-10-11 09:19:07 +02:00
|
|
|
args:
|
2023-08-23 12:22:35 +02:00
|
|
|
creates: "/etc/letsencrypt/live/postfix-metrics-{{ ansible_fqdn }}/fullchain.pem"
|