diff --git a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml index 2371c089ee..faffde72ca 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml @@ -121,7 +121,7 @@ - generate_secrets - name: Get the DNS servers in use on the host - shell: grep nameserver /etc/resolv.conf + command: grep nameserver /etc/resolv.conf register: nameservers when: - lxc_cache_resolvers is not defined @@ -130,9 +130,9 @@ - name: Set lxc_cache_resolvers fact set_fact: - lxc_cache_resolvers: "[\"{{ nameservers.stdout_lines | join('\",\"') }}\"]" + lxc_cache_resolvers: "{{ nameservers.stdout_lines }}" when: - - nameservers is defined + - lxc_cache_resolvers is not defined tags: - set-fact-lxc_cache_resolvers diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index bf5d0ca563..b19376534d 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -89,7 +89,8 @@ lxc_net_netmask: 255.255.255.0 lxc_net_dhcp_range: 10.255.255.2,10.255.255.253 ## LXC Container Settings -lxc_cache_resolvers: {{ lxc_cache_resolvers }} +lxc_cache_resolvers: +{{ lxc_cache_resolvers | to_nice_yaml }} ## Security hardening apply_security_hardening: true