Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zone dynamic and includes as service dependency #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bind/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ bind_restart:
- watch:
- file: {{ map.chroot_dir }}{{ map.log_dir }}/query.log
- file: bind_key_directory
{% if salt['pillar.get']('bind:config:includes', []) %}
- require:
{% for included_file in salt['pillar.get']('bind:config:includes', []) %}
- file: {{ included_file }}
{% endfor %}
{% endif %}

{{ map.chroot_dir }}{{ map.log_dir }}/query.log:
file.managed:
Expand Down Expand Up @@ -80,6 +86,11 @@ bind_config:
map: {{ map }}
- require:
- pkg: bind
{% if salt['pillar.get']('bind:config:includes', []) %}
{% for included_file in salt['pillar.get']('bind:config:includes', []) %}
- file: {{ included_file }}
{% endfor %}
{% endif %}
- watch_in:
- service: bind

Expand Down Expand Up @@ -206,6 +217,7 @@ bind_rndc_client_config:
{%- set dash_view = '-' + view if view else '' %}
{% for zone, zone_data in view_data.get('configured_zones', {}).items() -%}
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file", false) %}
{%- set zone_dynamic = salt['pillar.get']('bind:available_zones:' + zone + ':dynamic', False) %}
{%- set zone_records = salt['pillar.get']('bind:available_zones:' + zone + ':records', {}) %}
{%- if salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse') %}
{%- do generate_reverse(zone_records, salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse:net'), salt['pillar.get']('bind:available_zones:' + zone + ':generate_reverse:for_zones'), salt['pillar.get']('bind:available_zones', {})) %}
Expand All @@ -221,6 +233,9 @@ zones{{ dash_view }}-{{ zone }}{{ '.include' if serial_auto else ''}}:
- name: {{ zones_directory }}/{{ file }}{{ '.include' if serial_auto else ''}}
- source: {{ zone_source }}
- template: jinja
{% if zone_dynamic %}
- replace: False
{% endif %}
{% if zone_records != {} %}
- context:
zone: zones{{ dash_view }}-{{ zone }}
Expand Down Expand Up @@ -302,3 +317,4 @@ ksk-{{ zone }}:

{% endfor %}
{% endfor %}