Skip to content

Commit

Permalink
Update env_file to accept a list of files instead of a single file (#702
Browse files Browse the repository at this point in the history
)

* Update env_file to accept a list of files instead of a single file

Signed-off-by: antoine <[email protected]>

* Update doc: add alias env_files

Signed-off-by: antoine <[email protected]>

* Update plugins/module_utils/podman/podman_container_lib.py

Use real arg name and not alias

Co-authored-by: Sergey <[email protected]>

---------

Signed-off-by: antoine <[email protected]>
Co-authored-by: Sergey <[email protected]>
  • Loading branch information
ant-bl and sshnaidm authored Jan 25, 2024
1 parent a6ece47 commit 2e661d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions plugins/module_utils/podman/podman_container_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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=[
Expand Down Expand Up @@ -407,7 +407,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_file']:
c += ['--env-file', env_file]
return c

def addparam_env_host(self, c):
self.check_version('--env-host', minv='1.5.0')
Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/podman_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@
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
aliases:
- env_files
env_host:
description:
- Use all current host environment variables in container.
Expand Down

0 comments on commit 2e661d1

Please sign in to comment.