From b597e8e141a68a10abf26550e196bc0dd729c133 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 8 Sep 2022 20:06:13 +0100 Subject: [PATCH] Check endpoint as well as name (#2) --- plugins/modules/portainer_stack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/portainer_stack.py b/plugins/modules/portainer_stack.py index f9cd6e4..dc9a8a8 100644 --- a/plugins/modules/portainer_stack.py +++ b/plugins/modules/portainer_stack.py @@ -140,7 +140,7 @@ def handle_state_present(client, module): target_stack_name = module.params["stack_name"] for stack in stacks: - if stack["Name"] == target_stack_name and int(stack["EndpointID"]) == module.params["endpoint_id"]: + if stack["Name"] == target_stack_name and int(stack["EndpointId"]) == module.params["endpoint_id"]: already_exists = True result["stack_id"] = stack["Id"] break