fix: replace inline module to cron for renew cron
This commit is contained in:
parent
255e131a25
commit
4c2c33f8af
3 changed files with 19 additions and 9 deletions
|
@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||
|
||||
## [Unreleased]
|
||||
- fix: replace inline module to cron for renew cron
|
||||
- test: use new docker images
|
||||
|
||||
## [2.0.0] 2018-07-07
|
||||
|
|
|
@ -35,12 +35,17 @@
|
|||
mode: 0644
|
||||
tags: certbot
|
||||
|
||||
- name: add certbot renew cron
|
||||
lineinfile:
|
||||
- name: remove old cerbot renew cron
|
||||
file:
|
||||
path: /etc/cron.d/certbot
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
regexp: '^0 */12 * * * root'
|
||||
line: "0 */12 * * * root perl -e 'sleep int(rand(3600))' && certbot -q renew --renew-hook /usr/local/bin/certbot-renew"
|
||||
state: absent
|
||||
tags: certbot
|
||||
|
||||
- name: add certbot renew cron
|
||||
cron:
|
||||
name: certbot-renew
|
||||
user: root
|
||||
hour: '*/12'
|
||||
minute: 0
|
||||
job: perl -e 'sleep int(rand(3600))' && certbot -q renew --renew-hook /usr/local/bin/certbot-renew
|
||||
tags: certbot
|
||||
|
|
|
@ -15,11 +15,15 @@ describe file('/var/www/acme') do
|
|||
end
|
||||
|
||||
describe file('/etc/cron.d/certbot') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/var/spool/cron/crontabs/root') do
|
||||
it { should exist }
|
||||
it { should be_file }
|
||||
it { should be_mode 644 }
|
||||
it { should be_mode 600 }
|
||||
it { should be_owned_by 'root' }
|
||||
it { should be_grouped_into 'root' }
|
||||
it { should be_grouped_into 'crontab' }
|
||||
it { should contain '--renew-hook /usr/local/bin/certbot-renew' }
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue