mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
vsphere_guest: when creating a guest, gather facts about it *before* disconnect
This commit is contained in:
@@ -1319,9 +1319,10 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest,
|
|||||||
# Power on the VM if it was requested
|
# Power on the VM if it was requested
|
||||||
power_state(vm, state, True)
|
power_state(vm, state, True)
|
||||||
|
|
||||||
|
vmfacts=gather_facts(vm)
|
||||||
vsphere_client.disconnect()
|
vsphere_client.disconnect()
|
||||||
module.exit_json(
|
module.exit_json(
|
||||||
ansible_facts=gather_facts(vm),
|
ansible_facts=vmfacts,
|
||||||
changed=True,
|
changed=True,
|
||||||
changes="Created VM %s" % guest)
|
changes="Created VM %s" % guest)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user