From 853ea2eadefa5cec16758d7441e370419bec18c4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 22 Mar 2023 20:14:40 +0000 Subject: [PATCH] Get dhcpd working on debian --- cookbooks/dhcpd/recipes/default.rb | 8 ++++++++ cookbooks/dhcpd/templates/default/default.erb | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 cookbooks/dhcpd/templates/default/default.erb diff --git a/cookbooks/dhcpd/recipes/default.rb b/cookbooks/dhcpd/recipes/default.rb index 1a85f8400..0e6b9ec3f 100644 --- a/cookbooks/dhcpd/recipes/default.rb +++ b/cookbooks/dhcpd/recipes/default.rb @@ -63,10 +63,18 @@ template "/etc/dhcp/dhcpd.conf" do variables :domain => domain end +template "/etc/default/isc-dhcp-server" do + source "default.erb" + owner "root" + group "root" + mode "644" +end + service "isc-dhcp-server" do action [:enable, :start] supports :status => true, :restart => true subscribes :restart, "template[/etc/dhcp/dhcpd.conf]" + subscribes :restart, "template[/etc/default/isc-dhcp-server]" end service "isc-dhcp-server6" do diff --git a/cookbooks/dhcpd/templates/default/default.erb b/cookbooks/dhcpd/templates/default/default.erb new file mode 100644 index 000000000..96dfbd8e6 --- /dev/null +++ b/cookbooks/dhcpd/templates/default/default.erb @@ -0,0 +1,18 @@ +# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) + +# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). +#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf +#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf + +# Path to dhcpd's PID file (default: /var/run/dhcpd.pid). +#DHCPDv4_PID=/var/run/dhcpd.pid +#DHCPDv6_PID=/var/run/dhcpd6.pid + +# Additional options to start dhcpd with. +# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead +#OPTIONS="" + +# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +INTERFACESv4="<%= node.interfaces(:role => :internal).map { |i| i[:interface] }.join(" ") %>" +INTERFACESv6="" -- 2.39.5