Skip to content

Commit

Permalink
Fixes #30449 - Do not require TFTP for HTTPBoot
Browse files Browse the repository at this point in the history
Since Foreman Proxy 1.22 the hard requirement on TFTP is no longer
present. This changes the default to always be off, rather than on. This
makes sense since in the default deployment HTTP is off and most
installations don't support booting over HTTPS.

To get the netboot files, the TFTP feature must still be enabled.
  • Loading branch information
ekohl committed Dec 10, 2020
1 parent af2656f commit e4b7763
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
#
# $ssldir:: Puppet CA SSL directory
#
# $httpboot:: Enable HTTPBoot feature. In most deployments this requires HTTP to be enabled as well.
#
# $puppetdir:: Puppet var directory
#
# $puppetca_cmd:: Puppet CA command to be allowed in sudoers
Expand Down Expand Up @@ -273,8 +275,6 @@
#
# $dhcp_manage_acls:: Whether to manage DHCP directory ACLs. This allows the Foreman Proxy user to access even if the directory mode is 0750.
#
# $httpboot:: Enable HTTPBoot feature
#
# $httpboot_listen_on:: HTTPBoot proxy to listen on https, http, or both
#
# $puppetca_provider:: Whether to use puppetca_hostname_whitelisting or puppetca_token_whitelisting
Expand Down
12 changes: 2 additions & 10 deletions manifests/module/httpboot.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@
# @param listen_on
# Where to listen on.
class foreman_proxy::module::httpboot (
Optional[Boolean] $enabled = $foreman_proxy::httpboot,
Boolean $enabled = $foreman_proxy::httpboot,
Foreman_proxy::ListenOn $listen_on = $foreman_proxy::httpboot_listen_on,
) {
$real_enabled = pick($enabled, $foreman_proxy::tftp)
if $real_enabled {
include foreman_proxy::module::tftp
unless $foreman_proxy::module::tftp::enabled {
fail('The HTTPBoot module depends on the TFTP module to be enabled')
}
}

foreman_proxy::module { 'httpboot':
enabled => $real_enabled,
enabled => $enabled,
feature => 'HTTPBoot',
listen_on => $listen_on,
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@
$logs = true
$logs_listen_on = 'https'

# HTTPBoot settings - requires optional httpboot puppet module
$httpboot = undef
# HTTPBoot settings
$httpboot = false
$httpboot_listen_on = 'both'

# TFTP settings - requires optional TFTP puppet module
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/foreman_proxy__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
it 'should generate correct httpboot.yml' do
verify_exact_contents(catalogue, "#{etc_dir}/foreman-proxy/settings.d/httpboot.yml", [
'---',
':enabled: true',
':enabled: false',
":root_dir: #{tftp_root}",
])
end
Expand Down

0 comments on commit e4b7763

Please sign in to comment.