forked from ansible-collections/community.vmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vmware_guest_info - Make "datacenter" property optional (ansible-coll…
…ections#2241) SUMMARY We run a big VMware environment featuring multiple vCenters and multiple datacenters within them. When automating the deployment of VMs at the moment we search for existing machines with the name of the to be deployed machine in order to perform clean-up activities. At the moment we use the guest find module, but it's slow. Therefore we looked into the guest_info module and found that if the VM is unique, the datacenter property is never actually used as it is only relevant in case multiple VMs have been found. In case multiple VMs are found, the folder and datacenter attributes are used to decide on "the right one". Therefore, the datacenter property could as well be an optional parameter on the module and it could simply fail in case there is more than one VM matching and "datacenter" as well as "folder" are required. ISSUE TYPE Feature Pull Request COMPONENT NAME vmware_guest_info.py vmware.py ADDITIONAL INFORMATION Reviewed-by: Mario Lenz <[email protected]>
- Loading branch information
1 parent
3bcd926
commit 5bca41c
Showing
4 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/2241-vmware_guest_info-make-datacenter-property-optional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
minor_changes: | ||
- vmware_guest_info - `datacenter` property is now optional as it only required in cases where the VM is not uniquely identified by `name`. | ||
- vmware.py - Add logic for handling the case where the `datacenter` property is not provided. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters