diff --git a/roles/network/templates/resolv.conf.j2 b/roles/network/templates/resolv.conf.j2 index 266321c..ca0d186 100644 --- a/roles/network/templates/resolv.conf.j2 +++ b/roles/network/templates/resolv.conf.j2 @@ -6,3 +6,10 @@ nameserver {{ ns }} {% if network_resolv_conf_options is defined %} options {{ network_resolv_conf_options | join(' ') }} {% endif %} +{% if network_search is defined %} +{% if network_search is iterable and network_search is not string %} +search {{ network_search | join(' ') }} +{% else %} +search {{ network_search }} +{% endif %} +{% endif %} diff --git a/roles/network/templates/resolved.conf.j2 b/roles/network/templates/resolved.conf.j2 index 95de57d..475cb3c 100644 --- a/roles/network/templates/resolved.conf.j2 +++ b/roles/network/templates/resolved.conf.j2 @@ -4,3 +4,10 @@ {% for ns in (network_nameservers | shuffle(seed=inventory_hostname)) %} DNS={{ ns }} {% endfor %} +{% if network_search is defined %} +{% if network_search is iterable and network_search is not string %} +Domains={{ network_search | join(' ') }} +{% else %} +Domains={{ network_search }} +{% endif %} +{% endif %}