Skip to content

Commit

Permalink
Convert DNS domain search to a list (#881)
Browse files Browse the repository at this point in the history
Fix #880

Signed-off-by: Sagi Shnaidman <[email protected]>
  • Loading branch information
sshnaidm authored Dec 13, 2024
1 parent d68ca75 commit 7fa610a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 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 @@ -62,7 +62,7 @@
device_write_iops=dict(type='list', elements='str'),
dns=dict(type='list', elements='str', aliases=['dns_servers']),
dns_option=dict(type='str', aliases=['dns_opts']),
dns_search=dict(type='str', aliases=['dns_search_domains']),
dns_search=dict(type='list', elements='str', aliases=['dns_search_domains']),
entrypoint=dict(type='str'),
env=dict(type='dict'),
env_file=dict(type='list', elements='path', aliases=['env_files']),
Expand Down Expand Up @@ -457,7 +457,9 @@ def addparam_dns_option(self, c):
return c + ['--dns-option', self.params['dns_option']]

def addparam_dns_search(self, c):
return c + ['--dns-search', self.params['dns_search']]
for search in self.params['dns_search']:
c += ['--dns-search', search]
return c

def addparam_entrypoint(self, c):
return c + ['--entrypoint=%s' % self.params['entrypoint']]
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/podman_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@
description:
- Set custom DNS search domains (Use dns_search with '' if you don't wish
to set the search domain)
type: str
type: list
elements: str
aliases:
- dns_search_domains
entrypoint:
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/targets/podman_containers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@
dns_servers:
- 1.1.1.1
- 8.8.4.4
dns_search_domains: example.com
dns_search_domains:
- example.com
capabilities:
- SYS_TIME
- NET_ADMIN
Expand Down

0 comments on commit 7fa610a

Please sign in to comment.