We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a configuration like this with Puppet:
apply Service for (http_vhost => config in host.vars.http_vhosts) to Host { import "generic-service" check_command = "http" vars += config }
The vars += config part is the part i'm missing.
vars += config
As stated in https://github.com/Icinga/puppet-icinga2/blob/master/README.md#what-isnt-supported this is currently not possible as the icinga2_attributes/Puppet::Icinga2::Utils.attributes function doesn't support it.
Fix icinga2_attributes/Puppet::Icinga2::Utils.attributes
I suggest a solution like this:
icinga2::object::service { 'foo-service': ... vars => { '+=' => 'config' }, ... }
Do you already have talked about this internally? Was where already some playing around with this feature/idea?
puppet module list
puppet -V
The text was updated successfully, but these errors were encountered:
From documentation of icinga2::object::service (https://github.com/Icinga/puppet-icinga2/blob/master/manifests/object/service.pp#L152)
# ::icinga2::object::service { 'linux_disks': # import => ['generic-service'], # apply => 'disk_name =>config in host.vars.disks', # check_command => 'disk', # command_endpoint => 'host.name', # vars => 'vars + config', # assign => ['host.vars.os == Linux'], # ignore => ['host.vars.noagent'], # target => '/etc/icinga2/zones.d/global-templates/services.conf', # }
Does this actually work? This would generate a configuration like this:
... vars = vars + config ...
Is this the same as?
... vars += config ...
Sorry, something went wrong.
Correct. vars += config is the short syntax for vars = vars + config. Both is correct Icinga syntax. The module supports only the long version.
Ha, alright this was easier then i thought. Thanks! :) Could this please be documented? Perhaps somewhere around https://github.com/Icinga/puppet-icinga2/blob/master/README.md#parsing-configuration? Because the following sounds like its just not possible:
Assignments other than simple attribution are not currently possible either, e.g. building something like vars += config
1ff191e
fix voxpupuli#352 update documentation about += operator
b4eb082
lbetz
No branches or pull requests
Expected Behavior
Generate a configuration like this with Puppet:
The
vars += config
part is the part i'm missing.Current Behavior
As stated in https://github.com/Icinga/puppet-icinga2/blob/master/README.md#what-isnt-supported this is currently not possible as the icinga2_attributes/Puppet::Icinga2::Utils.attributes function doesn't support it.
Possible Solution
Fix icinga2_attributes/Puppet::Icinga2::Utils.attributes
I suggest a solution like this:
Do you already have talked about this internally? Was where already some playing around with this feature/idea?
Your Environment
puppet module list
): Forked master with enhancementspuppet -V
): 4.10.1The text was updated successfully, but these errors were encountered: