Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Saltstack formulas for deplying networkboot/dhcpd docker hub image for guest network using VLAN 6
/srv/salt/dhcpd/green/dhcpd.conf
/srv/salt/dhcpd/green/netboot.conf
/srv/salt/dhcpd/green/option-space.conf
/srv/salt/dhcpd/green.sls
/srv/salt/dhcpd/green/static.conf
/srv/salt/dhcpd/green.upstart
/srv/salt/dhcpd/guest/dhcpd.conf
/srv/salt/dhcpd/guest.sls
/srv/salt/dhcpd/guest.upstart
/srv/salt/dhcpd/init.sls
include:
- dhcpd
dhcpd:
service.running:
- name: dhcpd-guest
- enable: True
- require:
- file: dhcpd.upstart
dhcpd.upstart:
file.managed:
- name: /etc/init/dhcpd-guest.conf
- source: salt://dhcpd/guest.upstart
- user: root
- group: root
- mode: 644
- watch_in:
- service: dhcpd-guest
- cmd: init.reload
dhcpd.conf.dir:
file.recurse:
- name: /etc/dhcp/guest
- source: salt://dhcpd/guest
- user: root
- group: root
- file_mode: 644
- dir_mode: 755
- clean: True
- watch_in:
- service: dhcpd-guest
description "ISC DHCP server for guest network (VLAN 6)"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
exec docker run --rm --name dhcpd-guest --network host -v /etc/dhcp/guest:/data networkboot/dhcpd vlan6
ddns-update-style none;
deny bootp; #default
# GUEST (private network, VLAN 6)
subnet 10.1.6.0 netmask 255.255.255.0 {
authoritative;
range 10.1.6.100 10.1.6.199;
option subnet-mask 255.255.255.0;
option routers 10.1.6.1;
default-lease-time 3600;
max-lease-time 86400;
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
include:
- docker
- init.reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.