mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
refactored to timer routine
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
- name: "reload certbot service"
|
||||
systemd:
|
||||
name: certbot.service
|
||||
name: nginx-certbot.service
|
||||
state: reloaded
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
- name: "restart certbot timer"
|
||||
systemd:
|
||||
name: certbot.timer
|
||||
state: restarted
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
|
@@ -4,20 +4,24 @@
|
||||
state: present
|
||||
when: run_once_nginx_certbot is not defined
|
||||
|
||||
- name: configure certbot.service.tpl
|
||||
- name: configure nginx-certbot.service
|
||||
template:
|
||||
src: certbot.service.j2
|
||||
dest: /etc/systemd/system/certbot.service
|
||||
src: nginx-certbot.service.j2
|
||||
dest: /etc/systemd/system/nginx-certbot.service
|
||||
notify: reload certbot service
|
||||
when: run_once_nginx_certbot is not defined
|
||||
|
||||
- name: configure certbot.timer.tpl
|
||||
template:
|
||||
src: certbot.timer.j2
|
||||
dest: /etc/systemd/system/certbot.timer
|
||||
register: certbot_timer
|
||||
changed_when: certbot_timer.changed or activate_all_timers | bool
|
||||
notify: restart certbot timer
|
||||
- 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"
|
||||
when: run_once_nginx_certbot is not defined
|
||||
|
||||
- name: run the nginx_certbot tasks once
|
||||
|
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Renewal of Let's Encrypt's certificates
|
||||
|
||||
[Timer]
|
||||
OnCalendar=0/12:00:00
|
||||
RandomizedDelaySec={{randomized_delay_sec}}
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user