-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for additional DHCP listen interfaces #399
Conversation
The failing test is not related to my changes and will probably run successfully if re-triggered. So how do I get Travis to run the tests once more? |
I'll close the PR and open it again, that should trigger Travis. |
That was https://www.traviscistatus.com/incidents/v4jnp6nkgzqx and I was too late with restarting the test. I'll have a look at the changes later. |
The tests are now passing, FWIW :) |
manifests/proxydhcp.pp
Outdated
@@ -33,7 +33,7 @@ | |||
class { '::dhcp': | |||
dnsdomain => $foreman_proxy::dhcp_option_domain, | |||
nameservers => $nameservers, | |||
interfaces => [$foreman_proxy::dhcp_interface], | |||
interfaces => [$foreman_proxy::dhcp_interface] + [$foreman_proxy::dhcp_additional_interfaces].flatten.delete_undef_values, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know this was possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Puppet 4 introduced some nice language features :)
manifests/init.pp
Outdated
@@ -366,6 +368,7 @@ | |||
Array[String] $dhcp_option_domain = $::foreman_proxy::params::dhcp_option_domain, | |||
Optional[Array[String]] $dhcp_search_domains = $::foreman_proxy::params::dhcp_search_domains, | |||
String $dhcp_interface = $::foreman_proxy::params::dhcp_interface, | |||
Optional[Variant[Array[String], String]] $dhcp_additional_interfaces = $::foreman_proxy::params::dhcp_additional_interfaces, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if this was simply Array[String]
which defaults to []
in params.pp
since it removes the need to clean it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will do.
manifests/init.pp
Outdated
@@ -174,6 +174,8 @@ | |||
# | |||
# $dhcp_interface:: DHCP listen interface | |||
# | |||
# $dhcp_additional_interfaces:: Additional DHCP listen interfaces (in addition to dhcp_interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add that we don't provision any subnet for this by default (in contrast to dhcp_interface
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will do.
6121cba
to
26f7609
Compare
I've implemented the requested changes. Please let me know if this needs further work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, just minor formatting detail left.
manifests/init.pp
Outdated
@@ -174,6 +174,8 @@ | |||
# | |||
# $dhcp_interface:: DHCP listen interface | |||
# | |||
# $dhcp_additional_interfaces:: Additional DHCP listen interfaces (in addition to dhcp_interface). Note: as opposed to dhcp_interface *no* subnet will be provisioned for any of the additional DHCP listen interfaces. Please configure any additional subnets using `dhcp::pool` and related resource types (provided by the theforeman/puppet-dhcp module). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you wrap this so it's not such a long line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, how should I wrap it? At 140 characters, like this?
# $dhcp_additional_interfaces:: Additional DHCP listen interfaces (in addition to dhcp_interface). Note: as opposed to dhcp_interface *no*
# subnet will be provisioned for any of the additional DHCP listen interfaces. Please configure any additional
# subnets using `dhcp::pool` and related resource types (provided by the theforeman/puppet-dhcp module).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good.
This change adds a new parameter foreman_proxy::dhcp_additional_interfaces which defaults to the empty array `[]`. The parameter's value must be an array of interface names (i.e. an array of strings). When set the managed DHCP server will listen for DHCP requests on these interfaces, in addition to the interface specified in foreman_proxy::dhcp_interface. No subnets will be provisioned for these additional DHCP listen interfaces.
26f7609
to
9875b90
Compare
Ok, done. |
merged, thanks @antaflos! |
This change adds a new parameter foreman_proxy::dhcp_additional_interfaces which defaults to the empty array
[]
. The parameter's value must be an array of interface names (i.e. an array of strings). When set the managed DHCP server will listen for DHCP requests on these interfaces, in addition to the interface specified in foreman_proxy::dhcp_interface. No subnets will be provisioned for these additional DHCP listen interfaces.Fixes GH-400.