From 9c5ca13d8448924c7fdb83bb65b58d35a26ce2a7 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Sat, 13 Aug 2022 15:22:15 +0100 Subject: [PATCH] stack creating successfully from file --- ansible/library/portainer.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ansible/library/portainer.py b/ansible/library/portainer.py index 650955f..a9fdf41 100755 --- a/ansible/library/portainer.py +++ b/ansible/library/portainer.py @@ -160,20 +160,18 @@ def run_module(): stacks = client.get("stacks") result["token"] = client.token - # result["stacks"] = stacks + result["stacks"] = stacks file_contents = "" with open(module.params["docker_compose_file_path"]) as f: file_contents = f.read() result["stacks"] = stacks - result["stack_name"] = module.params["stack_name"] body = { - "body_compose_string": { - "name": module.params["stack_name"], - "stackFileContent": file_contents, - }, + "env": [], + "name": module.params["stack_name"], + "stackFileContent": file_contents, } query_params = {