Skip to content
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

Refs #22165 - Add installer support for disabling hsts #614

Merged
merged 1 commit into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@
# $jobs_service:: Name of the service for running the background Dynflow executor
#
# $dynflow_in_core:: Whether the Dynflow executor service is provided by Foreman or tasks
#
# $hsts_enabled:: Should HSTS enforcement in https requests be enabled
#
class foreman (
Stdlib::HTTPUrl $foreman_url = $::foreman::params::foreman_url,
Boolean $puppetrun = $::foreman::params::puppetrun,
Expand Down Expand Up @@ -303,6 +306,7 @@
Integer[0, 65535] $dynflow_pool_size = $::foreman::params::dynflow_pool_size,
Optional[String] $jobs_service = $::foreman::params::jobs_service,
Boolean $dynflow_in_core = $::foreman::params::dynflow_in_core,
Boolean $hsts_enabled = $::foreman::params::hsts_enabled,
) inherits foreman::params {
if $db_adapter == 'UNSET' {
$db_adapter_real = $::foreman::db_type ? {
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
$jobs_service_ensure = 'running'
$jobs_service_enable = true

$hsts_enabled = true

# OS specific paths
case $::osfamily {
'RedHat': {
Expand Down
1 change: 1 addition & 0 deletions spec/classes/foreman_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
with_content(%r{^:ssl_priv_key:\s*/var/lib/puppet/ssl/private_keys/foo\.example\.com\.pem$}).
with_content(/^:logging:\n\s*:level:\s*info$/).
with_content(/^:dynflow:\n\s*:pool_size:\s*5$/).
with_content(/^:hsts_enabled:\s*true$/).
with({})

should contain_concat('/etc/foreman/settings.yaml').with({
Expand Down
3 changes: 3 additions & 0 deletions templates/settings.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
:ssl_ca_file: <%= scope.lookupvar("foreman::client_ssl_ca") %>
:ssl_priv_key: <%= scope.lookupvar("foreman::client_ssl_key") %>

# HSTS setting
:hsts_enabled: <%= scope.lookupvar("foreman::hsts_enabled") %>

# Log settings for the current environment can be adjusted by adding them
# here. For example, if you want to increase the log level.
:logging:
Expand Down