Closed Napsty closed 2 years ago
Hi Claudio,
vars has to be a hash. So your yaml code must look like that:
profile::icinga2master::icinga2_object_host:
generic-host:
check_command: hostalive_4
check_interval: 1m
max_check_attempts: 3
retry_interval: 30s
vars
custom_var: Feuerstein
target: /etc/icinga2/conf.d/templates.conf
template: true
@lbetz Lennart, as always, you're faster than I documenting the current problem internally ;-). Will try this!
I am on vacation at home.
On 21. Sep 2022, at 09:37, Claudio Kuenzler @.***> wrote:
@lbetz https://github.com/lbetz Lennart, as always, you're faster than I documenting the current problem internally ;-). Will try this!
— Reply to this email directly, view it on GitHub https://github.com/Icinga/puppet-icinga2/issues/710#issuecomment-1253323270, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOULIVOZSWYJEN33T4CXDV7K3NBANCNFSM6AAAAAAQRYQOEE. You are receiving this because you were mentioned.
Working, thanks for the quick solution!
Context
Icinga2 supports the definition of custom variables in the templates, for example host templates. These custom vars are then automatically applied on all the Hosts using this host template.
But how can this be added with the Puppet module?
Expected Behavior
Adding the custom variable to the host template "generic-host", configured in Puppet:
Results in the following template in the final config file (/etc/icinga2/conf.d/templates.conf):
Current Behavior
Puppet run falls on its nose, stating that:
I also tried it with
vars.custom_var: '-:Feuerstein'
but same error.Your Environment
puppet module list
): icinga-icinga2 (v3.3.1)puppet -V
): 7.19.0Thanks for any hints.