summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuri Jensen <juri@xenux.dk>2002-11-28 12:02:21 +0000
committerJuri Jensen <juri@xenux.dk>2002-11-28 12:02:21 +0000
commitb70e92fcad0462324286e63c05fa826217034041 (patch)
tree644ea5b3a879c50d56b2ae68963f4e950f29a9fe
parentfbf09af9c5a0c1c443ac95d759a5b10a7abc5e5e (diff)
cfengine: Added support for of DHCP version 3.
dhcp: Added config file for both primary and secondary DHCP server for xenux.local. Removed the old dhcpd.conf for xenux.local - we're now using the new version 3 server.
-rw-r--r--cfengine/cf.groups.xenux17
-rw-r--r--cfengine/cf.services.dhcp30
-rw-r--r--dhcp3/dhcpd_gandalf.xenux.local.conf49
-rw-r--r--dhcp3/dhcpd_legolas.xenux.local.conf55
-rw-r--r--dhcpd.conf.xenuxlocal28
5 files changed, 140 insertions, 39 deletions
diff --git a/cfengine/cf.groups.xenux b/cfengine/cf.groups.xenux
index 950aece..bfda658 100644
--- a/cfengine/cf.groups.xenux
+++ b/cfengine/cf.groups.xenux
@@ -4,23 +4,20 @@
groups:
xenux = ( elrond oin smaug bilbo orcrist beorn bill thorin pippin glamdring )
xenuxlocal = ( gandalf thorin legolas pc60 pc61 pc62 pc63 pc64 pc65 pc66 pc67 pc68 pc69 pc70 pc71 pc72 pc73 pc74 pc75 pc76 pc77 pc78 pc79 pc80 )
- raps = ( aries )
sagahus = ( saga )
- venture = ( mimer heimdal thor )
- ntiexpo = ( balrog )
louiz = ( saks lineal )
Standalone_xenux = ( pc60 pc61 pc62 pc63 pc64 pc65 pc66 pc67 pc68 pc69 pc70 pc71 pc72 pc73 pc74 pc75 pc76 pc77 pc78 pc79 pc80 )
WWWServer_xenux = ( beorn smaug saga )
- FTPServer_xenux = ( beorn smaug mimer )
- NameServer_xenux = ( elrond gandalf saga heimdal balrog pippin )
- FileServer_xenux = ( orcrist gandalf aries saga thor balrog )
- VPNServer_xenux = ( orcrist aries heimdal )
- Firewall_xenux = ( orcrist aries saga heimdal glamdring )
+ FTPServer_xenux = ( beorn smaug )
+ NameServer_xenux = ( elrond gandalf saga pippin thorin )
+ FileServer_xenux = ( orcrist gandalf aries saga )
+ VPNServer_xenux = ( orcrist aries )
+ Firewall_xenux = ( orcrist aries saga glamdring )
CVSServer_xenux = ( bilbo bill )
GMServer_xenux = ( bilbo )
SpamAssServer_xenux = ( oin )
- DHCPServer_xenux = ( orcrist saga thorin heimdal balrog thorin )
+ DHCPServer_xenux = ( saga thorin legolas gandalf )
FAIServer_xenux = ( thorin )
CDWriter_xenux = ( gandalf )
IMAPServer_xenux = ( oin )
@@ -33,6 +30,6 @@ groups:
wol_xenux = ( aries )
cc_xenux = ( saga )
# tdk_xenux = ( )
- wp_xenux = ( oin www bilbo orcrist smaug beorn heimdal mimer )
+ wp_xenux = ( oin www bilbo orcrist smaug beorn )
# dnai_xenux = ( )
# sunrise_xenux = ( )
diff --git a/cfengine/cf.services.dhcp b/cfengine/cf.services.dhcp
index 695ebf0..81b7f4d 100644
--- a/cfengine/cf.services.dhcp
+++ b/cfengine/cf.services.dhcp
@@ -1,7 +1,14 @@
control:
- AddInstallable = ( dhcpd_reload )
+ AddInstallable = ( dhcpd_reload dhcpd3 dhcpd3_reload )
+
+classes:
+ #
+ # Determine if this is a version 3 DHCP server
+ #
+ dhcpd3 = ( `/usr/bin/test -x /usr/sbin/dhcpd3` )
editfiles:
+ !dhcpd3::
{ /etc/init.d/dhcp
#
# First of all, this is a DHCP server so let's make it possible
@@ -28,10 +35,31 @@ editfiles:
DefineClasses "dhcpd_reload"
EndGroup
}
+ dhcpd3::
+ { /etc/dhcp3/dhcpd.conf
+ #
+ # We don't make the dhcp.conf dynamically, but instead we copy the contents
+ # of a master file, but only if it's newer than the one installed.
+ #
+ BeginGroupIfFileExists "/etc/local-COMMON/dhcpd_$(fqdn).conf"
+ BeginGroupIfFileIsNewer "/etc/local-COMMON/dhcpd_$(fqdn).conf"
+ AutoCreate
+ EmptyEntireFilePlease
+ InsertFile "/etc/local-COMMON/dhcpd_$(fqdn).conf"
+ Append "# Edited by cfengine $(date)"
+ EndGroup
+ DefineClasses "dhcpd3_reload"
+ EndGroup
+ }
processes:
+ !dhcpd3::
"dhcpd-2.2.x" restart "/etc/init.d/dhcp restart"
+ dhcpd3::
+ "" restart /etc/init.d/dhcp3-server restart"
shellcommands:
dhcpd_reload::
"/etc/init.d/dhcp force-reload"
+ dhcpd3_reload::
+ "/etc/init.d/dhcp3-server force-reload"
diff --git a/dhcp3/dhcpd_gandalf.xenux.local.conf b/dhcp3/dhcpd_gandalf.xenux.local.conf
new file mode 100644
index 0000000..2e04839
--- /dev/null
+++ b/dhcp3/dhcpd_gandalf.xenux.local.conf
@@ -0,0 +1,49 @@
+# dhcpd.conf
+#
+# DHCP configuration file for secondary DHCP server in
+# the xenux.local domain.
+#
+
+ddns-update-style none;
+default-lease-time 1200;
+max-lease-time 7200;
+authoritative;
+log-facility local7;
+
+option domain-name "xenux.local";
+option domain-name-servers 192.168.200.20, 212.54.64.170, 212.54.64.171;
+option subnet-mask 255.255.255.0;
+option routers 192.168.200.1;
+option netbios-name-servers 192.168.200.20;
+
+# This is for failover capabillities for the secondary server.
+failover peer "xenuxlocal" {
+ secondary;
+ address 192.168.200.20;
+ port 520;
+ peer address 192.168.200.21;
+ peer port 519;
+ max-response-delay 30;
+ max-unacked-updates 10;
+ load balance max seconds 3;
+}
+
+shared-network XENUXLOCAL {
+ subnet 192.168.200.0 netmask 255.255.255.0 {
+ use-host-decl-names on;
+ pool {
+ failover peer "xenuxlocal"
+ # According to our policy, the dynamic address space starts
+ # at .60 and ends at .229 giving 170 client addresses.
+ # (See "System Description --> Network Model")
+ range 192.168.200.60 192.168.200.229;
+ }
+ # According to our policy, the printers address space starts
+ # at .40 and ends at .59 giving 20 printer addresses.
+ # (See "System Description --> Network Model")
+ host epsonalc2000 {
+ hardware ethernet 00:80:77:31:a2:6a;
+ fixed-address 192.168.200.40;
+ }
+ }
+}
diff --git a/dhcp3/dhcpd_legolas.xenux.local.conf b/dhcp3/dhcpd_legolas.xenux.local.conf
new file mode 100644
index 0000000..0e989f4
--- /dev/null
+++ b/dhcp3/dhcpd_legolas.xenux.local.conf
@@ -0,0 +1,55 @@
+# dhcpd.conf
+#
+# DHCP configuration file for primary DHCP server in
+# the xenux.local domain.
+#
+
+ddns-update-style none;
+default-lease-time 1200;
+max-lease-time 7200;
+authoritative;
+log-facility local7;
+
+option domain-name "xenux.local";
+option domain-name-servers 192.168.200.20, 212.54.64.170, 212.54.64.171;
+option subnet-mask 255.255.255.0;
+option routers 192.168.200.1;
+option netbios-name-servers 192.168.200.20;
+
+
+
+# This is for failover capabillities for the primary server.
+failover peer "xenuxlocal" {
+ primary;
+ address 192.168.200.21;
+ port 519;
+ peer address 192.168.200.20;
+ peer port 520;
+ mclt 3600;
+ max-response-delay 30;
+ max-unacked-updates 10;
+ load balance max seconds 3;
+# split 128;
+ hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
+ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
+}
+
+# According to our policy, the dynamic address space starts
+# at .60 and ends at .229 giving 170 client addresses.
+# (See "System Description --> Network Model")
+shared-network XENUXLOCAL {
+ subnet 192.168.200.0 netmask 255.255.255.0 {
+ use-host-decl-names on;
+ pool {
+ failover peer "xenuxlocal"
+ range 192.168.200.60 192.168.200.229;
+ }
+ # According to our policy, the printers address space starts
+ # at .40 and ends at .59 giving 20 printer addresses.
+ # (See "System Description --> Network Model")
+ host epsonalc2000 {
+ hardware ethernet 00:80:77:31:a2:6a;
+ fixed-address 192.168.200.40;
+ }
+ }
+}
diff --git a/dhcpd.conf.xenuxlocal b/dhcpd.conf.xenuxlocal
deleted file mode 100644
index 351d21f..0000000
--- a/dhcpd.conf.xenuxlocal
+++ /dev/null
@@ -1,28 +0,0 @@
-# dhcpd.conf
-#
-# DHCP configuration file for xenux.local
-#
-
-default-lease-time 1200;
-max-lease-time 7200;
-
-option subnet-mask 255.255.255.0;
-option routers 192.168.200.1;
-option domain-name-servers 192.168.200.20, 212.54.64.170, 212.54.64.171;
-option domain-name "xenux.local";
-option netbios-name-servers 192.168.200.20;
-
-# According to our policy, the dynamic address space starts
-# at .60 and ends at .229 giving 170 client addresses.
-# (See "System Description --> Network Model")
-subnet 192.168.200.0 netmask 255.255.255.0 {
- range 192.168.200.60 192.168.200.229;
-}
-
-# According to our policy, the printers address space starts
-# at .40 and ends at .59 giving 20 printer addresses.
-# (See "System Description --> Network Model")
-host brother1270n {
- hardware ethernet 00:80:77:31:a2:6a;
- fixed-address 192.168.200.40;
-}