diff --git a/plugins/modules/portainer_stack.py b/plugins/modules/portainer_stack.py index 6e532ed..2e05dc9 100644 --- a/plugins/modules/portainer_stack.py +++ b/plugins/modules/portainer_stack.py @@ -170,7 +170,8 @@ def handle_state_present(client, module): with open(module.params["docker_compose_file_path"]) as f: contents = f.read() elif module.params.get("stack_definition"): - contents = module.params["stack_definition"] + json_obj = json.load(module.params["stack_definition"]) + contents = json.dumps(json_obj, indent=4) else: raise ValueError("Should not be able to be here!")