From daf091c1d249703132b35380e7c973a132aca093 Mon Sep 17 00:00:00 2001 From: Keith Burdis Date: Thu, 7 Feb 2013 13:11:20 +0000 Subject: Use exported resources to populate all_hosts array. --- manifests/config.pp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'manifests/config.pp') diff --git a/manifests/config.pp b/manifests/config.pp index 0e0b740..5b714ec 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -11,11 +11,27 @@ class check_mk::config { path => '/etc/nagios/nagios.cfg', notify => Class['check_mk::service'], } - file { '/etc/check_mk/main.mk': - ensure => present, - content => "all_hosts = [ 'lnxmgt-01.sbetenv.ads' ]", - notify => Exec['check_mk-restart'], + concat { '/etc/check_mk/main.mk': + owner => 'root', + group => 'root', + mode => '0644', + } + concat::fragment { 'all_hosts-header': + target => '/etc/check_mk/main.mk', + content => "all_hosts = [\n", + order => 01, + } + concat::fragment { 'all_hosts-footer': + target => '/etc/check_mk/main.mk', + content => "]\n", + order => 03, } + Check_mk::Host <<| |>> { notify => Exec['check_mk-restart'] } + #file { '/etc/check_mk/main.mk': + # ensure => present, + # content => "all_hosts = [ 'lnxmgt-01.sbetenv.ads' ]", + # notify => Exec['check_mk-restart'], + #} exec { 'check_mk-restart': command => '/usr/bin/check_mk -O', refreshonly => true, -- cgit v1.2.3