Closed Napsty closed 2 years ago
The solution is right at the beginning of section 'How configuration is paresed' (https://github.com/icinga/puppet-icinga2#how-configuration-is-parsed).
Thanks for the quick answer and hint Lennart. Will try!
But users is not a reserved word and should be quotet by default. Constants, reserved words and what is used as variables in apply for loops are not quotet.
It's interesting. This one works:
service_name: "users"
But this one doesn't:
check_command: "users"
and results in:
apply Service "users" {
import "generic-service"
check_command = users
zone = "master"
command_endpoint = host.vars.client_endpoint
assign where host.vars.os == "Linux"
}
Using the -:
on the check_command does the job:
users:
apply: true
assign:
- "host.vars.os == Linux"
check_command: -:"users"
command_endpoint: host.vars.client_endpoint
import:
- generic-service
service_name: users
target: /etc/icinga2/conf.d/services.conf
zone: master
Thank you for your help!
Since puppet-icinga2 module was updated to the latest version a couple of days ago, we see issues related to "users" and "user" keywords used in configs.
Example 1: users as keyword in check command
A check "users" is applied to all the Linux hosts. Puppet config (YAML style):
This results in the following config on the Icinga 2 servers once Puppet agent ran:
And the corresponding error:
Example 2: user keyword used as variable value
Here we have a similar situation where this time the keyword "user" is used as a variable value, used for a ipmi check. In the host definition we use:
This results in the following Host object on the Icinga 2 server:
This breaks the config parser on the Icinga2 server:
We've tried to use several workarounds to enforce a string on the "user" or "users" keywords, but none worked. We tried:
'"users"'
,"'users'"
,""users""
,'"users"'
but none worked (causes another config error because of a non-valid output).Unfortunately I don't know which version of puppet-icinga2 was used before, but it has worked before the module upgrade.
Expected Behavior
We can use "users" or "user" as values.
Current Behavior
Looks like "users" and "user" has become a reserved keyword and it cannot be used as value anymore? Breaks resulting Icinga2 config.
Your Environment
puppet module list
): icinga-icinga2 (v3.3.1)puppet -V
): 7.17.0