diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py index 730aa0ed74..dca63dcc7a 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py @@ -316,7 +316,7 @@ class KubeVirtVM(KubeVirtRawModule): definition['spec']['running'] = state == 'running' # Execute the CURD of VM: - template = definition['spec']['template'] + template = definition if ephemeral else definition['spec']['template'] kind = 'VirtualMachineInstance' if ephemeral else 'VirtualMachine' dummy, definition = self.construct_vm_definition(kind, definition, template) result = self.execute_crud(kind, definition)