From 2d069544f6e5d8cbf5a6bee23d0e9618e09cd025 Mon Sep 17 00:00:00 2001 From: sylvainfaivre Date: Tue, 10 Aug 2021 18:04:00 +0200 Subject: [PATCH] feat(config.sls): allow to not manage zone file --- bind/config.sls | 2 +- pillar.example | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bind/config.sls b/bind/config.sls index a12349f8..4b737f19 100644 --- a/bind/config.sls +++ b/bind/config.sls @@ -226,7 +226,7 @@ bind_rndc_client_config: #} {%- set zone_source = 'salt://bind/files/zone.jinja' if zone_records != {} else 'salt://' ~ map.zones_source_dir ~ '/' ~ file %} {%- set serial_auto = salt['pillar.get']('bind:available_zones:' + zone + ':soa:serial', '') == 'auto' %} -{% if file and zone_data['type'] == 'master' -%} +{% if file and zone_data['type'] == 'master' and (zone_data['managed'] is not defined or zone_data['managed']) -%} zones{{ dash_view }}-{{ zone }}{{ '.include' if serial_auto else '' }}: file.managed: - name: {{ zones_directory }}/{{ file }}{{ '.include' if serial_auto else '' }} diff --git a/pillar.example b/pillar.example index 5288aac0..4f292070 100644 --- a/pillar.example +++ b/pillar.example @@ -173,6 +173,8 @@ bind: type: master # Yo don't have define zone again in available_zones. # This feature is backward compatibile and only available in debian notify: false # if type master you need specify notify true/false + managed: true # Set this to false if you don't want Salt to manage this zone file + # If this parameter is set to true or is not set at all, the zone will be managed through salt sub2.domain.com: file: sub2.domain.com