From 887715317b758d21cbfaa4b553ffd3da1775b657 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 26 Sep 2023 11:44:31 +0200 Subject: [PATCH] Add required=true for task_name Signed-off-by: Alina Buzachis --- plugins/modules/ec2_import_image.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/modules/ec2_import_image.py b/plugins/modules/ec2_import_image.py index 81ea4007a8d..dbf8e896510 100644 --- a/plugins/modules/ec2_import_image.py +++ b/plugins/modules/ec2_import_image.py @@ -26,6 +26,7 @@ - The name of the EC2 image import task. type: str aliases: ["name"] + required: true architecture: description: - The architecture of the virtual machine. @@ -408,16 +409,12 @@ def main(): usage_operation=dict(type="str"), boot_mode=dict(type="str", choices=["legacy-bios", "uefi"]), cancel_reason=dict(type="str"), - task_name=dict(type="str", aliases=["name"]), + task_name=dict(type="str", aliases=["name"], required=True), ) module = AnsibleAWSModule( argument_spec=argument_spec, supports_check_mode=True, - required_if=[ - ["state", "absent", ["task_name"]], - ["state", "present", ["task_name"]], - ], ) state = module.params.get("state")