-
Notifications
You must be signed in to change notification settings - Fork 30
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
Director 1.10 - Error when modifying service apply rules #190
Comments
I don't think your trick will work. When you look at
And here are the service apply rules:
Note the different object types. It works for service templates, because service templates and services both can be found under I opened an upstream-issue here: Icinga/icingaweb2-module-director#2642 |
Using the name doesn't work either according to the docs:
This part from the docs isn't true anymore;
|
Thanks for looking into this and highlighting the Director documentation. This needs to be addressed in Director then. The endpoint /service is referenced directly in the class ServiceApplyRule. Service, Service Template and Service Apply all use the same endpoint. That is why the workaround works. The class ServiceApplyRule is built on top of Icinga2APIObject, adds no other fields. It uses additional endpoint /serviceapplyrules only to find the id of the object, by filtering the list by object_name (which, however, as pointed out might not be unique).
Generally this still implies that one should use unique object names for the service apply rules when working with the ansible collection. As the 'id' for the service apply rule currently cannot be assigned using ansible module "t_systems_mms.icinga_director.icinga_service_apply", deploying different service apply rules with the same name will also not work. |
So what's your preferred solution? Implementing the workaround so we check for |
Checking the I believe the service apply rules, as other objects, should have unique names. The So actually, when using the ansible collection, it is already not necessary to have non-unique Director should have Added an upstream request for that Icinga/icingaweb2-module-director#2659 And till the one or another bugfix comes I'll have to use the workaround and will also maintain the objects with unique names. |
Hi all, any news on this bug? The error is still present when I try to pass on an already present service_apply Thanks |
The upstream-issue is unanswered, so I don't know if this will ever be fixed. I'm open to accepting a PR to workaround this issue. |
Hi, I've forked the repo and I'm going to take a look for a workaround Thanks |
Thank you very much @gianmarco-mameli - I can confirm that this fixes the issue with the latest director verison 1.11.0 |
Description
Apparently, director versions later than 1.8.1 introduced a change in the API endpoint "director/serviceapplyrules".
This change broke functionality in module "icinga_service_apply.py"
Broken function:
Reproduction steps
Current Behavior
Error displayed when modifying an object.
Expected Behavior
Object is modified, no error required.
Additional information
The module "icinga_service_apply.py" looks for "id" key in the returned JSON object. The key "id" was removed from the API endpoint JSON output in Director 1.10 or even earlier.
Director 1.8.1
Director 1.10.1 / 1.10.2
A fix that seems to do the trick (taken from service_template.py):
This also makes Class ServiceApplyRule obsolete, but service template also does not have one...
The text was updated successfully, but these errors were encountered: