mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
If the `certbot_auto_renew` variable was `True`, and the cronjob was added, setting it to `False` would not remove it. By always including the `renew-cron.yml` task file, and instead checking the `certbot_auto_renew` value there, and pick a value for `state` based on it, we can clean up a cronjob if it is no longer wanted.
10 lines
373 B
YAML
10 lines
373 B
YAML
---
|
|
- name: Add cron job for certbot renewal (if configured).
|
|
cron:
|
|
name: Certbot automatic renewal.
|
|
job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
|
|
minute: "{{ certbot_auto_renew_minute }}"
|
|
hour: "{{ certbot_auto_renew_hour }}"
|
|
user: "{{ certbot_auto_renew_user }}"
|
|
state: "{{ 'present' if certbot_auto_renew else 'absent' }}"
|