mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-15 17:20:21 +00:00
Merge pull request #49 from joe-bowman/add-support-for-forward-zones
add support for forward zones
This commit is contained in:
commit
81fea01f6d
4 changed files with 31 additions and 3 deletions
|
@ -11,6 +11,13 @@
|
|||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||
zone "{{ key }}" {
|
||||
type {{ args['type'] }};
|
||||
{% if args['type'] == 'forward' -%}
|
||||
forwarders {
|
||||
{% for forwarder in args.forwarders -%}
|
||||
{{ forwarder }};
|
||||
{% endfor -%}
|
||||
};
|
||||
{% else -%}
|
||||
file "{{ file }}";
|
||||
{% if args['type'] == "master" -%}
|
||||
{% if args['notify'] -%}
|
||||
|
@ -22,6 +29,6 @@ zone "{{ key }}" {
|
|||
notify no;
|
||||
masters { {{ masters }} };
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
};
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
@ -10,11 +10,19 @@
|
|||
{%- macro zone(key, args, file, masters) %}
|
||||
zone "{{ key }}" {
|
||||
type {{ args['type'] }};
|
||||
{% if args['type'] == 'forward' -%}
|
||||
forwarders {
|
||||
{% for forwarder in args.forwarders -%}
|
||||
{{ forwarder }};
|
||||
{% endfor -%}
|
||||
};
|
||||
{% else -%}
|
||||
{% if args['dnssec'] is defined and args['dnssec'] -%}
|
||||
file "zones/{{ file }}.signed";
|
||||
{% else -%}
|
||||
file "zones/{{ file }}";
|
||||
{%- endif %}
|
||||
|
||||
{% if args['allow-update'] is defined -%}
|
||||
allow-update { {{args['allow-update']}}; };
|
||||
{%- endif %}
|
||||
|
@ -40,6 +48,7 @@ zone "{{ key }}" {
|
|||
notify no;
|
||||
masters { {{ masters }} };
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
};
|
||||
{%- endmacro %}
|
||||
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||
zone "{{ key }}" {
|
||||
type {{ args['type'] }};
|
||||
{% if args['type'] == 'forward' -%}
|
||||
forwarders {
|
||||
{% for forwarder in args.forwarders -%}
|
||||
{{ forwarder }};
|
||||
{% endfor -%}
|
||||
};
|
||||
{% else -%}
|
||||
file "data/{{ file }}";
|
||||
{% if args['type'] == "master" -%}
|
||||
{% if args['notify'] -%}
|
||||
|
@ -22,6 +29,6 @@ zone "{{ key }}" {
|
|||
notify no;
|
||||
masters { {{ masters }} };
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
};
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
@ -33,7 +33,12 @@ bind:
|
|||
dynamic.domain.com:
|
||||
type: master
|
||||
allow-update: "key core_dhcp"
|
||||
notify: True
|
||||
notify: True
|
||||
sub.anotherdomain.com:
|
||||
type: forward
|
||||
forwarders:
|
||||
- 10.9.8.7
|
||||
- 10.9.8.5
|
||||
configured_views:
|
||||
myview1:
|
||||
match_clients:
|
||||
|
|
Loading…
Add table
Reference in a new issue