-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Using apply in a service causes service_name not to be applied to service leading to duplicate resource issues #429
Comments
Looks completly correct for me. The 'name' to an 'apply for' acts as an prefix to the service name. In your case the service name is given by the content of backends or cache. And this depends on the dictionaries you use. |
By the way you're use the same dictionary to apply two differnet services, set the prefix attribute to get different names. |
Hmmm, okay, if I change the puppet code to this:
I have a different problem then, I get an error saying that the service doesn't match anywhere:
As you can see it doesn't get a name here either. I think that I'm not understanding something about how the hashed data is accessed. This is my structure in yaml:
And my hosts' vars look like this:
Yet I can see that these checks are not applied. |
Please use the parameter prefix of service. |
Sorry I posted this comment and then I went and checked the prefix parameter out and this is exactly what I needed. Many thanks @lbetz |
When using apply in an exported icinga2::object::service resource the resulting service does not have a service name meaning if you want to use the same variable sets for different service check commands you get duplicate resource issues.
Should result in something like the following because the resource title is used for the service name:
But actually results in:
I can see that this doesn't happen when I don't use apply on a service object.
As such I get the following error on a reload of icinga2 if I don't manually add the service name:
If I add the service names for the two Service objects manually on the master then I don't get the configuration conflict issue and the Services are applied correctly and as expected.
My guess that it's an issue with the way that the object template is contructed but having looked at it it's impenetrably incomprehensible to me so I can't work out how to change it to make a pull request.
mod 'icinga-icinga2', '1.3.5'
4.10.8
Kind regards,
Richard
The text was updated successfully, but these errors were encountered: