This cookbook installs and configures a DHCP Server.
- CentOS, RHEL, Scientific Linux
- Ubuntu
| Key | Type | Description | Default |
|---|---|---|---|
| ['dhcp']['option']['domain_name'] | String | Default domain name for dhcp | |
| ['dhcp']['option']['dns_servers'] | Array | List of dns servers | |
| ['dhcp']['option']['ntp_servers'] | Array | List of ntp servers |
Installs DHCP and sets up the core config
- add - adds the subnet
- remove - removes the subnet
- network - the network
- netmask - corresponding netmask for the network
- options - array of options
It would be way too much work to maintain an attribute for every possible option you can pass to subnet so this resource allows the ability of dynamically creating one.
ex:
dhcp_subnet '192.168.134.0' do
max_lease_time 03430
endThe above example would generate the following line in the actual config.
max-lease-time "03430";
This resource provides the ability to add pools to a subnet using a chef like DSL.
ex:
dhcp_subnet '192.168.134.0' do
netmask '255.255.255.0'
pool 'test1' do
range '192.168.134.1 192.168.134.128'
max_lease_time 2888
options(['routers 192.168.134.254'])
end
deny 'unknown-clients'
end- add - adds the host
- remove - removes the host
- physical_address - the mac address of the host
- fixed_address - the ip address of the host
- options - Array of options to pass
- host_name - Host name of the host (defaults to the resource name)
Include dhcp in your run list and set the above defaults in your node definition.
{
"name":"my_node",
"run_list": [
"recipe[dhcp]"
]
}- Fork the repository on Github
- Create a named feature branch (like
add_component_x) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Authors: Jim Rosser