getting rid of resolvconf and managing /etc/resolv.conf directly

This commit is contained in:
Farhad Shahbazi
2017-09-05 12:45:16 +02:00
parent 75fcfd3a0e
commit b38ef68008
4 changed files with 26 additions and 27 deletions

14
templates/resolv.conf.j2 Normal file
View File

@@ -0,0 +1,14 @@
# {{ ansible_managed }}
{% if common_resolvconf_domain -%}
domain {{ common_resolvconf_domain }}
{% endif %}
{% if ansible_local is defined and ansible_local.hardwarenode.hnfqdn and common_resolvconf_hnfqdn -%}
nameserver {{ lookup('dig', ansible_local.hardwarenode.hnfqdn ) }}
{% endif %}
{% for nameserver in common_resolvconf_nameservers -%}
nameserver {{ nameserver }}
{% endfor %}
{% if common_resolvconf_search -%}
search {% for name in common_resolvconf_search %}{{ name }} {% endfor %}
{% endif %}

View File

@@ -1,17 +0,0 @@
# {{ ansible_managed }}
{% if common_resolvconf_domain %}
domain {{ common_resolvconf_domain }}
{% endif %}
{% if ansible_local is defined and ansible_local.hardwarenode.hnfqdn and common_resolvconf_hnfqdn %}
nameserver {{ lookup('dig', ansible_local.hardwarenode.hnfqdn ) }}
{% else %}
{% for n in common_resolvconf_nameservers %}
nameserver {{ n }}
{% endfor %}
{% endif %}
{% if common_resolvconf_search %}
search {% for s in common_resolvconf_search %}{{ s }} {% endfor %}
{% endif %}