mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Fix 'etc_hosts' to 'AddHost' parameter mapping for podman container quadlet
Signed-off-by: Thomas Preindl <tompre@users.noreply.github.com>
This commit is contained in:
parent
42a04720a7
commit
72de7039a0
2 changed files with 3 additions and 3 deletions
|
|
@ -84,6 +84,7 @@ class ContainerQuadlet(Quadlet):
|
|||
'env': 'Environment',
|
||||
'env_file': 'EnvironmentFile',
|
||||
'env_host': 'EnvironmentHost',
|
||||
'etc_hosts': 'AddHost',
|
||||
'command': 'Exec',
|
||||
'expose': 'ExposeHostPort',
|
||||
'gidmap': 'GIDMap',
|
||||
|
|
@ -249,8 +250,7 @@ class ContainerQuadlet(Quadlet):
|
|||
for i in params["device_write_iops"]:
|
||||
params["podman_args"].append(f"--device-write-iops {i}")
|
||||
if params["etc_hosts"]:
|
||||
for host_ip in params['etc_hosts'].items():
|
||||
params["podman_args"].append(f"--add-host {':'.join(host_ip)}")
|
||||
params['etc_hosts'] = ["%s:%s" % (k, v) for k, v in params['etc_hosts'].items()]
|
||||
if params["env_merge"]:
|
||||
for k, v in params["env_merge"].items():
|
||||
params["podman_args"].append(f"--env {k}={v}")
|
||||
|
|
|
|||
|
|
@ -1275,7 +1275,7 @@
|
|||
- "SecurityLabelFileType=usr_t"
|
||||
- "Environment=BOOL=False"
|
||||
- "PublishPort=9001:8000"
|
||||
- "PodmanArgs=--add-host host2:127.0.0.1"
|
||||
- "AddHost=host2:127.0.0.1"
|
||||
- "Label=somelabel=labelvalue"
|
||||
- "WantedBy=default.target"
|
||||
- "GroupAdd=admin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue