From 125230bcff9ef4c97e3cc8cb7909d2e634da735b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 30 Nov 2014 10:43:51 +0100 Subject: [PATCH] Need to use /usr/bin/puppet now that /usr/sbin/puppetd is gone --- modules/debian-org/manifests/init.pp | 2 +- .../dsa-puppet-stuff.cron.erb} | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) rename modules/debian-org/{files/dsa-puppet-stuff.cron => templates/dsa-puppet-stuff.cron.erb} (58%) diff --git a/modules/debian-org/manifests/init.pp b/modules/debian-org/manifests/init.pp index 03e8a071..f599a7be 100644 --- a/modules/debian-org/manifests/init.pp +++ b/modules/debian-org/manifests/init.pp @@ -251,7 +251,7 @@ class debian-org { } file { '/etc/cron.d/dsa-puppet-stuff': - source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron', + content => template('debian-org/dsa-puppet-stuff.cron.erb') require => Package['debian.org'], } file { '/etc/ldap/ldap.conf': diff --git a/modules/debian-org/files/dsa-puppet-stuff.cron b/modules/debian-org/templates/dsa-puppet-stuff.cron.erb similarity index 58% rename from modules/debian-org/files/dsa-puppet-stuff.cron rename to modules/debian-org/templates/dsa-puppet-stuff.cron.erb index 1aab5c7d..e6ddd74f 100644 --- a/modules/debian-org/files/dsa-puppet-stuff.cron +++ b/modules/debian-org/templates/dsa-puppet-stuff.cron.erb @@ -5,4 +5,8 @@ SHELL=/bin/bash @hourly root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive +<% if @lsbmajdistrelease <= '7' -%> 34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/sbin/puppetd -o --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi +<% else -%> +34 */4 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/bin/puppet agent --onetime --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi +<% end -%> -- 2.39.2