Hi, Having annoyed some of you more than enough for today, I wanted to put this on the mailing list so someone else could take a look at what I'm doing wrong.
Using the new puppet-icinga2-rewrite module, I'm attempting to create a Apply Service rule for some of our puppetized hosts based on their host vars. However, since the puppet module usually quotes strings, unless they're constants or functions, I cannot simple put something like: > apply Service for (vhost => config in host.vars.vhosts) to Host { > display_name = "http check" > name = "check_http" > vars.http_vhost = vhost > vars += config > check_command = "http" > check_interval = 300 > retry_interval = 60 > assign where host.vars.os == "linux" && host.vars.vhosts > ignore where !host.address > } Instead I've been trying and been confirmed in using functions. However, I can't seem to figure out which parameter names to use to get it working. With any combination I've been trying so far, the resulting check command has always been > [2016-11-17 18:33:40 +0100] notice/Process: Running command > '/usr/lib/nagios/plugins/check_http' '-H' '' '-I' '' '-u' '': PID 18487 Here's the config as puppet currently produces it: > # This file is managed by Puppet. DO NOT EDIT. > > apply Service for (vhost => config in host.vars.vhosts) to Host { > display_name = "http check" > name = "check_http" > vars.http_vhost = {{ return macro("$vhost$") }} > vars.http_address = {{ return macro("$config.address$") }} > vars.http_uri = {{ return macro("$config.uri$") }} > check_command = "http" > check_interval = 300 > retry_interval = 60 > assign where host.vars.os == "linux" && host.vars.vhosts > ignore where !host.address > } What would be the correct variable names to put here? Thanks and best regards, David -- TenTwentyFour S.à r.l. W: www.tentwentyfour.lu T: +352 20 211 1024 F: +352 20 211 1023 9, avenue des Hauts-Fourneaux L-4362 Esch/Alzette
signature.asc
Description: OpenPGP digital signature
_______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users