From a4093b3ca225224d561f186260e7fea99498c701 Mon Sep 17 00:00:00 2001 From: Dan West Date: Wed, 17 Jul 2019 12:23:14 -0700 Subject: [PATCH 1/5] Removing IP validation in order to get dns lookups to work --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index 6618f7c01..fe5e5244d 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,7 +1,7 @@ # == Define: dhcp::host # define dhcp::host ( - Optional[Stdlib::IP::Address] $ip = undef, + Optional $ip = undef, Dhcp::Mac $mac, String $ddns_hostname = $name, Hash $options = {}, From fa70ca14d7fd6aee050c621e6075c6f36815d2cc Mon Sep 17 00:00:00 2001 From: Dan West Date: Wed, 17 Jul 2019 13:02:17 -0700 Subject: [PATCH 2/5] Adding a max-lease-time option to the pool scope --- manifests/pool.pp | 1 + templates/dhcpd.pool.erb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/manifests/pool.pp b/manifests/pool.pp index 48b0f666d..f9bbd7867 100644 --- a/manifests/pool.pp +++ b/manifests/pool.pp @@ -14,6 +14,7 @@ Optional[Integer] $mtu = undef, String $domain_name = '', $ignore_unknown = undef, + Optional[Integer] $max_lease_time = undef, ) { include dhcp::params diff --git a/templates/dhcpd.pool.erb b/templates/dhcpd.pool.erb index 0114019c4..8389dc1ab 100644 --- a/templates/dhcpd.pool.erb +++ b/templates/dhcpd.pool.erb @@ -12,6 +12,9 @@ subnet <%= @network %> netmask <%= @mask %> { <% if @ignore_unknown == true -%> ignore unknown-clients ; <% end -%> +<% if @max_lease_time != '' -%> + max-lease-time <%= @max_lease_time %>; +<% end -%> <% if @range and @range.is_a? Array -%> <% @range.each do |r| -%> range <%= r %>; From e41143385d46da77c140507824375cc61ad55989 Mon Sep 17 00:00:00 2001 From: Dan West Date: Wed, 17 Jul 2019 13:27:25 -0700 Subject: [PATCH 3/5] setting max_lease_time as optional if undef --- templates/dhcpd.pool.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dhcpd.pool.erb b/templates/dhcpd.pool.erb index 8389dc1ab..72aa3f5ff 100644 --- a/templates/dhcpd.pool.erb +++ b/templates/dhcpd.pool.erb @@ -12,7 +12,7 @@ subnet <%= @network %> netmask <%= @mask %> { <% if @ignore_unknown == true -%> ignore unknown-clients ; <% end -%> -<% if @max_lease_time != '' -%> +<% if @max_lease_time -%> max-lease-time <%= @max_lease_time %>; <% end -%> <% if @range and @range.is_a? Array -%> From 7f7155efcbf12c9910667403999956b833b1e132 Mon Sep 17 00:00:00 2001 From: Dan West Date: Wed, 17 Jul 2019 17:22:19 -0700 Subject: [PATCH 4/5] Matches a valid host which could be a valid ipv4, ipv6 or fqdn --- manifests/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index fe5e5244d..a8a327843 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,7 +1,7 @@ # == Define: dhcp::host # define dhcp::host ( - Optional $ip = undef, + Optional[Stdlib::Host] $ip = undef, Dhcp::Mac $mac, String $ddns_hostname = $name, Hash $options = {}, From aa0eabf3747a005c3e25f4ef4df0681da98bd1d8 Mon Sep 17 00:00:00 2001 From: Dan West Date: Wed, 17 Jul 2019 12:23:14 -0700 Subject: [PATCH 5/5] Adding a max-lease-time parameter to the pool scope. Allow `fqdn` as a valid value in the `fixed-address` field. --- manifests/host.pp | 2 +- manifests/pool.pp | 1 + templates/dhcpd.pool.erb | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/host.pp b/manifests/host.pp index 6618f7c01..a8a327843 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -1,7 +1,7 @@ # == Define: dhcp::host # define dhcp::host ( - Optional[Stdlib::IP::Address] $ip = undef, + Optional[Stdlib::Host] $ip = undef, Dhcp::Mac $mac, String $ddns_hostname = $name, Hash $options = {}, diff --git a/manifests/pool.pp b/manifests/pool.pp index 48b0f666d..f9bbd7867 100644 --- a/manifests/pool.pp +++ b/manifests/pool.pp @@ -14,6 +14,7 @@ Optional[Integer] $mtu = undef, String $domain_name = '', $ignore_unknown = undef, + Optional[Integer] $max_lease_time = undef, ) { include dhcp::params diff --git a/templates/dhcpd.pool.erb b/templates/dhcpd.pool.erb index 0114019c4..72aa3f5ff 100644 --- a/templates/dhcpd.pool.erb +++ b/templates/dhcpd.pool.erb @@ -12,6 +12,9 @@ subnet <%= @network %> netmask <%= @mask %> { <% if @ignore_unknown == true -%> ignore unknown-clients ; <% end -%> +<% if @max_lease_time -%> + max-lease-time <%= @max_lease_time %>; +<% end -%> <% if @range and @range.is_a? Array -%> <% @range.each do |r| -%> range <%= r %>;