Page MenuHomeDevCentral

D3640.id9453.diff
No OneTemporary

D3640.id9453.diff

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 — Mail
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# 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
@@ -38,6 +38,8 @@
- roles/dbserver-pgsql
'db-B-001':
- roles/dbserver-mysql
+ 'dns-001':
+ - roles/dns
'docker-002':
- roles/paas-docker
'dwellers':

File Metadata

Mime Type
text/plain
Expires
Thu, Sep 11, 08:48 (14 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2976655
Default Alt Text
D3640.id9453.diff (6 KB)

Event Timeline