Skip to content
New issue

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

templates doesn't have any effect #8178

Closed
formorer opened this issue Aug 14, 2020 · 2 comments
Closed

templates doesn't have any effect #8178

formorer opened this issue Aug 14, 2020 · 2 comments
Labels
no-issue Better asked in one of our support channels

Comments

@formorer
Copy link
Contributor

Describe the bug

The Terraform terraform only allows to use the templates = [ "template" ] notation. Unfortunately it seems that it doesn't have
any effect.

To Reproduce

I can reproduce this with config files:

template Host "foo" {
  vars.foo = "bar"
}

object Host "bar" {
  templates = [ "foo" ]
  check_command = "dummy"
}

Restarting Icinga and asking the API, tells me that the template is defined:

http -a root:$ICINGA_PASSWORD --verify no https://localhost:5665/v1/objects/hosts  | jq ".results[].attrs.templates"
[
  "foo"
]

But:

http -a root:$ICINGA_PASSWORD --verify no https://localhost:5665/v1/objects/hosts  | jq ".results[].attrs.vars"
null

When using import we get the interestring effect that there is also a template defined like the host:

http -a root:$ICINGA_PASSWORD --verify no https://localhost:5665/v1/objects/hosts  | jq ".results[].attrs.templates"
[
  "bar",
  "foo"
]

And now we have:

http -a root:$ICINGA_PASSWORD --verify no https://localhost:5665/v1/objects/hosts  | jq ".results[].attrs.vars"
{
  "foo": "bar"
}

Also adding the hostname to the list of templates doesn't have any effect.

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version): 2.11.4
  • Operating System and version: Debian 10
  • Enabled features (icinga2 feature list): api checker debuglog mainlog notification
@Al2Klimov
Copy link
Member

You have to import the template explicitly.

@Al2Klimov Al2Klimov added the no-issue Better asked in one of our support channels label Aug 14, 2020
@formorer
Copy link
Contributor Author

That doesn't help me. This should work as documented, why doesn't it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue Better asked in one of our support channels
Projects
None yet
Development

No branches or pull requests

2 participants