-
Notifications
You must be signed in to change notification settings - Fork 12
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
Getting var type error when attempting to set "params" option #7
Comments
By looking in to "library/centreon_host.py":
I've been trying to set the value directly using
|
Exactly :( on CLAPI, |
Hmmm....I see ;-) anyway, there's definetely no way to implement idempotency without reading the current value, is getparam... According to that centreon/centreon#6178 , an issue has already been raised in this regard. I've got no idea about when this one will get fixed, but as a sake of circumvent I'd see three options so far: 1-Implement a set of options to set those extra attributes inconditionally (breaking idempotency though...). 2-Implement "getparam()" function using a direct call to the CLI at Python module level while waiting for the REST API to get fixed. I agree that this option sounds a bit weird/overkill, but it's clearly the less disruptive one since "centreon-sdk-python" Python module will abstract the underlying request method, so whenever it Centreon REST API will get properly fixed you can fallback to the REST call transparently so no need to modify the "ansible-centreon" neither our playbooks :-). 3-Patch the "centreon-sdk-python" Python module in order to deal with it, since according to issue bellow: centreon/centreon#6178 (comment)
seems that the issue relies on a wrong index typically, so we could also consider implementing a first 'dummy' parameter and then offset the result accordingly. What do you think about it ? |
Another quick and dirty but less intrusive circumvent would consits of setting local facts and use it as kind of "Ansible cookie" that can be check to preserve indempotence on those attributes. |
Hey there,
I'm facing an issue when I attempt to set the params options as per described in the library as per below
It throws the following typing error:
FAILED! => {"changed": false, "msg": "argument params is of type <type 'dict'> and we were unable to convert to list: <type 'dict'> cannot be converted to a list"}
If I set it as a dict:
It also fails with the following error:
FAILED! => {"changed": false, "msg": "name"} to retry, use: --limit @/home/ansible/ansible01/eiffage/centreon.retry
The text was updated successfully, but these errors were encountered: