Permalink
Browse files

try to fix crontab issues

  • Loading branch information...
metakermit committed Nov 16, 2017
1 parent 412d8c9 commit 815cb4d257b175f21702aa2a2e37511abfd2c287
Showing with 19 additions and 4 deletions.
  1. +12 −4 roles/nginx/tasks/config.yml
  2. +7 −0 roles/nginx/templates/letsencrypt_renew.sh
@@ -40,9 +40,17 @@
- name: config | Reload nginx to activate specified site
service: name=nginx state=restarted

- name: config | Add letsencrypt cronjob for cert renewal
- name: config | create letsencrypt renewal script
template:
src: letsencrypt_renew.sh
dest: /usr/local/bin/letsencrypt_renew.sh
owner: root
group: root
mode: 0744

- name: config | Add letsencrypt cron job for cert renewal
cron:
name: letsencrypt_renewal
special_time: weekly
job: letsencrypt renew && service nginx reload
#job: letsencrypt renew --webroot -w /var/www/letsencrypt -m {{ letsencrypt_email }} --agree-tos && service nginx reload
special_time: daily
job: /usr/local/bin/letsencrypt_renew.sh
#job: letsencrypt renew && service nginx reload
@@ -0,0 +1,7 @@
#!/bin/bash

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

letsencrypt renew && service nginx reload

exit

0 comments on commit 815cb4d

Please sign in to comment.