From aca8a3b4d7b714f49d7e945468348e4cddb2a8bf Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Fri, 20 Oct 2017 11:59:45 +0200 Subject: [PATCH] ovirt_vms: Don't start VM if state is present (#31698) --- lib/ansible/modules/cloud/ovirt/ovirt_vms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vms.py b/lib/ansible/modules/cloud/ovirt/ovirt_vms.py index 02da72407c..dd733eb323 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vms.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vms.py @@ -47,7 +47,8 @@ options: When C(state) is I(registered) and the unregistered VM's name belongs to an already registered in engine VM in the same DC then we fail to register the unregistered template." - - "I(present) and I(running) are equal states." + - "I(present) state will create/update VM and don't change its state if it already exists." + - "I(running) state will create/update VM and start it." - "I(next_run) state updates the VM and if the VM has next run configuration it will be rebooted." - "Please check I(notes) to more detailed description of states." - "I(registered) is supported since 2.4" @@ -1226,7 +1227,7 @@ def main(): ) # Run the VM if it was just created, else don't run it: - if state == 'running' or vm is None: + if state == 'running': initialization = _get_initialization(sysprep, cloud_init, cloud_init_nics) ret = vms_module.action( action='start',