123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #
- # 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
- - 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
|