-
Notifications
You must be signed in to change notification settings - Fork 93
[dev.icinga.com #10804] Impossible to use a for-loop variable into apply service vars #340
Comments
Updated by nerzhul on 2015-12-10 14:37:22 +00:00 I propose the following patch If we add %@@ as a tag on the string the string is not parsed it's sent as raw string, permitting to use icinga2 variables instead of dumping variables to string |
Updated by buzzdeee on 2016-02-11 21:37:21 +00:00 I also struggle about this problem, I have this in applys/disk.conf: apply Service "disk" for (disk => config in host.vars.disks) { That is OK so far, and what I want to generate in hosts/foo.conf: vars += { but I get: vars += { PR 162 was rejected, maybe there is a different way to achieve the same? |
Updated by dagobert on 2016-03-12 16:52:31 +00:00 I am implementing many In my opinion the easiest way would be to create a separate object for this purpose that is handling the variables differently to the existing. Trying to put too much logic into the |
Updated by VisionFhg on 2016-04-29 09:58:54 +00:00 Yes, PR162 wasn't the cleanest solution, be we need a way to accomplish this. Right now, we are doing it like this:
And then, using a custom check-command to access the custom variable like this: value => '"$HIERA_KEY$"', |
Updated by buzzdeee on 2016-05-10 21:55:55 +00:00 the custom_append helped me into the right direction. It allowed me to refer to a hosts.vars.blah_blah variable of With regard to the disk enumeration that I mentioned in my with that, I can get around the limitation in the puppet module, |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/10804
Created by nerzhul on 2015-12-09 13:25:44 +00:00
Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-05-10 21:55:55 +00:00 (in Redmine)
Hello
This module is great but there is a big limitation in the vars processing due to the processing of the vars in the apply_service part.
Here is the thing i want to do (hiera form)
mount_path is correctly handled in the display_name by escaping from double-quotes but in the vars hashmap it's impossible to escape from double-quotes.
Here is the result into icinga2
If i try to escape here is the new result
What i expect is:
The problem is due to the function which dumps the vars argument in lib/utils.rb
The interest here is to use a mounts variable (collected by facter and set to host) and generate sensors using NRPE argument. And mount_path is not available in checkCommand if i don't add it to vars in the applyService.
The text was updated successfully, but these errors were encountered: