1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
This commit is contained in:
Abdul Anshad A 2017-06-28 21:17:53 +05:30 committed by James Cammarata
parent 36975c50ef
commit 61b18cc355

View file

@ -1893,6 +1893,12 @@ def main():
elif state == 'absent': elif state == 'absent':
module.exit_json(changed=False, msg="vm %s not present" % guest) module.exit_json(changed=False, msg="vm %s not present" % guest)
# check if user is trying to perform state operation on a vm which doesn't exists
elif state in ['present', 'powered_off', 'powered_on'] and not all((vm_extra_config,
vm_hardware, vm_disk, vm_nic, esxi)):
module.exit_json(changed=False, msg="vm %s not present" % guest)
# Create the VM # Create the VM
elif state in ['present', 'powered_off', 'powered_on']: elif state in ['present', 'powered_off', 'powered_on']: