2011-07-21 04:33:04 +00:00
start:makedhcp_n
os:Linux
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2011-07-21 04:33:04 +00:00
cmd:makedhcp -n
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:ls /etc/dhcp/dhcpd.conf || ls /etc/dhcpd.conf
2011-07-21 04:33:04 +00:00
check:rc==0
cmd:ps -e | grep dhcpd
check:rc==0
check:output=~dhcpd
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ]; then mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf.bak /etc/dhcpd.conf; fi
2011-07-21 04:33:04 +00:00
end
2011-07-20 06:19:25 +00:00
start:makedhcp_h
description:help
cmd:makedhcp -h
check:rc==0
check:output=~Usage
end
start:makedhcp_help
description:help
cmd:makedhcp -h
check:rc==0
check:output=~Usage
end
start:makedhcp_n_linux
description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on
2010-09-20 08:10:57 +00:00
os:Linux
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2010-09-20 08:10:57 +00:00
cmd:makedhcp -n
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:ls /etc/dhcp/dhcpd.conf || ls /etc/dhcpd.conf
2010-09-20 08:10:57 +00:00
check:rc==0
cmd:ps -e | grep dhcpd
check:rc==0
check:output=~dhcpd
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2010-09-20 08:10:57 +00:00
end
2011-07-20 06:19:25 +00:00
start:makedhcp_n_aix
description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on
os:Aix
cmd:mv -f /etc/dhcpsd.cnf /etc/dhcpsd.conf.bak
cmd:makedhcp -n
check:rc==0
cmd:ls /etc/dhcpsd.cnf
check:rc==0
cmd:ps -e | grep dhcpd
check:rc==0
check:output=~dhcpd
end
2011-07-22 10:00:48 +00:00
start:makedhcp_a_linux
2011-07-20 06:19:25 +00:00
description:Define all nodes to the DHCP server. (Will only add nodes that can be reached, network-wise, by this DHCP server.) The dhcp daemon does not have to be restarted after this.
2010-09-20 08:10:57 +00:00
os:Linux
2011-11-15 06:02:43 +00:00
cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
2011-07-20 06:19:25 +00:00
cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac"
cmd:lsdef -l testnode1 -z > /tmp/CN.stanza
cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2011-07-20 06:19:25 +00:00
cmd:makedhcp -n
2010-09-20 08:10:57 +00:00
cmd:makedhcp -a
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases; fi
2011-07-20 06:19:25 +00:00
check:output=~testnode1
2010-09-20 08:10:57 +00:00
check:output=~11:22:33:44:55:66
2011-07-20 06:19:25 +00:00
cmd:cat /tmp/CN.stanza | chdef -z
cmd:rmdef testnode1
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2010-09-20 08:10:57 +00:00
end
2011-07-20 06:19:25 +00:00
2011-07-22 10:00:48 +00:00
start:makedhcp_a_d_linux
2010-09-20 08:10:57 +00:00
os:Linux
2011-07-20 06:19:25 +00:00
cmd:lsdef -t node -l -z > /tmp/all.nodes
cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
cmd:mkdef -t node -o testnode2 groups=compute mac=11:22:33:55:66:99 arch=ppc64
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2011-07-20 06:19:25 +00:00
cmd:makedhcp -n
cmd:makedhcp -a
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases > /tmp/1; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases > /tmp/1; fi
2010-09-20 08:10:57 +00:00
cmd:makedhcp -a -d
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases > /tmp/2; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases > /tmp/2; fi
2011-07-20 06:19:25 +00:00
cmd:diff /tmp/1 /tmp/2
check:output=~testnode1
check:output=~deleted
check:output=~testnode2
cmd:cat /tmp/all.nodes | chdef -z
cmd:rmdef testnode1
cmd:rmdef testnode2
#cmd:rm -f /tmp/1 /tmp/2
2010-09-20 08:10:57 +00:00
end
2011-07-20 06:19:25 +00:00
2011-07-22 10:00:48 +00:00
start:makedhcp_d_linux
2011-07-20 06:19:25 +00:00
description:Delete all node entries, added by xCAT, in the noderange from the DHCP server configuration.
2010-09-20 08:10:57 +00:00
os:Linux
2011-07-20 06:19:25 +00:00
cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac"
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
2011-07-20 06:19:25 +00:00
cmd:lsdef -l testnode1 -z > /tmp/CN.stanza
cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66
cmd:makedhcp -n
cmd:makedhcp testnode1
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases > /tmp/1; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases > /tmp/1; fi
2011-07-20 06:19:25 +00:00
cmd:makedhcp -d testnode1
2010-09-20 08:10:57 +00:00
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases > /tmp/2; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases > /tmp/2; fi
2011-07-20 06:19:25 +00:00
cmd:diff /tmp/1 /tmp/2
check:output=~testnode1
check:output=~deleted
cmd:cat /tmp/CN.stanza | chdef -z
cmd:rmdef testnode1
2012-08-06 04:28:41 +00:00
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ]; then mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf.bak /etc/dhcpd.conf; fi
2011-07-20 06:19:25 +00:00
cmd:rm -f /tmp/1 /tmp/2
2010-09-20 08:10:57 +00:00
end
2011-07-22 10:00:48 +00:00
start:makedhcp_a
os:Linux
cmd:lsdef -l $$CN -z > /tmp/$$CN.stanza
cmd:chdef -t node -o $$CN mac=11:22:33:44:55:66
cmd:makedhcp -a
check:rc==0
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases; fi
2011-07-22 10:00:48 +00:00
check:output=~$$CN
check:output=~11:22:33:44:55:66
cmd:chdef -t node -o $$CN mac=
cmd:cat /tmp/$$CN.stanza | chdef -z
end
start:makedhcp_a_d
os:Linux
cmd:makedhcp -a -d
check:rc==0
2011-11-15 06:02:43 +00:00
cmd:service dhcpd restart
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases | grep $$CN; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases | grep $$CN; fi
2011-11-15 06:02:43 +00:00
check:output!~$$CN
cmd:makedhcp -a
end
start:makedhcp_d
os:Linux
cmd:makedhcp -d $$CN
check:rc==0
cmd:service dhcpd restart
2012-08-06 04:28:41 +00:00
cmd:if [ -f /var/lib/dhcpd/dhcpd.leases ]; then cat /var/lib/dhcpd/dhcpd.leases | grep $$CN; elif [ -f /var/lib/dhcp/db/dhcpd.leases ]; then cat /var/lib/dhcp/db/dhcpd.leases | grep $$CN; fi
2011-07-22 10:00:48 +00:00
check:output!~$$CN
cmd:makedhcp -a
end