dsa-puppet-stuff: check for puppet version instead of debian release
authorAurelien Jarno <aurelien@aurel32.net>
Sun, 16 Apr 2017 10:50:54 +0000 (12:50 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 16 Apr 2017 10:52:35 +0000 (12:52 +0200)
As we might install backport versions of puppet.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
modules/debian_org/templates/dsa-puppet-stuff.cron.erb

index 50ce9d9..0f772b5 100644 (file)
@@ -5,7 +5,7 @@
 
 SHELL=/bin/bash
 @hourly  root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive
-<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) <= 0 -%>
+<% if scope.call_function('versioncmp', [@puppetversion.to_s, '3.0.0']) <= 0 -%>
 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 */2 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 3600 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3000"; 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