- node2.domain.com | - node2.domain.com | ||||
- service2.domain.com | - service2.domain.com | ||||
Setup resolv.conf, nameservers, domain and search domains | |||||
.. code-block:: yaml | |||||
linux: | |||||
network: | |||||
resolv: | |||||
dns: | |||||
- 8.8.4.4 | |||||
- 8.8.8.8 | |||||
domain: my.example.com | |||||
search: | |||||
- my.example.com | |||||
- example.com | |||||
Linux storage pillars | Linux storage pillars | ||||
--------------------- | --------------------- | ||||
{%- from "linux/map.jinja" import network with context %}# Dynamic resolv.conf(5) file for glibc resolver(3) generated by salt-minion(1) | |||||
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN | |||||
{% if network.resolv.search -%} | |||||
search {{ network.resolv.search|join(' ') }} | |||||
{%- endif %} | |||||
{% if network.resolv.domain -%} | |||||
domain {{ network.resolv.domain }} | |||||
{%- endif %} | |||||
{%- for nameserver in network.resolv.dns %} | |||||
nameserver {{ nameserver }} | |||||
{%- endfor %} | |||||
{%- if network.resolv.options %} | |||||
options {{ options|sort|join(' ') }} | |||||
{%- endif %} |
{%- if network.host|length > 0 %} | {%- if network.host|length > 0 %} | ||||
- linux.network.host | - linux.network.host | ||||
{%- endif %} | {%- endif %} | ||||
{%- if network.resolv is defined %} | |||||
- linux.network.resolv | |||||
{%- endif %} | |||||
{%- if network.interface|length > 0 %} | {%- if network.interface|length > 0 %} | ||||
- linux.network.interface | - linux.network.interface | ||||
{%- endif %} | {%- endif %} |
{%- from "linux/map.jinja" import network with context %} | |||||
{%- if network.enabled %} | |||||
/etc/resolv.conf: | |||||
file.managed: | |||||
- source: salt://linux/files/resolv.conf | |||||
- mode: 644 | |||||
- template: jinja | |||||
{%- endif %} |