diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index f38b1264..09287ff6 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -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']), @@ -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']] diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index d754a076..ddef0023 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -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: diff --git a/tests/integration/targets/podman_containers/tasks/main.yml b/tests/integration/targets/podman_containers/tasks/main.yml index 9eabd500..b2158626 100644 --- a/tests/integration/targets/podman_containers/tasks/main.yml +++ b/tests/integration/targets/podman_containers/tasks/main.yml @@ -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