From b317dfc652ab7af5e5cac0c30c0e781c6e84d2cf Mon Sep 17 00:00:00 2001 From: = Date: Wed, 23 Dec 2020 13:17:51 +0100 Subject: [PATCH] Fixed cname, static in /etc/hosts --- dnsmasq/files/hosts | 48 +++++++++++++++++++++++++++++++++++++++++ dnsmasq/files/rre.conf | 49 +++++------------------------------------- dnsmasq/init.sls | 10 +++++++++ 3 files changed, 63 insertions(+), 44 deletions(-) create mode 100644 dnsmasq/files/hosts diff --git a/dnsmasq/files/hosts b/dnsmasq/files/hosts new file mode 100644 index 0000000..10afb08 --- /dev/null +++ b/dnsmasq/files/hosts @@ -0,0 +1,48 @@ +# +# hosts This file describes a number of hostname-to-address +# mappings for the TCP/IP subsystem. It is mostly +# used at boot time, when no name servers are running. +# On small systems, this file can be used instead of a +# "named" name server. +# Syntax: +# +# IP-Address Full-Qualified-Hostname Short-Hostname +# + +127.0.0.1 localhost + +# special IPv6 addresses +::1 localhost ipv6-localhost ipv6-loopback + +fe00::0 ipv6-localnet + +ff00::0 ipv6-mcastprefix +ff02::1 ipv6-allnodes +ff02::2 ipv6-allrouters +ff02::3 ipv6-allhosts + +## rre infrasturcture +10.2.0.11 parsley +10.2.0.15 cumin +10.2.0.16 curry +10.2.0.17 chervil +10.2.0.101 salt +10.2.0.102 pepper +# MetalLB +# 10.2.0.60-70 +10.2.0.60 public +10.2.0.61 private +10.2.0.62 unifi +10.2.0.63 gitea +10.2.0.64 mqtt + +# Client network +10.0.10.3 sw2 +10.0.10.4 ap1 +10.0.10.5 ap2 +10.0.10.6 ap3 +10.0.10.7 ap4 +10.0.10.20 woody +10.0.10.30 laserjet + + diff --git a/dnsmasq/files/rre.conf b/dnsmasq/files/rre.conf index 7dad62c..0e829f9 100644 --- a/dnsmasq/files/rre.conf +++ b/dnsmasq/files/rre.conf @@ -1,51 +1,12 @@ +server=10.2.0.1 +local=/rre.nu/ expand-hosts domain=rre.nu -server=10.2.0.1 -# rre infrasturcture -address=/parsley/10.2.0.11 -address=/parsley/10.2.0.15 -address=/parsley/10.2.0.16 -address=/parsley/10.2.0.17 -address=/parsley/10.2.0.101 -address=/parsley/10.2.0.102 -address=/sw2/10.0.10.3 -address=/ap1/10.0.10.4 -address=/ap2/10.0.10.5 -address=/ap3/10.0.10.6 -address=/ap4/10.0.10.7 - -address=/woody/10.0.10.20 -address=/laserjet/10.0.10.30 - -# MetalLB -# 10.2.0.60-70 -address=/public/10.2.0.60 -address=/private/10.2.0.61 -address=/unifi/10.2.0.62 -address=/gitea/10.2.0.63 -address=/mqtt/10.2.0.64 - - -# public +# public cnames +cname=push.rre.nu,public.rre.nu. cname=git.rre.nu,public.rre.nu cname=home.rre.nu,public.rre.nu -cname=push.rre.nu,public.rre.nu cname=nextcloud.rre.nu,public.rre.nu - -# private +cname=nodered.rre.nu,public.rre.nu cname=longhorn.rre.nu,public.rre.nu - -#old -cname=grafana.rre.nu,chervil.rre.nu -cname=prom.rre.nu,chervil.rre.nu -cname=mariadb.rre.nu,curry.rre.nu -cname=influxdb.rre.nu,curry.rre.nu -cname=dns.rre.nu,curry.rre.nu - -cname=gargamel.nu,cumin.rre.nu -cname=radicale.rre.nu,cumin.rre.nu -cname=nc.rre.nu,cumin.rre.nu -cname=mqtt.rre.nu,cumin.rre.nu -cname=paste.rre.nu,cumin.rre.nu -cname=l.rre.nu,cumin.rre.nu diff --git a/dnsmasq/init.sls b/dnsmasq/init.sls index 9638612..4284104 100644 --- a/dnsmasq/init.sls +++ b/dnsmasq/init.sls @@ -10,9 +10,19 @@ rre.nu configuration file: - group: root - mode: "0644" +configure host file: + file.managed: + - name: /etc/hosts + - source: salt://dnsmasq/files/hosts + - user: root + - group: root + - mode: "0644" + + start dnsmasq: service.running: - name: dnsmasq - enable: True - watch: - file: rre.nu configuration file + - file: configure host file