From 7fa610a416a62aa4a2e9d68568da5e9ce3bb2c36 Mon Sep 17 00:00:00 2001 From: Sergey <6213510+sshnaidm@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:34:17 +0200 Subject: [PATCH] Convert DNS domain search to a list (#881) Fix #880 Signed-off-by: Sagi Shnaidman --- plugins/module_utils/podman/podman_container_lib.py | 6 ++++-- plugins/modules/podman_container.py | 3 ++- tests/integration/targets/podman_containers/tasks/main.yml | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) 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