Hello,
I'm fairly new to Puppet. I'm trying to setup some Nagios checks for systems that have additional vhosts or aliases assigned to them (Nagios is already setup and running without issue). In my node manifest, I have defined:
$nagios_http_alias_check = ["foo1","foo2","foo3"]
And in my apache class I have:
# in case there is no aliases listed, just use the hostname
$nagios_http_alias_list = default_value($nagios_http_alias_check,$hostname)
define create_nagios_http_checks {
@@nagios_service {"check-http_$nagios_http_alias_list":
use => 'check-http',
host_name => $nagios_http_alias_list,
servicegroups => 'all-service-checks,http-checks'
}
}
create_nagios_http_checks { $nagios_http_alias_list: }
However, when I run puppet, I get an error due to the $nagios_http_alias_list mashing all the strings into one:
Duplicate definition: Nagios_service[check-http_foo1foo2foo3] is already defined in file
I know I'm doing something stupid, but I can't figure it out. Any help greatly appreciated.