This cookbook installs the DHCP on Windows Server including all necessary roles and features.
- Windows Server 2008 R2 Family
- Windows Server 2012 Family
- none
e.g.
Just include windows_dhcp
in your node's run_list
:
{
"name":"my_node",
"run_list": [
"recipe[windows_dhcp]"
]
}
:create
: Creates a lease entry:delete
: Deletes a lease entry
name
: name attribute. Name of the lease entry.comptername
: Name of the DHCP server.description
: Description field entry.ipaddress
: IPv4 or IPv6 address or the lease entry. Required Regex: IPv4 or IPv6leaseexpirytime
: Time to expire the lease. Regex for YYYY-MM-DD HH:MM:SSmacaddress
: MAC Address for the lease entry. Note: Any use of '-' or ':' will be removed.scopeid
: IPv4 or IPv6 scope ex. 192.168.1.1 Required Regex: IPv4 or IPv6version
: Version of IP address. Default 4 Available Options (4, 6)
# Create lease entry of workstation at 192.168.1.10
windows_dhcp_lease 'workstation' do
action :create
ipaddress '192.168.1.10'
scopeid '192.168.1.1'
end
:create
: Creates a reservation entry:delete
: Deletes a reservation entry:update
: Updates a reservation entry
name
: name attribute. Name of the reservation entry.comptername
: Name of the DHCP server.description
: Description field entry.ipaddress
: IPv4 or IPv6 address or the reservation entry. Required Regex: IPv4 or IPv6macaddress
: MAC Address for the reservation entry. Note: Any use of '-' or ':' will be removed. Requiredscopeid
: IPv4 or IPv6 scope ex. 192.168.1.1 Required Regex: IPv4 or IPv6version
: Version of IP address. Default 4 Available Options (4, 6)
# create reservation entry of 'workstation' at 192.168.1.10 with mac address of '00-00-00-00-00-00'
windows_dhcp_reservation 'workstation' do
action :create
ipaddress '192.168.1.10'
scopeid '192.168.1.1'
macaddress '00-00-00-00-00-00'
end
# delete reservation entry of 'workstation' at 192.168.1.10
windows_dhcp_reservation 'workstation' do
action :delete
scopeid '192.168.1.1'
end
# update reservation entry of 'workstation' at 192.168.1.10 with mac address of '00-00-00-00-00-10'
windows_dhcp_reservation 'workstation' do
action :update
ipaddress '192.168.1.10'
macaddress '00-00-00-00-00-10'
scopeid '192.168.1.1'
end
:create
: Creates a reservation entry:delete
: Deletes a reservation entry:update
: Updates a reservation entry
name
: name attribute. Name of the scope entry.computername
: Name of the DHCP server.description
: Description field entry.endrange
: Ending IP of the scope. Regex: IPv4 or IPv6scopeid
: IPv4 or IPv6 scope ex. 192.168.1.1 Required Regex: IPv4 or IPv6startrange
: Staring IP of the scope. Regex: IPv4 or IPv6subnetmask
: Subnet mask address of the scope. Regex: IPv4 or IPv6version
: Version of IP address. Default 4 Available Options (4, 6)
# Create scope 'Internal' of '192.168.1.1' with starting ip of '192.168.1.10' and ending IP of '192.168.1.250'
windows_dhcp_scope 'Internal' do
action :create
startrange '192.168.1.10'
endrange '192.168.1.250'
subnetmask '255.255.255.0'
scopeid '192.168.1.1'
end
- Fork the repository on Github
- Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using GitHub
Authors:: Derek Groh (dgroh@arch.tamu.edu)