-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds dhcpd.conf.d as a directory for containing configuration file fragments. This permits the dhcpd instance to be configured almost entirely by the sg-dhcp role, but for additional assets such as a file containing MAC addresses to be 'dropped in'. A script is also provided in /usr/local/sbin/dhcpd-reconf which will reconfigure the dhcpd server and restart it.
- Loading branch information
1 parent
21b5477
commit 383e298
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
|
||
# This assembles all of the snippets into a complete configuration file | ||
cat /etc/dhcpd.conf.d/* > /etc/dhcpd.conf | ||
|
||
# Restart dhcpd iff the new config file checks out | ||
if dhcpd -n ; then | ||
/etc/rc.d/dhcpd restart | ||
else | ||
printf "Refusing to restart dhcpd: dhcpd.conf contains errors!\n" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
- name: dhcpd | ||
command: /etc/rc.d/dhcpd restart | ||
command: /usr/local/sbin/dhcpd-reconf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters