From 0a698a7cd36e0379de3cda25afbdd802bfeaf823 Mon Sep 17 00:00:00 2001 From: Orr Ben Galim Date: Thu, 26 Dec 2024 09:03:54 +0200 Subject: [PATCH] fix failed rebase --- changelogs/fragments/93-bugfix-vm_name-required | 3 +++ plugins/modules/content_template.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/93-bugfix-vm_name-required diff --git a/changelogs/fragments/93-bugfix-vm_name-required b/changelogs/fragments/93-bugfix-vm_name-required new file mode 100644 index 00000000..68c42c6d --- /dev/null +++ b/changelogs/fragments/93-bugfix-vm_name-required @@ -0,0 +1,3 @@ +--- +minor_changes: + - info - Made vm_name variable required only when state is set to present in content_template module \ No newline at end of file diff --git a/plugins/modules/content_template.py b/plugins/modules/content_template.py index 2ed94d8c..4b811ef5 100644 --- a/plugins/modules/content_template.py +++ b/plugins/modules/content_template.py @@ -37,7 +37,7 @@ description: - The name of the VM to be used to create template. type: str - required: true + required: only if state is set to present host: description: - Host onto which the virtual machine template should be placed. @@ -206,7 +206,7 @@ def main(): argument_spec.update( template=dict(type='str', required=True), library=dict(type='str', required=True), - vm_name=dict(type='str', required=True), + vm_name=dict(type='str', required=(argument_spec['state'] == 'present')), host=dict(type='str'), cluster=dict(type='str'), resource_pool=dict(type='str'),