Skip to content

Commit

Permalink
Remove redundant cron actions
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
Chithrak07 authored Oct 20, 2021
1 parent 90ef15b commit f1b63dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
- name: Reload apache if necessary
meta: flush_handlers

- name: Automatically renew LE certs with cron
- name: Reload Apache to install the renewed certificates.
cron:
name: "Renew letsencrypt SSL certificates"
minute: "{{ letsencrypt_renew_cron_minute }}"
day: "{{ letsencrypt_renew_cron_day }}"
hour: "{{ letsencrypt_renew_cron_hour }}"
job: "/snap/bin/certbot renew --quiet --webroot-path {{ letsencrypt_webroot }} && /usr/sbin/apachectl configtest 2>&1 | /bin/grep -v 'Syntax OK' || {{ service_binary }} {{ apache2_name }} reload"
job: "/usr/sbin/apachectl configtest 2>&1 | /bin/grep -v 'Syntax OK' || {{ service_binary }} {{ apache2_name }} reload"
when: ansible_os_family == 'Debian'
tags:
- letsencrypt_cron
4 changes: 2 additions & 2 deletions tasks/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
- name: Reload nginx if necessary
meta: flush_handlers

- name: Automatically renew LE certs with cron
- name: Reload nginx to install the renewed certificates
cron:
name: "Renew letsencrypt SSL certificates"
minute: "{{ letsencrypt_renew_cron_minute }}"
day: "{{ letsencrypt_renew_cron_day }}"
hour: "{{ letsencrypt_renew_cron_hour }}"
job: "/snap/bin/certbot renew --quiet --webroot-path {{ letsencrypt_webroot }} && /usr/sbin/nginx -tq && {{ service_binary }} nginx reload > /dev/null"
job: "/usr/sbin/nginx -tq && {{ service_binary }} nginx reload > /dev/null"
tags:
- letsencrypt_cron

0 comments on commit f1b63dc

Please sign in to comment.