fix(vmware_guest_network): fix idempotency and diff issue due to the …#2547
fix(vmware_guest_network): fix idempotency and diff issue due to the …#2547ryanb74 wants to merge 3 commits into
Conversation
|
Build succeeded. ✔️ ansible-tox-linters SUCCESS in 6m 19s |
|
Looks like I need to work a bit more on that one, I actually missed an issue : MAC address case counts and now there are two NICS for the virtual machine I tested, with the same MAC address but one in lowercase and the other uppercase, we can see there in the "before" section of the description of this PR |
|
According to the following article, mac addresses should always be entered lowercase in vmware : I enhanced the mac_address argument documentation to precise that it is case sensitive. It seems like vmware accepts uppercase mac addresses to configure network adapters, so some people may have uppercase addresses in their systems, maybe the case could even be mixed ??? I wonder if we shouldn't add some piece of code to normalize the user input to whatever comes from the current state of the nic in vmware |
…before state not showing vlan id at all while after state was showing vlan id
9e5157e to
37d641d
Compare
|
I tested the code again and confirm that it looks good and that the code that adds the vlan id in the before diff has the expected impact as long as we use the proper case for mac address. |
|
Build succeeded. ✔️ ansible-tox-linters SUCCESS in 5m 25s |
|
Hi @mariolenz, any update regarding this PR ? |
… to precise that matching is case sensitive
37d641d to
6f38f9f
Compare
|
Build succeeded. ✔️ ansible-tox-linters SUCCESS in 5m 23s |
|
mariolenz
left a comment
There was a problem hiding this comment.
I'm not 100% sure if I understand this bugfix, but to the best of my knowledge it LGTM.
|
Build succeeded (gate pipeline). ✔️ ansible-tox-linters SUCCESS in 5m 07s |
|
Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry. |



…before state not showing vlan id at all while after state was showing vlan id
SUMMARY
When running the guest_vmware_network module, changes are always reported due to the vlan_id not being present in the before_diff, which messes up the comparison between before and after state.
This PR fixes this issue.
ISSUE TYPE
COMPONENT NAME
vmware_guest_network module
ADDITIONAL INFORMATION
Running the module with the following parameters, in check mode with diff mode enabled :
Before changes :
After changes :
We can see that after the change, the module doesn't report "changed" anymore and that there is no diff displayed because no difference was found.