@@ -378,6 +378,21 @@ Linux with hosts | |||
- node2.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 | |||
--------------------- | |||
@@ -0,0 +1,14 @@ | |||
{%- 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 %} |
@@ -4,6 +4,9 @@ include: | |||
{%- if network.host|length > 0 %} | |||
- linux.network.host | |||
{%- endif %} | |||
{%- if network.resolv is defined %} | |||
- linux.network.resolv | |||
{%- endif %} | |||
{%- if network.interface|length > 0 %} | |||
- linux.network.interface | |||
{%- endif %} |
@@ -0,0 +1,10 @@ | |||
{%- 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 %} |