Skip to content

Commit

Permalink
Construct foreman_url from servername and drop parameter
Browse files Browse the repository at this point in the history
Drops the foreman_url parameter and constructs it from the servername
given to Apache. The foreman_url and servername should match
and this gives one less parameter that needs to be configured to get
a correct installation.
  • Loading branch information
ehelms committed Feb 21, 2023
1 parent f32405c commit 78716e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#
# === Advanced parameters:
#
# $foreman_url:: URL on which foreman is going to run
#
# $unattended:: Should Foreman manage host provisioning as well
#
# $unattended_url:: URL hosts will retrieve templates from during build (normally http as many installers don't support https)
Expand Down Expand Up @@ -203,7 +201,6 @@
# $keycloak_realm:: The realm as passed to keycloak-httpd-client-install
#
class foreman (
Stdlib::HTTPUrl $foreman_url = $foreman::params::foreman_url,
Boolean $unattended = true,
Optional[Stdlib::HTTPUrl] $unattended_url = undef,
Boolean $apache = true,
Expand Down Expand Up @@ -303,6 +300,8 @@
$db_sslmode_real = $db_sslmode
}

$foreman_url = "https://${servername}"

include foreman::install
include foreman::config
include foreman::database
Expand Down
2 changes: 0 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
class foreman::params inherits foreman::globals {
$lower_fqdn = downcase($facts['networking']['fqdn'])

# Basic configurations
$foreman_url = "https://${lower_fqdn}"
# Server name of the VirtualHost
$servername = $facts['networking']['fqdn']

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin/remote_execution_cockpit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:pre_condition) do
<<-PUPPET
class {'foreman':
foreman_url => 'https://foreman.example.com',
servername => 'foreman.example.com',
server_ssl_chain => '/path/to/ca.pem',
client_ssl_cert => '/path/to/cert.pem',
client_ssl_key => '/path/to/key.pem',
Expand Down

0 comments on commit 78716e1

Please sign in to comment.