|
62 | 62 | $_dhcp_ipxefilename = undef
|
63 | 63 | }
|
64 | 64 |
|
| 65 | + if $foreman_proxy::dhcp_key_secret { |
| 66 | + # TODO parametrize |
| 67 | + $dhcp_key_algorithm = undef |
| 68 | + $dhcp_key_secret = $foreman_proxy::dhcp_key_secret |
| 69 | + } else { |
| 70 | + # TODO: ensure bind-utils is installed before dns::tsig_keygen runs |
| 71 | + # TODO: if the function runs on a server, do you need it on the server? Or use Deferred? |
| 72 | + $tsig_key = extlib::cache_data('theforeman', 'dhcp_omapi', dns::tsig_keygen($foreman_proxy::dhcp_key_name)) |
| 73 | + $dhcp_key_algorithm = $tsig_key['algorithm'] |
| 74 | + $dhcp_key_secret = $tsig_key['secret'] |
| 75 | + } |
| 76 | + |
65 | 77 | class { 'dhcp':
|
66 |
| - dnsdomain => $foreman_proxy::dhcp_option_domain, |
67 |
| - nameservers => $nameservers, |
68 |
| - interfaces => [$foreman_proxy::dhcp_interface] + $foreman_proxy::dhcp_additional_interfaces, |
69 |
| - pxeserver => $ip, |
70 |
| - pxefilename => $foreman_proxy::dhcp_pxefilename, |
71 |
| - ipxe_filename => $_dhcp_ipxefilename, |
72 |
| - omapi_name => $foreman_proxy::dhcp_key_name, |
73 |
| - omapi_key => $foreman_proxy::dhcp_key_secret, |
74 |
| - conf_dir_mode => $conf_dir_mode, |
| 78 | + dnsdomain => $foreman_proxy::dhcp_option_domain, |
| 79 | + nameservers => $nameservers, |
| 80 | + interfaces => [$foreman_proxy::dhcp_interface] + $foreman_proxy::dhcp_additional_interfaces, |
| 81 | + pxeserver => $ip, |
| 82 | + pxefilename => $foreman_proxy::dhcp_pxefilename, |
| 83 | + ipxe_filename => $_dhcp_ipxefilename, |
| 84 | + omapi_name => $foreman_proxy::dhcp_key_name, |
| 85 | + omapi_key => $dhcp_key_secret, |
| 86 | + omapi_algorithm => $dhcp_key_algorithm, |
| 87 | + conf_dir_mode => $conf_dir_mode, |
75 | 88 | }
|
76 | 89 |
|
77 | 90 | dhcp::pool { $facts['networking']['domain']:
|
|
0 commit comments