From db7b0b6b2d8d1ad5b4dd92be52bf68e651da1f8e Mon Sep 17 00:00:00 2001 From: antoine Date: Fri, 12 Jan 2024 11:40:44 +0100 Subject: [PATCH 1/3] Update env_file to accept a list of files instead of a single file Signed-off-by: antoine --- plugins/module_utils/podman/podman_container_lib.py | 6 ++++-- plugins/modules/podman_container.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index d0acfcda..36e94369 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -53,7 +53,7 @@ dns_search=dict(type='str', aliases=['dns_search_domains']), entrypoint=dict(type='str'), env=dict(type='dict'), - env_file=dict(type='path'), + env_file=dict(type='list', elements='path', aliases=['env_files']), env_host=dict(type='bool'), etc_hosts=dict(type='dict', aliases=['add_hosts']), expose=dict(type='list', elements='str', aliases=[ @@ -369,7 +369,9 @@ def addparam_env(self, c): return c def addparam_env_file(self, c): - return c + ['--env-file', self.params['env_file']] + for env_file in self.params['env_files']: + c += ['--env-file', env_file] + return c def addparam_env_host(self, c): self.check_version('--env-host', minv='1.5.0') diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index 0fc62e64..51599a7e 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -270,7 +270,8 @@ running, not on the controller machine where Ansible is executing. If you need to copy the file from controller to remote machine, use the copy or slurp module. - type: path + type: list + elements: path env_host: description: - Use all current host environment variables in container. From 6596cc7162304ca2403aaea220ffe86a05412a95 Mon Sep 17 00:00:00 2001 From: antoine Date: Fri, 12 Jan 2024 13:30:15 +0100 Subject: [PATCH 2/3] Update doc: add alias env_files Signed-off-by: antoine --- plugins/modules/podman_container.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index 51599a7e..bfa3ceae 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -272,6 +272,8 @@ copy or slurp module. type: list elements: path + aliases: + - env_files env_host: description: - Use all current host environment variables in container. From 5c89c7239dfef028f23fa1c470423bf9001eef0c Mon Sep 17 00:00:00 2001 From: ant-bl <47523786+ant-bl@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:46:21 +0100 Subject: [PATCH 3/3] Update plugins/module_utils/podman/podman_container_lib.py Use real arg name and not alias Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com> --- plugins/module_utils/podman/podman_container_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index 36e94369..b910a9f6 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -369,7 +369,7 @@ def addparam_env(self, c): return c def addparam_env_file(self, c): - for env_file in self.params['env_files']: + for env_file in self.params['env_file']: c += ['--env-file', env_file] return c