feat(nsd): configure NSD based on TOFS pattern

This commit is contained in:
Alexander Weidinger 2021-04-02 00:22:15 +02:00
parent a5a8ec4113
commit eb51237183
46 changed files with 297 additions and 151 deletions

View File

@ -18,8 +18,14 @@ nsd-formula
:scale: 100% :scale: 100%
:target: https://github.com/pre-commit/pre-commit :target: https://github.com/pre-commit/pre-commit
A SaltStack formula that is empty. It has dummy content to help with a quick A SaltStack formula that manages NSD.
start on a new formula and it serves as a style guide.
It intentionally provides only minimalistic configuration.
Use the `TOFS pattern<https://template-formula.readthedocs.io/en/latest/TOFS_pattern.html>` to alter the configuration to your needs.
You'll need to write the zone files yourself, obviously.
This formula will tell NSD to compile them into it's DB and provide a configuration file for you to include.
.. contents:: **Table of Contents** .. contents:: **Table of Contents**
:depth: 1 :depth: 1

View File

@ -489,7 +489,7 @@ Here is an example based on `template-formula/nsd/config/file.sls`_:
nsd-config-file-file-managed: nsd-config-file-file-managed:
file.managed: file.managed:
- name: {{ nsd.config }} - name: {{ nsd.config }}
- source: {{ files_switch(['example.tmpl'], - source: {{ files_switch(['nsd.conf'],
lookup='nsd-config-file-file-managed' lookup='nsd-config-file-file-managed'
) )
}} }}

View File

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- from tplroot ~ "/map.jinja" import mapdata as nsd with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
{%- for name, template in nsd.get('config_files', {}).items() %}
{%- set identifier = 'nsd-config-config_files-file-managed-'+name %}
"{{ identifier }}":
file.managed:
- name: "{{ nsd.config_include_dir }}/{{ name }}.conf"
- source: {{ files_switch([template+'.conf', template+'.conf.jinja'],
lookup=identifier
)
}}
- mode: 644
- user: root
- group: {{ nsd.rootgroup }}
- makedirs: True
- template: jinja
- require:
- file: nsd-config-include-file-directory
- require_in:
- file: nsd-config-file-file-managed
- context:
nsd: {{ nsd | json }}
- check_cmd: nsd-checkconf
{%- endfor %}

View File

@ -13,7 +13,7 @@ include:
nsd-config-file-file-managed: nsd-config-file-file-managed:
file.managed: file.managed:
- name: {{ nsd.config }} - name: {{ nsd.config }}
- source: {{ files_switch(['example.tmpl'], - source: {{ files_switch(['nsd.conf', 'nsd.conf.jinja'],
lookup='nsd-config-file-file-managed' lookup='nsd-config-file-file-managed'
) )
}} }}
@ -24,5 +24,7 @@ nsd-config-file-file-managed:
- template: jinja - template: jinja
- require: - require:
- sls: {{ sls_package_install }} - sls: {{ sls_package_install }}
- file: nsd-config-include-file-directory
- context: - context:
nsd: {{ nsd | json }} nsd: {{ nsd | json }}
- check_cmd: nsd-checkconf

13
nsd/config/include.sls Normal file
View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- from tplroot ~ "/map.jinja" import mapdata as nsd with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
nsd-config-include-file-directory:
file.directory:
- name: "{{ nsd.config_include_dir }}"
- makedirs: true

View File

@ -2,4 +2,6 @@
# vim: ft=sls # vim: ft=sls
include: include:
- .include
- .config_files
- .file - .file

View File

@ -1,6 +0,0 @@
########################################################################
# File managed by Salt at <{{ source }}>.
# Your changes will be overwritten.
########################################################################
This is an example file from SaltStack template-formula.

View File

@ -1,11 +0,0 @@
########################################################################
# File managed by Salt at <{{ source }}>.
# Your changes will be overwritten.
########################################################################
This is another example file from SaltStack template-formula.
# This is here for testing purposes
{{ nsd | json }}
winner of the merge: {{ nsd['winner'] }}

View File

@ -0,0 +1,18 @@
########################################################################
# File managed by Salt at <{{ source }}>.
# Your changes will be overwritten.
########################################################################
# This is just a minimal example for using NSD together with a locally
# running unbound resolver. (See unbound-forula)
# If you need different configuration, use the TOFS pattern!
# (We're using IPv4 here, because the Kitchen CI configuration had no IPv6 at the time of development.)
server:
server-count: 1
ip-address: 127.0.0.1
port: 53530
remote-control:
control-interface: 127.0.0.1

View File

@ -0,0 +1,20 @@
########################################################################
# File managed by Salt at <{{ source }}>.
# Your changes will be overwritten.
########################################################################
# All configuration is loaded from here:
include: "{{ nsd.config_include_dir }}/{{ nsd.config_include_glob }}"
########################################################################
#
# This section is for testing only. You can safely ignore it and delete
# it from your templates.
#
# winner of the merge: {{ nsd.winner }}
#
# {{ nsd | json}}
#
########################################################################

View File

@ -7,7 +7,9 @@ values:
pkg: pkg:
name: nsd name: nsd
rootgroup: root rootgroup: root
config: '/etc/nsd' config: '/etc/nsd/nsd.conf'
config_include_dir: '/etc/nsd/nsd.conf.d'
config_include_glob: '*.conf'
service: service:
name: nsd name: nsd
# Just here for testing # Just here for testing

View File

@ -11,9 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-fedora
service:
name: service-fedora
... ...

View File

@ -11,8 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-ubuntu
config: /etc/nsd.d/custom-ubuntu.conf
... ...

View File

@ -11,9 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-arch
service:
name: service-arch
... ...

View File

@ -11,8 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-debian
config: /etc/nsd.d/custom.conf
... ...

View File

@ -13,4 +13,6 @@
--- ---
values: values:
rootgroup: wheel rootgroup: wheel
config: '/usr/local/etc/nsd/nsd.conf'
config_include_dir: '/usr/local/etc/nsd/nsd.conf.d'
... ...

View File

@ -11,7 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-gentoo
... ...

View File

@ -11,8 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-redhat
config: /etc/nsd.conf
... ...

View File

@ -11,7 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-suse
... ...

View File

@ -11,8 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
pkg:
name: nsd-centos-6
config: /etc/nsd.d/custom-centos-6.conf
... ...

View File

@ -11,6 +11,5 @@
# you can remove this file or provide at least an empty dict, e.g. # you can remove this file or provide at least an empty dict, e.g.
# values: {} # values: {}
--- ---
values: values: {}
config: /etc/nsd.d/custom-ubuntu-18.04.conf
... ...

View File

@ -8,14 +8,17 @@ nsd:
winner: lookup winner: lookup
added_in_lookup: lookup_value added_in_lookup: lookup_value
# Using bash package and udev service as an example. This allows us to # pkg:
# test the template formula itself. You should set these parameters to # name: nsd
# examples that make sense in the contexto of the formula you're writing. # service:
pkg: # name: nsd
name: bash # config: /etc/nsd/nsd.conf
service: # config_include_dir: /etc/nsd/nsd.conf.d
name: systemd-journald # config_include_glob: *.conf
config: /etc/template-formula.conf
# Configuration is separated into several files which have their own templates
config_files:
10-server: local-nsd-for-unbound
tofs: tofs:
# The files_switch key serves as a selector for alternative # The files_switch key serves as a selector for alternative
@ -48,7 +51,7 @@ nsd:
# For testing purposes # For testing purposes
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- 'example.tmpl.jinja' - 'nsd.conf.jinja'
# Just for testing purposes # Just for testing purposes
winner: pillar winner: pillar

View File

@ -3,20 +3,20 @@
control 'nsd.config.file' do control 'nsd.config.file' do
title 'Verify the configuration file' title 'Verify the configuration file'
describe file('/etc/template-formula.conf') do describe file('/etc/nsd/nsd.conf') do
it { should be_file } it { should be_file }
it { should be_owned_by 'root' } it { should be_owned_by 'root' }
it { should be_grouped_into 'root' } it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' } its('mode') { should cmp '0644' }
its('content') do its('content') do
should include( should include(
'This is another example file from SaltStack template-formula.' 'Your changes will be overwritten.'
) )
end end
its('content') { should include '"added_in_pillar": "pillar_value"' } its('content') { should include '"added_in_pillar": "pillar_value"' }
its('content') { should include '"added_in_defaults": "defaults_value"' } its('content') { should include '"added_in_defaults": "defaults_value"' }
its('content') { should include '"added_in_lookup": "lookup_value"' } its('content') { should include '"added_in_lookup": "lookup_value"' }
its('content') { should include '"config": "/etc/template-formula.conf"' } its('content') { should include '"config": "/etc/nsd/nsd.conf"' }
its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' } its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
its('content') { should include '"pkg": {"name": "' } its('content') { should include '"pkg": {"name": "' }
its('content') { should include '"service": {"name": "' } its('content') { should include '"service": {"name": "' }
@ -26,13 +26,19 @@ control 'nsd.config.file' do
should include( should include(
'"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\ '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\
'"roles", "osfinger", "os", "os_family"], "source_files": '\ '"roles", "osfinger", "os", "os_family"], "source_files": '\
'{"nsd-config-file-file-managed": ["example.tmpl.jinja"]}' '{"nsd-config-file-file-managed": ["nsd.conf.jinja"]}'
) )
# rubocop:enable Layout/LineLength # rubocop:enable Layout/LineLength
# rubocop:enable Lint/RedundantCopDisableDirective # rubocop:enable Lint/RedundantCopDisableDirective
end end
its('content') { should include '"arch": "amd64"' } its('content') { should include '"arch": "amd64"' }
its('content') { should include '"winner": "pillar"}' } its('content') { should include '"winner": "pillar"' }
its('content') { should include 'winner of the merge: pillar' } its('content') { should include 'winner of the merge: pillar' }
end end
describe file('/etc/nsd/nsd.conf.d') do
it { should be_directory }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end
end end

View File

@ -12,7 +12,7 @@ control 'nsd.service.running' do
when 'centos-6', 'amazonlinux-1' when 'centos-6', 'amazonlinux-1'
'crond' 'crond'
else else
'systemd-journald' 'nsd'
end end
describe service(service_name) do describe service(service_name) do

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: app-shells/bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: app-shells/bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: mtab name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -6,7 +6,11 @@ values:
added_in_lookup: lookup_value added_in_lookup: lookup_value
added_in_pillar: pillar_value added_in_pillar: pillar_value
arch: amd64 arch: amd64
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
config_files:
10-server: local-nsd-for-unbound
config_include_dir: "/etc/nsd/nsd.conf.d"
config_include_glob: "*.conf"
lookup: lookup:
added_in_lookup: lookup_value added_in_lookup: lookup_value
master: template-master master: template-master
@ -22,10 +26,10 @@ values:
- Y:G@id - Y:G@id
master: template-master master: template-master
pkg: pkg:
name: bash name: nsd
rootgroup: root rootgroup: root
service: service:
name: systemd-journald name: nsd
tofs: tofs:
files_switch: files_switch:
- any/path/can/be/used/here - any/path/can/be/used/here
@ -36,5 +40,5 @@ values:
- os_family - os_family
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- example.tmpl.jinja - nsd.conf.jinja
winner: pillar winner: pillar

View File

@ -5,6 +5,6 @@ portage:
sync_wait_one_day: true sync_wait_one_day: true
nsd: nsd:
pkg: pkg:
name: 'app-shells/bash' name: 'nsd'
service: service:
name: "{{ 'systemd-journald' if grains.init == 'systemd' else 'mtab' }}" name: 'nsd'

View File

@ -15,7 +15,7 @@ nsd:
name: cronie name: cronie
service: service:
name: crond name: crond
config: /etc/template-formula.conf config: /etc/nsd/nsd.conf
tofs: tofs:
# The files_switch key serves as a selector for alternative # The files_switch key serves as a selector for alternative
@ -46,7 +46,7 @@ nsd:
# For testing purposes # For testing purposes
source_files: source_files:
nsd-config-file-file-managed: nsd-config-file-file-managed:
- 'example.tmpl.jinja' - 'nsd.conf.jinja'
# Just for testing purposes # Just for testing purposes
winner: pillar winner: pillar