Dzahn has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/364625 )
Change subject: rancid: use cron{} resource instead of file in /etc/cron.d/
......................................................................
rancid: use cron{} resource instead of file in /etc/cron.d/
Instead of just putting a file into /etc/cron.d/ use proper
cron{} puppet resource for the 2 cronjobs.
There should be no change to the actual commands or times here.
Change-Id: I27fa405adf48bb1e1675080bdbe72170e365f0d7
---
D modules/rancid/files/rancid.cron
M modules/rancid/manifests/init.pp
2 files changed, 13 insertions(+), 10 deletions(-)
Approvals:
jenkins-bot: Verified
Dzahn: Looks good to me, approved
diff --git a/modules/rancid/files/rancid.cron b/modules/rancid/files/rancid.cron
deleted file mode 100644
index a3d1251..0000000
--- a/modules/rancid/files/rancid.cron
+++ /dev/null
@@ -1,4 +0,0 @@
-# Run config differ hourly
-1 * * * * rancid SSH_AUTH_SOCK=/run/keyholder/proxy.sock
/usr/lib/rancid/bin/rancid-run
-# Clean out rancid logs
-50 23 * * * rancid /usr/bin/find /var/log/rancid -type f -mtime +2 -exec
rm {} \;
diff --git a/modules/rancid/manifests/init.pp b/modules/rancid/manifests/init.pp
index 65a2a12..495630c 100644
--- a/modules/rancid/manifests/init.pp
+++ b/modules/rancid/manifests/init.pp
@@ -49,12 +49,19 @@
content => template('rancid/cloginrc.erb'),
}
- file { '/etc/cron.d/rancid':
- require => File['/var/lib/rancid/core'],
- owner => 'root',
- group => 'root',
- mode => '0444',
- source => 'puppet:///modules/rancid/rancid.cron',
+ cron { 'rancid_differ':
+ ensure => 'present',
+ command => 'SSH_AUTH_SOCK=/run/keyholder/proxy.sock
/usr/lib/rancid/bin/rancid-run',
+ user => 'rancid',
+ minute => '1',
+ }
+
+ cron { 'rancid_clean_logs':
+ ensure => 'present',
+ command => '/usr/bin/find /var/log/rancid -type f -mtime +2 -exec rm
{} \;',
+ user => 'rancid',
+ minute => '50',
+ hour => '23',
}
file { '/var/log/rancid':
--
To view, visit https://gerrit.wikimedia.org/r/364625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I27fa405adf48bb1e1675080bdbe72170e365f0d7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits