Closed cavamagie closed 5 years ago
Could you provide some more information?
yes srry you can use this kind of info
roles:
and dnsnameservers: 192.0.2.1 192.0.2.2 work in debian with resolvconf but in redhat the value is not used in the configuration
grep -r dnsnameservers * README.md: dnsnameservers: 192.0.2.1 192.0.2.2 README.md: dnsnameservers: 192.0.2.1 192.0.2.2 README.md: dnsnameservers: 192.168.1.1 templates/ethernet_Debian.j2:{% if item.dnsnameservers is defined %} templates/ethernet_Debian.j2:dns-nameservers {{ item.dnsnameservers }}
Looks like you can set DNS1 and DNS2 in interface config files. Feel free to submit a PR.
ah ok we can add an
{% if item.dnsnameservers is defined %} DNS={{ item.dnsnameservers }} {% endif %}
to jnj file?
That might work for a single server, for two servers you would need to use DNS1 and DNS2. Try it out.
thanks @markgoddard
{% if item.dnsnameservers is defined %} {% if item.dnsnameservers.split(' ')[-2] is defined %} DNS2={{ item.dnsnameservers.split(' ')[-2]}} {% endif %} {% if item.dnsnameservers.split(' ')[-1] is defined %} DNS1={{ item.dnsnameservers.split(' ')[-1]}} {% endif %} {% else %} DNS1=xxxxx DNS2=xxxxx {% endif %}
How about:
{% if item.dnsnameservers is defined %} {% for dns_server in item.dnsnameservers.split(' ')[:2] %} DNS{{ loop.index + 1 }}={{ dns_server }} {% endfor %} {% endif %}
thank you!
in the redhat the dnsnameservers is not enabled??