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/)
|
Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
- fix: replace inline module to cron for renew cron
|
||||||
- test: use new docker images
|
- test: use new docker images
|
||||||
|
|
||||||
## [2.0.0] 2018-07-07
|
## [2.0.0] 2018-07-07
|
||||||
|
|
|
@ -35,12 +35,17 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
tags: certbot
|
tags: certbot
|
||||||
|
|
||||||
- name: add certbot renew cron
|
- name: remove old cerbot renew cron
|
||||||
lineinfile:
|
file:
|
||||||
path: /etc/cron.d/certbot
|
path: /etc/cron.d/certbot
|
||||||
owner: root
|
state: absent
|
||||||
group: root
|
tags: certbot
|
||||||
mode: 0644
|
|
||||||
regexp: '^0 */12 * * * root'
|
- name: add certbot renew cron
|
||||||
line: "0 */12 * * * root perl -e 'sleep int(rand(3600))' && certbot -q renew --renew-hook /usr/local/bin/certbot-renew"
|
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
|
tags: certbot
|
||||||
|
|
|
@ -15,11 +15,15 @@ describe file('/var/www/acme') do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe file('/etc/cron.d/certbot') do
|
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 exist }
|
||||||
it { should be_file }
|
it { should be_file }
|
||||||
it { should be_mode 644 }
|
it { should be_mode 600 }
|
||||||
it { should be_owned_by 'root' }
|
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' }
|
it { should contain '--renew-hook /usr/local/bin/certbot-renew' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue