|
1 | 1 | # == Class: dhcp |
2 | 2 | # |
3 | 3 | class dhcp ( |
4 | | - Optional[Array[String]] $dnsdomain = undef, |
5 | | - Array[Stdlib::IP::Address::V4] $nameservers = [], |
6 | | - Array[Stdlib::IP::Address::V6] $nameservers_ipv6 = [], |
7 | | - Array[String] $ntpservers = [], |
8 | | - Array[String] $dnssearchdomains = [], |
9 | | - String $dhcp_conf_header = 'INTERNAL_TEMPLATE', |
10 | | - String $dhcp_conf_ddns = 'INTERNAL_TEMPLATE', |
11 | | - String $dhcp_conf_ntp = 'INTERNAL_TEMPLATE', |
12 | | - String $dhcp_conf_pxe = 'INTERNAL_TEMPLATE', |
13 | | - String $dhcp_conf_extra = 'INTERNAL_TEMPLATE', |
14 | | - Hash[String, Hash[String, String]] $dhcp_conf_fragments = {}, |
15 | | - Optional[Array[String]] $interfaces = undef, |
16 | | - String $interface = 'NOTSET', |
17 | | - $dnsupdatekey = undef, |
18 | | - String $ddns_update_style = 'interim', |
19 | | - $dnskeyname = undef, |
20 | | - String $ddns_update_static = 'on', |
21 | | - String $ddns_update_optimize = 'on', |
22 | | - Enum['allow', 'deny'] $ddns_client_updates = 'allow', |
23 | | - $pxeserver = undef, |
24 | | - $pxefilename = undef, |
25 | | - Optional[Integer] $mtu = undef, |
26 | | - $ipxe_filename = undef, |
27 | | - $ipxe_bootstrap = undef, |
28 | | - String $logfacility = 'daemon', |
29 | | - Integer $default_lease_time = 43200, |
30 | | - Integer $max_lease_time = 86400, |
31 | | - $service_ensure = running, |
32 | | - $globaloptions = '', |
33 | | - Optional[Stdlib::Port] $omapi_port = undef, |
34 | | - Optional[String] $omapi_name = undef, |
35 | | - String $omapi_algorithm = 'HMAC-MD5', |
36 | | - Optional[String] $omapi_key = undef, |
37 | | - Boolean $authoritative = true, |
38 | | - Variant[Array[String],String[1]] $extra_config = [], |
39 | | - $dhcp_dir = $dhcp::params::dhcp_dir, |
40 | | - String $dhcpd_conf_filename = 'dhcpd.conf', |
41 | | - $packagename = $dhcp::params::packagename, |
42 | | - Boolean $manage_package = true, |
43 | | - $servicename = $dhcp::params::servicename, |
44 | | - Boolean $manage_service = true, |
45 | | - $package_provider = $dhcp::params::package_provider, |
46 | | - Integer[0,65535] $ldap_port = 389, |
47 | | - String $ldap_server = 'localhost', |
48 | | - String $ldap_username = 'cn=root, dc=example, dc=com', |
49 | | - String $ldap_password = '', |
50 | | - String $ldap_base_dn = 'dc=example, dc=com', |
51 | | - Enum['dynamic', 'static'] $ldap_method = 'dynamic', |
52 | | - Optional[Stdlib::Absolutepath] $ldap_debug_file = undef, |
53 | | - Boolean $use_ldap = false, |
54 | | - String $option_code150_label = 'pxegrub', |
55 | | - String $option_code150_value = 'text', |
56 | | - Hash[String, Hash] $dhcp_classes = {}, |
57 | | - Hash[String, Hash] $hosts = {}, |
58 | | - Hash[String, Hash] $ignoredsubnets = {}, |
59 | | - Hash[String, Hash] $pools = {}, |
60 | | - Hash[String, Hash] $pools6 = {}, |
61 | | - Optional[Stdlib::Absolutepath] $dhcpd_binary = $dhcp::params::dhcpd_binary |
| 4 | + Optional[Array[String[1]]] $dnsdomain = undef, |
| 5 | + Array[Stdlib::IP::Address::V4] $nameservers = [], |
| 6 | + Array[Stdlib::IP::Address::V6] $nameservers_ipv6 = [], |
| 7 | + Array[Variant[Stdlib::Fqdn,Stdlib::IP::Address]] $ntpservers = [], |
| 8 | + Array[String[1]] $dnssearchdomains = [], |
| 9 | + String $dhcp_conf_header = 'INTERNAL_TEMPLATE', |
| 10 | + String $dhcp_conf_ddns = 'INTERNAL_TEMPLATE', |
| 11 | + String $dhcp_conf_ntp = 'INTERNAL_TEMPLATE', |
| 12 | + String $dhcp_conf_pxe = 'INTERNAL_TEMPLATE', |
| 13 | + String $dhcp_conf_extra = 'INTERNAL_TEMPLATE', |
| 14 | + Hash[String[1], Hash[String[1], String[1]]] $dhcp_conf_fragments = {}, |
| 15 | + Optional[Array[String[1]]] $interfaces = undef, |
| 16 | + String[1] $interface = 'NOTSET', |
| 17 | + Optional[String[1]] $dnsupdatekey = undef, |
| 18 | + String[1] $ddns_update_style = 'interim', |
| 19 | + Optional[String[1]] $dnskeyname = undef, |
| 20 | + String[1] $ddns_update_static = 'on', |
| 21 | + String[1] $ddns_update_optimize = 'on', |
| 22 | + Enum['allow', 'deny'] $ddns_client_updates = 'allow', |
| 23 | + Optional[Stdlib::IP::Address] $pxeserver = undef, |
| 24 | + Optional[String[1]] $pxefilename = undef, |
| 25 | + Optional[Integer[1]] $mtu = undef, |
| 26 | + Optional[String[1]] $ipxe_filename = undef, |
| 27 | + Optional[String[1]] $ipxe_bootstrap = undef, |
| 28 | + Dhcp::Syslogfacility $logfacility = 'daemon', |
| 29 | + Integer[1] $default_lease_time = 43200, |
| 30 | + Integer[1] $max_lease_time = 86400, |
| 31 | + Stdlib::Ensure::Service $service_ensure = 'running', |
| 32 | + Variant[String[0],Array[String[1]]] $globaloptions = '', |
| 33 | + Optional[Stdlib::Port] $omapi_port = undef, |
| 34 | + Optional[String[1]] $omapi_name = undef, |
| 35 | + String[1] $omapi_algorithm = 'HMAC-MD5', |
| 36 | + Optional[String[1]] $omapi_key = undef, |
| 37 | + Boolean $authoritative = true, |
| 38 | + Variant[Array[String[1]],String[1]] $extra_config = [], |
| 39 | + Stdlib::Absolutepath $dhcp_dir = $dhcp::params::dhcp_dir, |
| 40 | + String[1] $dhcpd_conf_filename = 'dhcpd.conf', |
| 41 | + String[1] $packagename = $dhcp::params::packagename, |
| 42 | + Boolean $manage_package = true, |
| 43 | + Variant[String[1],Array[String[1]]] $servicename = $dhcp::params::servicename, |
| 44 | + Boolean $manage_service = true, |
| 45 | + Optional[String[1]] $package_provider = $dhcp::params::package_provider, |
| 46 | + Stdlib::Port $ldap_port = 389, |
| 47 | + String[1] $ldap_server = 'localhost', |
| 48 | + String[1] $ldap_username = 'cn=root, dc=example, dc=com', |
| 49 | + String[0] $ldap_password = '', |
| 50 | + String[1] $ldap_base_dn = 'dc=example, dc=com', |
| 51 | + Enum['dynamic', 'static'] $ldap_method = 'dynamic', |
| 52 | + Optional[Stdlib::Absolutepath] $ldap_debug_file = undef, |
| 53 | + Boolean $use_ldap = false, |
| 54 | + String[1] $option_code150_label = 'pxegrub', |
| 55 | + String[1] $option_code150_value = 'text', |
| 56 | + Hash[String[1], Hash] $dhcp_classes = {}, |
| 57 | + Hash[String[1], Hash] $hosts = {}, |
| 58 | + Hash[String, Hash] $ignoredsubnets = {}, |
| 59 | + Hash[String, Hash] $pools = {}, |
| 60 | + Hash[String, Hash] $pools6 = {}, |
| 61 | + Optional[Stdlib::Absolutepath] $dhcpd_binary = $dhcp::params::dhcpd_binary |
62 | 62 | ) inherits dhcp::params { |
63 | 63 |
|
64 | 64 | # check if extra_config is a string, if so convert it to an array |
|
68 | 68 | $extra_config_real = $extra_config |
69 | 69 | } |
70 | 70 |
|
71 | | - if $dnsdomain == undef { |
| 71 | + if $dnsdomain { |
| 72 | + $dnsdomain_real = $dnsdomain |
| 73 | + } else { |
72 | 74 | if $facts['domain'] { |
73 | | - $dnsdomain_real = [ $::domain ] |
| 75 | + $dnsdomain_real = [ $facts['domain'] ] |
74 | 76 | } else { |
75 | 77 | fail('dhcp::dnsdomain must be set and domain fact is missing to use as a default value.') |
76 | | - } |
77 | | - } else { |
78 | | - $dnsdomain_real = $dnsdomain |
| 78 | + } |
79 | 79 | } |
80 | 80 |
|
81 | 81 | if $pxeserver or $pxefilename { |
|
0 commit comments