mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-17 02:00:23 +00:00
add support for forward zones
This commit is contained in:
parent
294b1e33d6
commit
4a9a128ba9
4 changed files with 31 additions and 3 deletions
|
@ -11,6 +11,13 @@
|
||||||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||||
zone "{{ key }}" {
|
zone "{{ key }}" {
|
||||||
type {{ args['type'] }};
|
type {{ args['type'] }};
|
||||||
|
{% if args['type'] == 'forward' -%}
|
||||||
|
forwarders {
|
||||||
|
{% for forwarder in args.forwarders -%}
|
||||||
|
{{ forwarder }};
|
||||||
|
{% endfor -%}
|
||||||
|
};
|
||||||
|
{% else -%}
|
||||||
file "{{ file }}";
|
file "{{ file }}";
|
||||||
{% if args['type'] == "master" -%}
|
{% if args['type'] == "master" -%}
|
||||||
{% if args['notify'] -%}
|
{% if args['notify'] -%}
|
||||||
|
@ -22,6 +29,6 @@ zone "{{ key }}" {
|
||||||
notify no;
|
notify no;
|
||||||
masters { {{ masters }} };
|
masters { {{ masters }} };
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,19 @@
|
||||||
{%- macro zone(key, args, file, masters) %}
|
{%- macro zone(key, args, file, masters) %}
|
||||||
zone "{{ key }}" {
|
zone "{{ key }}" {
|
||||||
type {{ args['type'] }};
|
type {{ args['type'] }};
|
||||||
|
{% if args['type'] == 'forward' -%}
|
||||||
|
forwarders {
|
||||||
|
{% for forwarder in args.forwarders -%}
|
||||||
|
{{ forwarder }};
|
||||||
|
{% endfor -%}
|
||||||
|
};
|
||||||
|
{% else -%}
|
||||||
{% if args['dnssec'] is defined and args['dnssec'] -%}
|
{% if args['dnssec'] is defined and args['dnssec'] -%}
|
||||||
file "zones/{{ file }}.signed";
|
file "zones/{{ file }}.signed";
|
||||||
{% else -%}
|
{% else -%}
|
||||||
file "zones/{{ file }}";
|
file "zones/{{ file }}";
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{% if args['allow-update'] is defined -%}
|
{% if args['allow-update'] is defined -%}
|
||||||
allow-update { {{args['allow-update']}}; };
|
allow-update { {{args['allow-update']}}; };
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -40,6 +48,7 @@ zone "{{ key }}" {
|
||||||
notify no;
|
notify no;
|
||||||
masters { {{ masters }} };
|
masters { {{ masters }} };
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
};
|
};
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,13 @@
|
||||||
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
{%- set masters = salt['pillar.get']("bind:available_zones:" + key + ":masters") %}
|
||||||
zone "{{ key }}" {
|
zone "{{ key }}" {
|
||||||
type {{ args['type'] }};
|
type {{ args['type'] }};
|
||||||
|
{% if args['type'] == 'forward' -%}
|
||||||
|
forwarders {
|
||||||
|
{% for forwarder in args.forwarders -%}
|
||||||
|
{{ forwarder }};
|
||||||
|
{% endfor -%}
|
||||||
|
};
|
||||||
|
{% else -%}
|
||||||
file "data/{{ file }}";
|
file "data/{{ file }}";
|
||||||
{% if args['type'] == "master" -%}
|
{% if args['type'] == "master" -%}
|
||||||
{% if args['notify'] -%}
|
{% if args['notify'] -%}
|
||||||
|
@ -22,6 +29,6 @@ zone "{{ key }}" {
|
||||||
notify no;
|
notify no;
|
||||||
masters { {{ masters }} };
|
masters { {{ masters }} };
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
};
|
};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,12 @@ bind:
|
||||||
dynamic.domain.com:
|
dynamic.domain.com:
|
||||||
type: master
|
type: master
|
||||||
allow-update: "key core_dhcp"
|
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:
|
configured_views:
|
||||||
myview1:
|
myview1:
|
||||||
match_clients:
|
match_clients:
|
||||||
|
|
Loading…
Add table
Reference in a new issue