Ansible delivers simple IT automation that ends repetitive tasks and frees up DevOps teams for more strategic work. This project is to enable this automation for NSX-T installation.
Other
171
stars
145
forks
source link
Running in check mode always reports changes, even if there are none. #387
I've noticed some behavior when using these modules with the --check flag that doesn't seem right. Check mode always returns a status of changed, even when no changes are present, as confirmed by running the same playbook again without --check. This makes it difficult to identify resources that will be changed before actually applying the change. The issue may be present in other modules as well, but I have tested this behavior using nsxt_transport_zones and nsxt_policy_segment.
Here's a sample playbook execution that demonstrates the behavior:
I'm having a similier problem to this by nsxt_policy_tier0 module.
The parameter changed is set to True also in case of no diff so this means always changed.
Hi,
I've noticed some behavior when using these modules with the
--check
flag that doesn't seem right. Check mode always returns a status ofchanged
, even when no changes are present, as confirmed by running the same playbook again without--check
. This makes it difficult to identify resources that will be changed before actually applying the change. The issue may be present in other modules as well, but I have tested this behavior usingnsxt_transport_zones
andnsxt_policy_segment
.Here's a sample playbook execution that demonstrates the behavior:
Running the same code again without the
--check
flag reports no changes:Here are snippets of the relevant ansible configurations.
I'm using the current master branch (f75c698e24073305a968ce2f70739fee77a14bb2) and ansible version:
Taking a brief look at the module code, it appears to support check mode.
https://github.com/vmware/ansible-for-nsxt/blob/f75c698e24073305a968ce2f70739fee77a14bb2/plugins/modules/nsxt_transport_zones.py#L203
It looks like the changed state may be hardcoded to
True
?https://github.com/vmware/ansible-for-nsxt/blob/f75c698e24073305a968ce2f70739fee77a14bb2/plugins/modules/nsxt_transport_zones.py#L227
Thank you for taking a look at this and any help you can provide!