1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

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

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

Signed-off-by: antoine <antoine.blin@gandi.net>

* Update doc: add alias env_files

Signed-off-by: antoine <antoine.blin@gandi.net>

* 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>

---------

Signed-off-by: antoine <antoine.blin@gandi.net>
Co-authored-by: Sergey <6213510+sshnaidm@users.noreply.github.com>
This commit is contained in:
ant-bl 2024-01-25 13:04:40 +01:00 committed by GitHub
parent a6ece472c4
commit 2e661d1700
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -57,7 +57,7 @@ ARGUMENTS_SPEC_CONTAINER = dict(
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=[
@ -407,7 +407,9 @@ class PodmanModuleParams:
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')

View file

@ -295,7 +295,10 @@ options:
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.