mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 09:40:22 +00:00
Update with the required logic.
Added an if-block to test for the file argument in the zone_data, and if found, use that view and update the zone variable to match the zone defined under available_zones.
This commit is contained in:
parent
33c34d928d
commit
342c0d7d08
1 changed files with 15 additions and 10 deletions
|
@ -204,8 +204,13 @@ bind_rndc_client_config:
|
|||
{%- do views.update(salt['pillar.get']('bind:configured_views', {})) %}
|
||||
{%- for view, view_data in views|dictsort %}
|
||||
{%- set dash_view = '-' + view if view else '' %}
|
||||
{% for zone, zone_data in view_data.get('configured_zones', {})|dictsort -%}
|
||||
{%- for zone, zone_data in view_data.get('configured_zones', {})|dictsort -%}
|
||||
{%- if 'file' in zone_data %}
|
||||
{%- set file = zone_data.file %}
|
||||
{%- set zone = zone|replace(".txt", "") %}
|
||||
{%- else %}
|
||||
{%- set file = salt['pillar.get']("bind:available_zones:" + zone + ":file", false) %}
|
||||
{%- endif %}
|
||||
{%- 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', {})) %}
|
||||
|
|
Loading…
Add table
Reference in a new issue