-
Notifications
You must be signed in to change notification settings - Fork 339
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
vmware_tag_manager always returns changed: True
when in set
mode.
#1265
Comments
Yes, it looks like the module always removes all tags and then adds them again one by one when specifying community.vmware/plugins/modules/vmware_tag_manager.py Lines 339 to 349 in fac9919
|
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Sep 22, 2022
vmware_tag_manager: Fix idempotency for state set SUMMARY vmware_tag_manager isn't idempotent when using state: set. Fixes #1265 ISSUE TYPE Bugfix Pull Request COMPONENT NAME vmware_tag_manager ADDITIONAL INFORMATION community.vmware/plugins/modules/vmware_tag_manager.py Lines 339 to 349 in fac9919 elif action == 'set': # Remove all tags first try: if not removed_tags_for_set: for av_tag in available_tag_obj: self.tag_association_svc.detach(tag_id=av_tag.id, object_id=self.dynamic_managed_object) removed_tags_for_set = True self.tag_association_svc.attach(tag_id=tag_obj.id, object_id=self.dynamic_managed_object) changed = True except Error as error: self.module.fail_json(msg="%s" % self.get_error_message(error))
mariolenz
added a commit
to mariolenz/community.vmware
that referenced
this issue
Sep 22, 2022
…s#1465) vmware_tag_manager: Fix idempotency for state set SUMMARY vmware_tag_manager isn't idempotent when using state: set. Fixes ansible-collections#1265 ISSUE TYPE Bugfix Pull Request COMPONENT NAME vmware_tag_manager ADDITIONAL INFORMATION community.vmware/plugins/modules/vmware_tag_manager.py Lines 339 to 349 in fac9919 elif action == 'set': # Remove all tags first try: if not removed_tags_for_set: for av_tag in available_tag_obj: self.tag_association_svc.detach(tag_id=av_tag.id, object_id=self.dynamic_managed_object) removed_tags_for_set = True self.tag_association_svc.attach(tag_id=tag_obj.id, object_id=self.dynamic_managed_object) changed = True except Error as error: self.module.fail_json(msg="%s" % self.get_error_message(error))
1 task
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
vmware_tag_manager always returns
changed: True
when inset
mode.ISSUE TYPE
COMPONENT NAME
plugins/modules/vmware_tag_manager.py
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Targeting vSphere 6.5.0.38000
STEPS TO REPRODUCE
EXPECTED RESULTS
The task should be
changed
only if the set of tags was modified by the plugin.ACTUAL RESULTS
The task is always
changed
if it contains at least one tag.Additional note: on this line,
changed
is set to True unconditionally when inset
mode.https://github.com/ansible-collections/community.vmware/blob/main/plugins/modules/vmware_tag_manager.py#L349
The text was updated successfully, but these errors were encountered: