diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_template.py b/lib/ansible/modules/cloud/ovirt/ovirt_template.py index 8e60a11474..e8e4e38f28 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_template.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_template.py @@ -179,6 +179,11 @@ options: - Upper bound of template memory up to which memory hot-plug can be performed. Prefix uses IEC 60027-2 standard (for example 1GiB, 1024MiB). version_added: "2.6" + clone_name: + description: + - Name for importing Template from storage domain. + - If not defined, C(name) will be used. + version_added: "2.8" extends_documentation_fragment: ovirt ''' @@ -476,6 +481,7 @@ def main(): export_domain=dict(default=None), storage_domain=dict(default=None), exclusive=dict(type='bool'), + clone_name=dict(default=None), image_provider=dict(default=None), image_disk=dict(default=None, aliases=['glance_image_disk_name']), io_threads=dict(type='int', default=None), @@ -534,7 +540,7 @@ def main(): ) elif state == 'imported': template = templates_module.search_entity() - if template: + if template and module.params['clone_name'] is None: ret = templates_module.create( result_state=otypes.TemplateStatus.OK, ) @@ -546,8 +552,9 @@ def main(): name=module.params['template_image_disk_name'] or module.params['image_disk'] ), template=otypes.Template( - name=module.params['name'], + name=module.params['name'] if module.params['clone_name'] is None else module.params['clone_name'], ), + clone=True if module.params['clone_name'] is not None else False, import_as_template=True, )