feat(keys): allow pillar based management
Introduce managed TSIG keys configuration using pillar data. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
307ed12b2b
commit
9bbffa5f1f
@ -6,3 +6,4 @@ include:
|
||||
- .config_files
|
||||
- .file
|
||||
- .zones
|
||||
- .keys
|
||||
|
14
nsd/config/keys.sls
Normal file
14
nsd/config/keys.sls
Normal file
@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as nsd with context %}
|
||||
{%- from tplroot ~ "/macros.jinja" import config_file with context %}
|
||||
|
||||
{%- set keys = nsd.get('keys', {}) %}
|
||||
|
||||
{%- if keys | length > 0 %}
|
||||
|
||||
{{ config_file('80-generated-keys', 'generated-keys') }}
|
||||
|
||||
{%- endif %}
|
11
nsd/files/default/generated-keys.conf.jinja
Normal file
11
nsd/files/default/generated-keys.conf.jinja
Normal file
@ -0,0 +1,11 @@
|
||||
########################################################################
|
||||
# File managed by Salt at <{{ source }}>.
|
||||
# Your changes will be overwritten.
|
||||
########################################################################
|
||||
|
||||
{%- for name, config in nsd.get('keys').items() %}
|
||||
key:
|
||||
name: "{{ name }}"
|
||||
algorithm: "{{ config['algorithm'] }}"
|
||||
secret: "{{ config['secret'] }}"
|
||||
{%- endfor %}
|
@ -22,6 +22,13 @@ nsd:
|
||||
# # 90-generated-zones is reserved for zones generated by this formula
|
||||
# # 10-salt is reserved for general configuration generated by this formula
|
||||
|
||||
# If this section is present in your Pillar data,
|
||||
# nsd.conf.d/80-generated-keys will be created and managed
|
||||
keys:
|
||||
examplekey:
|
||||
algorithm: hmac-sha512
|
||||
secret: encryptme
|
||||
|
||||
# If this section is present in your Pillar data,
|
||||
# nsd.conf.d/90-generated-zones will be created and managed.
|
||||
zones:
|
||||
|
Loading…
Reference in New Issue
Block a user