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

Construct foreman_url from servername and drop parameter #987

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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/foreman_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
class { 'foreman':
initial_admin_username => 'jane',
initial_admin_password => 'supersecret',
foreman_url => 'https://foreman.example.com',
servername => 'foreman.example.com',
server_ssl_chain => '/etc/puppetlabs/puppet/ssl/certs/ca.pub',
}
PUPPET
Expand Down
1 change: 0 additions & 1 deletion spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
describe 'with all parameters' do
let :params do
{
foreman_url: 'http://localhost',
unattended: true,
servername: 'localhost',
serveraliases: ['foreman'],
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