12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #
- # FFHO DNS Server configuration (authoritive / recursive)
- #
- {% set roles = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', []) %}
- bind9:
- pkg.installed:
- - name: bind9
- service.running:
- - enable: True
- - reload: True
- # Reload command
- rndc-reload:
- cmd.wait:
- - watch: []
- - name: /usr/sbin/rndc reload
- # Bind options
- /etc/bind/named.conf.options:
- file.managed:
- {% if 'dns-recursor' in roles %}
- - source: salt://dns-server/named.conf.options.recursor
- {% else %}
- - source: salt://dns-server/named.conf.options
- {% endif %}
- - template: jinja
- - require:
- - pkg: bind9
- - watch_in:
- - cmd: rndc-reload
- # Configure authoritive zones in local config
- /etc/bind/named.conf.local:
- file.managed:
- - source: salt://dns-server/named.conf.local
- - template: jinja
- - require:
- - pkg: bind9
- - watch_in:
- - cmd: rndc-reload
- # Create zones directory
- /etc/bind/zones/:
- file.directory:
- - makedirs: true
- - user: root
- - group: root
- - mode: 755
- - require:
- - pkg: bind9
- # Copy static zone files
- /etc/bind/zones/static:
- file.recurse:
- - source: salt://dns-server/zones/static/
- - file_mode: 644
- - dir_mode: 755
- - user: root
- - group: root
- - clean: True
- - require:
- - file: /etc/bind/zones/
- - watch_in:
- - cmd: rndc-reload
- # Copy generated zone files
- /etc/bind/zones/generated:
- file.recurse:
- - source: salt://dns-server/zones/generated/
- - file_mode: 644
- - dir_mode: 755
- - user: root
- - group: root
- - clean: True
- - require:
- - file: /etc/bind/zones/
- - watch_in:
- - cmd: rndc-reload
|