From 54a5b73da9aaf36bfbab8544116cd6a32c54a0a7 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 13 Mar 2018 11:08:13 +0100 Subject: [PATCH] Try to make dsa-check-hpssacli cron entry setup code easier to read --- modules/hardware/manifests/raid/proliant.pp | 28 +++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/modules/hardware/manifests/raid/proliant.pp b/modules/hardware/manifests/raid/proliant.pp index 7868e2919..cd8afaade 100644 --- a/modules/hardware/manifests/raid/proliant.pp +++ b/modules/hardware/manifests/raid/proliant.pp @@ -28,22 +28,18 @@ class hardware::raid::proliant { } if $::smartarraycontroller_hpsa { - if $::hostname in [lobos,villa] { - concat::fragment { 'dsa-puppet-stuff--nagios--dsa-check-hpssacli': - target => '/etc/cron.d/dsa-puppet-stuff', - order => '020', - content => @(EOF) - 27 */2 * * * root sleep $(( $RANDOM \% 900 )); dsa-wrap-nagios-check dsa-check-hpssacli --no-battery - | EOF - } - } else { - concat::fragment { 'dsa-puppet-stuff--nagios--dsa-check-hpssacli': - target => '/etc/cron.d/dsa-puppet-stuff', - order => '020', - content => @(EOF) - 27 */2 * * * root sleep $(( $RANDOM \% 900 )); dsa-wrap-nagios-check dsa-check-hpssacli - | EOF - } + $cmd = $hostname ? { + 'lobos' => 'dsa-check-hpssacli --no-battery', + 'villa' => 'dsa-check-hpssacli --no-battery', + default => 'dsa-check-hpssacli' + } + + concat::fragment { 'dsa-puppet-stuff--nagios--dsa-check-hpssacli': + target => '/etc/cron.d/dsa-puppet-stuff', + order => '020', + content => @("EOF") + 27 */2 * * * root sleep $(( RANDOM \% 900 )); dsa-wrap-nagios-check ${cmd} + | EOF } } file { '/etc/cron.d/puppet-nagios-hpsa': ensure => absent, } -- 2.20.1