This commit is contained in:
Jonas Forsberg 2021-10-14 15:16:11 +02:00
parent b12cea971f
commit b196972b96
3 changed files with 4 additions and 58 deletions

View File

@ -1,17 +0,0 @@
interface={{ interface }}
listen-address= {{ ip }}
bind-interfaces
domain-needed
bogus-priv
dhcp-range={{ ip[0:-1] }}50,{{ ip[0:-1] }}150,12h
dhcp-option=option:ntp-server,192.168.0.4,{{ ip }}
dhcp-option=66,{{ ip }}
enable-tftp
tftp-root=/srv/tftpboot
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86,option:client-arch,6
dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:efi-x86_64,bootx64.efi
dhcp-boot=tag:efi-x86,syslinux.efi
dhcp-boot=tag:bios,pxelinux.0

View File

@ -1,12 +0,0 @@
except-interface={{ pillar['network']['interface']['external'] }}
domain-needed
bogus-priv
enable-tftp
tftp-root=/srv/tftpboot
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86,option:client-arch,6
dhcp-match=set:bios,option:client-arch,0
dhcp-boot=tag:efi-x86_64,bootx64.efi
dhcp-boot=tag:efi-x86,syslinux.efi
dhcp-boot=tag:bios,pxelinux.0

View File

@ -2,43 +2,18 @@ Install dnsmasq:
pkg.installed: pkg.installed:
- name: dnsmasq - name: dnsmasq
{% set ip = pillar['network']['ip'] -%} configure dnsmasq:
{% set interface = pillar['network']['interface']['internal'] -%}
configure dnsmasq for internal interface:
file.managed: file.managed:
- name: /etc/dnsmasq.d/{{ interface }}.conf - name: /etc/dnsmasq.d/tlu.conf
- source: salt://dnsmasq/files/dnsmasq.conf.jinja - source: salt://dnsmasq/files/tlu.conf.jinja
- template: jinja - template: jinja
- user: root - user: root
- group: root - group: root
- mode: "0644" - mode: "0644"
- context:
ip: {{ ip }}
interface: {{ interface }}
{% for vlan in pillar['network']['vlan'] -%}
{% set id = vlan['id'] -%}
{% set ip = vlan['address'] -%}
configure dnsmasq for vlan.{{ id }}:
file.managed:
- name: /etc/dnsmasq.d/vlan.{{ id }}.conf
- source: salt://dnsmasq/files/dnsmasq.conf.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
- context:
ip: {{ ip }}
interface: vlan.{{ id }}
{% endfor %}
Start dnsmasq: Start dnsmasq:
service.running: service.running:
- name: dnsmasq - name: dnsmasq
- enable: True - enable: True
- watch: - watch:
- file: configure dnsmasq for internal interface - file: configure dnsmasq
{% for vlan in pillar['network']['vlan'] -%}
{% set id = vlan['id'] -%}
- file: configure dnsmasq for vlan.{{ id }}
{% endfor %}