diff --git a/roles/certbot/defaults/main.yaml b/roles/certbot/defaults/main.yaml index 1b615a5..4198941 100644 --- a/roles/certbot/defaults/main.yaml +++ b/roles/certbot/defaults/main.yaml @@ -8,14 +8,15 @@ certbot_timer_name: certbot.timer certbot_timer_state: started certbot_timer_enabled: yes +certbot_cron_state: present certbot_cron_user: root certbot_cron_file_path: /etc/cron.d/certbot certbot_cron_env: path: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin shell: /bin/sh certbot_cron_command: test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew -cerbot_cron_hour: "*/12" -cerbot_cron_minute: "0" +certbot_cron_hour: "*/12" +certbot_cron_minute: "0" certbot_system_timer_on_calender: "*-*-* 00,12:00:00" certbot_system_timer_randomized_delay_sec: 43200 diff --git a/roles/certbot/tasks/main.yaml b/roles/certbot/tasks/main.yaml index d57f078..824d776 100644 --- a/roles/certbot/tasks/main.yaml +++ b/roles/certbot/tasks/main.yaml @@ -74,6 +74,7 @@ job: "{{ item.value }}" user: "{{ certbot_cron_user }}" cron_file: "{{ certbot_cron_file_path }}" + state: "{{ certbot_cron_state }}" loop: "{{ certbot_cron_env | dict2items }}" - name: create job cron: @@ -83,3 +84,4 @@ minute: "{{ certbot_cron_minute }}" cron_file: "{{ certbot_cron_file_path }}" job: "{{ certbot_cron_command }}" + state: "{{ certbot_cron_state }}"