From 91905980967d0cdf16bf3f010f7a7f53943932a4 Mon Sep 17 00:00:00 2001 From: Andrew Makousky Date: Fri, 25 Aug 2017 09:21:02 -0500 Subject: [PATCH] Set task status correctly for vmware_guest shutdown and reboot. (#26515) --- lib/ansible/modules/cloud/vmware/vmware_guest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index de5c7e52b52..35a4aea40fd 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -572,6 +572,9 @@ class PyVmomiHelper(object): task = vm.ShutdownGuest() else: task = vm.RebootGuest() + # Set result['changed'] immediately because + # shutdown and reboot return None. + result['changed'] = True else: result['failed'] = True result['msg'] = "VM %s must be in poweredon state & tools should be installed for guest shutdown/reboot" % vm.name