ansible/roles/network/templates/resolv.conf.j2

16 lines
456 B
Django/Jinja

# {{ ansible_managed }}
{% for ns in (network_nameservers | shuffle(seed=inventory_hostname))[:3] %}
nameserver {{ ns }}
{% endfor %}
{% 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 %}