Skip to content

Commit

Permalink
Do not reassign $hostname variable when http_enabled=false (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock authored Jul 15, 2023
1 parent b0f0ee4 commit fe8f6a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@
}
} else {
if $config['hostname'] in ['unset', 'UNSET'] {
$hostname = $facts['networking']['fqdn']
$effective_hostname = $facts['networking']['fqdn']
} else {
$hostname = $config['hostname']
$effective_hostname = $config['hostname']
}
$wrapper_protocol = 'https'
$wrapper_port = $config['https-port']
$wrapper_address = $hostname
$wrapper_address = $effective_hostname
$validator_port = $config['https-port']
$validator_server = $hostname
$validator_server = $effective_hostname
$validator_ssl = true
}
$wrapper_server = "${wrapper_protocol}://${wrapper_address}:${wrapper_port}${config['http-relative-path']}"
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@
end
end

context 'when http_enabled => false' do
let(:params) { { http_enabled: false } }

it do
verify_contents(catalogue, "/opt/keycloak-#{version}/conf/keycloak.conf", ['http-enabled=false'])
end
end

context 'when features defined' do
let(:params) { { features: ['authorization', 'impersonation'] } }

Expand Down

0 comments on commit fe8f6a6

Please sign in to comment.