Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update env_file to accept a list of files instead of a single file #702

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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=[
Expand Down Expand Up @@ -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_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 @@ -270,7 +270,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