Allow renew-cron to remove cronjob if it was added earlier

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.
This commit is contained in:
Kristian Rønningen 2018-12-04 11:55:25 +01:00
parent be44ac2dcd
commit 244d6d739f
2 changed files with 1 additions and 1 deletions

View File

@ -16,4 +16,3 @@
loop_var: cert_item
- import_tasks: renew-cron.yml
when: certbot_auto_renew

View File

@ -6,3 +6,4 @@
minute: "{{ certbot_auto_renew_minute }}"
hour: "{{ certbot_auto_renew_hour }}"
user: "{{ certbot_auto_renew_user }}"
state: "{{ 'present' if certbot_auto_renew else 'absent' }}"