Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11684398
D3640.id9458.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D3640.id9458.diff
View Options
diff --git a/pillar/nodes/nodes.sls b/pillar/nodes/nodes.sls
--- a/pillar/nodes/nodes.sls
+++ b/pillar/nodes/nodes.sls
@@ -306,6 +306,7 @@
- devserver
- dbserver-mysql
- dbserver-pgsql
+ - dns
- grafana
- netbox
- prometheus
diff --git a/pillar/tower.sls b/pillar/tower.sls
--- a/pillar/tower.sls
+++ b/pillar/tower.sls
@@ -9,6 +9,7 @@
# -------------------------------------------------------------
base:
+ - dns/{{ minion_id }}/*.sls
- paas/alkane/{{ minion_id }}/*.sls
- paas/docker/{{ minion_id }}/*.sls
diff --git a/roles/dns/init.sls b/roles/dns/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dns/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — DNS
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .knot
diff --git a/roles/dns/knot/config.sls b/roles/dns/knot/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/config.sls
@@ -0,0 +1,36 @@
+# -------------------------------------------------------------
+# Salt — KnotDNS configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# KnotDNS main configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ dirs.etc }}/knot/knot.conf:
+ file.managed:
+ - source: salt://roles/dns/knot/files/knot.conf
+ - template: jinja
+ - context:
+ zones: {{ pillar["dns_zones"] }}
+ all_ips: {{ [ salt['node.resolve_network']()['ipv4_address'] ] + salt['node.get_public_ipv6']() }}
+ identity: {{ pillar["dns_identity"] }}
+
+# -------------------------------------------------------------
+# KnotDNS zones files provisioning
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for zone in pillar["dns_zones"] %}
+
+knotdns_file_{{ zone }}:
+ file.managed:
+ - source: salt://roles/dns/knot/files/zones/{{ zone }}.zone
+ - name: /var/db/knot/{{ zone }}.zone
+ - template: jinja
+ - context:
+ identity: {{ pillar["dns_identity"] }}
+{% endfor %}
diff --git a/roles/dns/knot/files/knot.conf b/roles/dns/knot/files/knot.conf
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/files/knot.conf
@@ -0,0 +1,50 @@
+# -------------------------------------------------------------
+# KnotDNS
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/dns/knot/files/knot.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+server:
+ rundir: "/var/run/knot"
+ user: knot:knot
+ automatic-acl: on
+ listen: [{{ all_ips | join(", ") }}]
+ identity: {{ identity }}
+
+acl:
+ - id: he-net
+ address: [216.218.131.2, 2001:470:600::2, 216.218.132.2, 2001:470:300::2, 216.218.133.2, 2001:470:400::2, 216.66.1.2, 2001:470:500::2, 216.66.80.18, 2001:470:600::3]
+ action: transfer
+
+log:
+ - target: syslog
+ any: info
+
+remote:
+ - id: he-net
+ address: [216.218.130.2, 2001:470:100::2]
+
+database:
+ storage: "/var/db/knot"
+
+template:
+ - id: default
+ storage: "/var/db/knot"
+ file: "%s.zone"
+
+zone:
+{% for zone in zones %}
+ - domain: {{ zone }}
+ file: /var/db/knot/{{ zone }}.zone
+ notify: [he-net]
+ acl: [he-net]
+{% endfor %}
diff --git a/roles/dns/knot/files/rc/knot.conf b/roles/dns/knot/files/rc/knot.conf
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/files/rc/knot.conf
@@ -0,0 +1,17 @@
+# -------------------------------------------------------------
+# knotDNS — rc configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/dns/knot/files/rc/knot.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+knot_enable=YES
+knot_config=/usr/local/etc/knot/knot.conf
diff --git a/roles/dns/knot/init.sls b/roles/dns/knot/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/init.sls
@@ -0,0 +1,11 @@
+# -------------------------------------------------------------
+# Salt — KnotDNS configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .software
+ - .config
+ - .service
diff --git a/roles/dns/knot/service.sls b/roles/dns/knot/service.sls
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/service.sls
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# Salt — knotDNS service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs, services with context %}
+
+# -------------------------------------------------------------
+# OpenDKIM service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if services["manager"] == "rc" %}
+
+/etc/rc.conf.d/knot:
+ file.managed:
+ - source: salt://roles/dns/knot/files/rc/knot.conf
+
+{% endif %}
+
+knot:
+ service.running:
+ - enable: True
diff --git a/roles/dns/knot/software.sls b/roles/dns/knot/software.sls
new file mode 100644
--- /dev/null
+++ b/roles/dns/knot/software.sls
@@ -0,0 +1,10 @@
+# -------------------------------------------------------------
+# Salt — KnotDNS software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+knotdns_software:
+ pkg.installed:
+ - name: knot3
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -25,6 +25,7 @@
- roles/dbserver-mysql
- roles/dbserver-pgsql
- roles/devserver
+ - roles/dns
- roles/freebsd-repo # depends of devserver/datacube, builder
- roles/grafana
- roles/prometheus
@@ -38,6 +39,8 @@
- roles/dbserver-pgsql
'db-B-001':
- roles/dbserver-mysql
+ 'dns-001':
+ - roles/dns
'docker-002':
- roles/paas-docker
'dwellers':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 11, 05:40 (11 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2976803
Default Alt Text
D3640.id9458.diff (7 KB)
Attached To
Mode
D3640: Deploy KnotDNS on dns server
Attached
Detach File
Event Timeline
Log In to Comment