2020-12-24 14:27:31 +01:00
|
|
|
- name: install certbot
|
|
|
|
pacman:
|
|
|
|
name: [certbot,certbot-nginx]
|
|
|
|
state: present
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_nginx_certbot is not defined
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2024-01-04 13:27:07 +01:00
|
|
|
- name: configure nginx-certbot.service
|
2023-04-16 10:33:21 +02:00
|
|
|
template:
|
2024-01-04 13:27:07 +01:00
|
|
|
src: nginx-certbot.service.j2
|
|
|
|
dest: /etc/systemd/system/nginx-certbot.service
|
2023-04-16 10:33:21 +02:00
|
|
|
notify: reload certbot service
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_nginx_certbot is not defined
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2024-01-04 13:27:07 +01:00
|
|
|
- name: set service_name to the name of the current role
|
|
|
|
set_fact:
|
|
|
|
service_name: "{{ role_name }}"
|
|
|
|
when: run_once_nginx_certbot is not defined
|
|
|
|
|
|
|
|
- name: "include role for systemd-timer for {{service_name}}"
|
|
|
|
include_role:
|
|
|
|
name: systemd-timer
|
|
|
|
vars:
|
|
|
|
on_calendar: "{{on_calendar_renew_lets_encrypt_certificates}}"
|
|
|
|
persistent: "true"
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_nginx_certbot is not defined
|
|
|
|
|
|
|
|
- name: run the nginx_certbot tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_nginx_certbot: true
|
|
|
|
when: run_once_nginx_certbot is not defined
|