-
Notifications
You must be signed in to change notification settings - Fork 53
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
[BUG] Unexpected host-update behavior #175
Comments
I took a look into the openapi documentation. There are three different possibilities to change attributes:
For me it seems the best solution to take this parameters as module parameters too. So anyone could decide what is the best option. And about the folder, we should differentiate two cases:
|
Hi Oliver and thanks for your input! That philosophical detour aside, I understand your desire perfectly well and we will take a look at how to solve this. |
Hi Robin,
this will not reset the password or the shell or anything else. And yes, the desired state will be activated. The great danger with the actual handling is, you remove tons of attributes if you dont know it. And here comes a first step... You should comment this problem in the main README.md and in the documentation of the host module. For example:
|
Another point is, there is no info module for hosts. Nothing to gather facts for existing hosts. So there is no easy way to update a host at all. How should i set the old attributes in a playbook, if i do not have a module for that. Should i do an API-Request to fetch the data first and then fumble them apart with ansible_json_query, really? |
Hi Oliver, Regarding the lookup plugin you suggest: I already thought about that too. But the problem is resources: We need to prioritize the little time we have and focus on the most valuable features for now. So every contribution toward that will be appreciated, even if it is a work in progress PR. |
The API supports the three modes "attributes", "update_attributes" and "remove_attributes". Robin and I were recently talking about using these in the collection, as well. |
Excellent, please set update_attributes as the default update_method and please remember to not overwrite the folder if the host already exists. :-) |
@ogaida, if one will not overwrite the folder, then, unfortunately, it will break already existing feature, namely moving existing host from current folder to another folder! |
@ogaida , @robin-tribe29, @lgetwan It might be that I have misunderstood Oliver Gaida's proposal and he exactly proposes the following What's about state dependent default value for
|
@msekania |
@msekania |
regarding Dec 8, 2022 comment: Anyway, what you meant (and Dec 9, 2022 my comment) , is definitely more useful approach! |
@robin-tribe29 Hi Robin, is there any hope that this bug will be fixed soon? |
@ogaida sorry, this one seems to have slipped by. Judging on the lack of affirmative feedback, this seems to be not a huge issue for many, so it was not a pressing matter. Anyway, we want to improve this. To get this straight: The target state would be this:
@msekania and @ogaida can you please confirm this with a thumbs up? |
Hi Robin, thank you very much for your quick answer. one point is very important to make the module idempotent. as we wrote about in November here in this issue, please set update_attributes as the default update_method. Thanks in advance and best regards from Duderstadt ✌️ |
i made a pr last night. it passed the sanity checks. @robin-tribe29 & @lgetwan please give me some feedback to my changes. I brought the attributes update-behavior from the API to the module. So if the host already exists, you can take the arg |
Unfortunately I was negatively surprised today. I wanted to set a new host attribute and unfortunately lost all the remaining attributes that were already set.
If I see this correctly, in the case of an update I currently have to load all existing attributes first, then enrich them with the new attributes and then process them with tribe29.checkmk.host.
I find this procedure to be extremely cumbersome and extremely inflates the ansible playbooks. I would expect the module to recognize and preserve the attributes already set unless explicitly overridden.
What did i run?
i wanted to update an existing host, with:
expexted:
what happend:
The text was updated successfully, but these errors were encountered: