Created
October 9, 2015 23:55
-
-
Save anonymous/c1716ef25773bcdcdd25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat selections/resolver/init.sls | |
/etc/resolv.conf: | |
file.managed: | |
- user: root | |
- group: root | |
- mode: '0644' | |
- source: salt://selections/resolver/files/resolv.conf | |
- template: jinja | |
- defaults: | |
{% if salt['grains.get']('domain') == 'chi1' or salt['grains.get']('domain') == 'aur1' %} | |
nameservers: {{ salt['pillar.get']('resolver:nameservers', ['172.16.200.181','172.16.208.81']) }} | |
{% else %} | |
nameservers: {{ salt['pillar.get']('resolver:nameservers', ['172.16.208.81','172.16.200.181']) }} | |
{% endif %} | |
searchpaths: {{ salt['pillar.get']('resolver:searchpaths', [salt['grains.get']('domain'),]) }} | |
options: {{ salt['pillar.get']('resolver:options', []) }} | |
$ cat selections/resolver/files/resolv.conf | |
{%- if searchpaths -%} | |
domain veliosystems.com | |
search {% for searchpath in searchpaths %}{{ searchpath }}.example.com {% endfor %}example.com | |
{%- endif %} | |
{%- for nameserver in nameservers %} | |
nameserver {{ nameserver }} | |
{%- endfor %} | |
options ndots:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment