mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
VMware: Gather facts when powerstate is specified (#37908)
This fix adds additional facts after VM powerstate management. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
6e737c8cb6
commit
4edcbeb62d
3 changed files with 8 additions and 2 deletions
|
@ -826,7 +826,6 @@ def set_vm_power_state(content, vm, state, force, timeout=0):
|
|||
result['changed'] = True
|
||||
|
||||
# need to get new metadata if changed
|
||||
if result['changed']:
|
||||
result['instance'] = gather_vm_facts(content, vm)
|
||||
|
||||
return result
|
||||
|
|
|
@ -2134,6 +2134,7 @@ def main():
|
|||
result["changed"] = True
|
||||
if not tmp_result["failed"]:
|
||||
result["failed"] = False
|
||||
result['instance'] = tmp_result['instance']
|
||||
else:
|
||||
# This should not happen
|
||||
raise AssertionError()
|
||||
|
|
|
@ -103,6 +103,12 @@
|
|||
that:
|
||||
- "clone_d1_c1_f0_recreate.results|map(attribute='changed')|unique|list == [false]"
|
||||
|
||||
- name: assert that no changes were made after re-creating VM and task returns facts
|
||||
assert:
|
||||
that:
|
||||
- "'newvm_' + item | basename in clone_d1_c1_f0.results|map(attribute='instance.hw_name')|list"
|
||||
with_items: "{{ vmlist['json'] }}"
|
||||
|
||||
- name: modify the new VMs
|
||||
vmware_guest:
|
||||
validate_certs: False
|
||||
|
|
Loading…
Reference in a new issue