diff options
author | Martin Nečas <necas.marty@gmail.com> | 2019-07-22 22:53:52 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-07-22 13:53:52 -0700 |
commit | 5447dc855b2448830101c3ab3eb5097c22ebad49 (patch) | |
tree | bed93e2d832a3c708f01c564d05a0e47a712aaf7 | |
parent | 8074fa9a3e388072416238aeeac8eab524442dbd (diff) | |
download | ansible-5447dc855b2448830101c3ab3eb5097c22ebad49.tar.gz |
Ovirt correct sysprep backport (#59286)
* use sysprep only when needed (#59196)
* add changelog
-rw-r--r-- | changelogs/fragments/59196-ovirt_use_sysprep_when_needed.yml | 2 | ||||
-rw-r--r-- | lib/ansible/modules/cloud/ovirt/ovirt_vm.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/changelogs/fragments/59196-ovirt_use_sysprep_when_needed.yml b/changelogs/fragments/59196-ovirt_use_sysprep_when_needed.yml new file mode 100644 index 0000000000..e460e2d231 --- /dev/null +++ b/changelogs/fragments/59196-ovirt_use_sysprep_when_needed.yml @@ -0,0 +1,2 @@ +bugfixes: + - "Check when user does pass empty dict to sysprep. Fixes https://github.com/oVirt/ovirt-ansible-vm-infra/issues/104" diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py index d2fae8b0e3..8fcdbbc856 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py @@ -2332,8 +2332,8 @@ def main(): ), wait_condition=lambda vm: vm.status == otypes.VmStatus.UP, # Start action kwargs: - use_cloud_init=True if not module.params.get('cloud_init_persist') and module.params.get('cloud_init') is not None else None, - use_sysprep=True if not module.params.get('cloud_init_persist') and module.params.get('sysprep') is not None else None, + use_cloud_init=True if not module.params.get('cloud_init_persist') and module.params.get('cloud_init') else None, + use_sysprep=True if not module.params.get('cloud_init_persist') and module.params.get('sysprep') else None, vm=otypes.Vm( placement_policy=otypes.VmPlacementPolicy( hosts=[otypes.Host(name=module.params['host'])] |