Skip to content

Commit

Permalink
Fixes #25170 - Update admin/pass param to initial_param.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1984 authored and ekohl committed Jan 8, 2019
1 parent e241509 commit 81fcf11
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
# work since PUP-4072 (3.7.5+) due to a bug resolving variables outside of this class.
if versioncmp($::puppetversion, '3.7.5') < 0 or defined('$foreman::foreman_url') {
$foreman_url_real = pick($foreman_url, $::foreman::foreman_url)
$username_real = pick($username, $::foreman::admin_username)
$password_real = pick($password, $::foreman::admin_password)
$username_real = pick($username, $::foreman::initial_admin_username)
$password_real = pick($password, $::foreman::initial_admin_password)
$ssl_ca_file_real = pick($ssl_ca_file, $::foreman::server_ssl_chain)
} else {
$foreman_url_real = $foreman_url
Expand Down
10 changes: 5 additions & 5 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

if $::foreman::db_manage_rake {
$seed_env = {
'SEED_ADMIN_USER' => $::foreman::admin_username,
'SEED_ADMIN_PASSWORD' => $::foreman::admin_password,
'SEED_ADMIN_FIRST_NAME' => $::foreman::admin_first_name,
'SEED_ADMIN_LAST_NAME' => $::foreman::admin_last_name,
'SEED_ADMIN_EMAIL' => $::foreman::admin_email,
'SEED_ADMIN_USER' => $::foreman::initial_admin_username,
'SEED_ADMIN_PASSWORD' => $::foreman::initial_admin_password,
'SEED_ADMIN_FIRST_NAME' => $::foreman::initial_admin_first_name,
'SEED_ADMIN_LAST_NAME' => $::foreman::initial_admin_last_name,
'SEED_ADMIN_EMAIL' => $::foreman::initial_admin_email,
'SEED_ORGANIZATION' => $::foreman::initial_organization,
'SEED_LOCATION' => $::foreman::initial_location,
}
Expand Down
22 changes: 11 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#
# === Parameters:
#
# $admin_username:: Username for the initial admin user
# $initial_admin_username:: Initial username for the admin user account, default is admin
#
# $admin_password:: Password of the initial admin user, default is randomly generated
# $initial_admin_password:: Initial password of the admin user, default is randomly generated
#
# $admin_first_name:: First name of the initial admin user
# $initial_admin_first_name:: Initial first name of the admin user
#
# $admin_last_name:: Last name of the initial admin user
# $initial_admin_last_name:: Initial last name of the admin user
#
# $admin_email:: E-mail address of the initial admin user
# $initial_admin_email:: Initial E-mail address of the admin user
#
# $db_manage:: if enabled, will install and configure the database server on this host
# $db_manage:: If enabled, will install and configure the database server on this host
#
# $db_type:: Database 'production' type
#
Expand Down Expand Up @@ -281,11 +281,11 @@
Boolean $passenger_prestart = $::foreman::params::passenger_prestart,
Integer[0] $passenger_min_instances = $::foreman::params::passenger_min_instances,
Integer[0] $passenger_start_timeout = $::foreman::params::passenger_start_timeout,
String $admin_username = $::foreman::params::admin_username,
String $admin_password = $::foreman::params::admin_password,
Optional[String] $admin_first_name = $::foreman::params::admin_first_name,
Optional[String] $admin_last_name = $::foreman::params::admin_last_name,
Optional[String] $admin_email = $::foreman::params::admin_email,
String $initial_admin_username = $::foreman::params::initial_admin_username,
String $initial_admin_password = $::foreman::params::initial_admin_password,
Optional[String] $initial_admin_first_name = $::foreman::params::initial_admin_first_name,
Optional[String] $initial_admin_last_name = $::foreman::params::initial_admin_last_name,
Optional[String] $initial_admin_email = $::foreman::params::initial_admin_email,
Optional[String] $initial_organization = $::foreman::params::initial_organization,
Optional[String] $initial_location = $::foreman::params::initial_location,
Boolean $ipa_authentication = $::foreman::params::ipa_authentication,
Expand Down
10 changes: 5 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
$oauth_consumer_secret = extlib::cache_data('foreman_cache_data', 'oauth_consumer_secret', extlib::random_password(32))

# Initial admin account details
$admin_username = 'admin'
$admin_password = extlib::cache_data('foreman_cache_data', 'admin_password', extlib::random_password(16))
$admin_first_name = undef
$admin_last_name = undef
$admin_email = undef
$initial_admin_username = 'admin'
$initial_admin_password = extlib::cache_data('foreman_cache_data', 'admin_password', extlib::random_password(16))
$initial_admin_first_name = undef
$initial_admin_last_name = undef
$initial_admin_email = undef

# Initial taxonomies
$initial_organization = undef
Expand Down
18 changes: 9 additions & 9 deletions spec/acceptance/foreman_basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class { '::apache::mod::passenger':
mode => '0640',
} ->
class { '::foreman':
repo => 'nightly',
user_groups => [],
admin_username => 'admin',
admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
server_ssl_key => $key,
server_ssl_crl => '',
repo => 'nightly',
user_groups => [],
initial_admin_username => 'admin',
initial_admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
server_ssl_key => $key,
server_ssl_crl => '',
}
EOS
end
Expand Down
20 changes: 10 additions & 10 deletions spec/acceptance/foreman_journald_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ class { '::apache::mod::passenger':
mode => '0640',
} ->
class { '::foreman':
repo => 'nightly',
user_groups => [],
admin_username => 'admin',
admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
server_ssl_key => $key,
server_ssl_crl => '',
logging_type => 'journald',
repo => 'nightly',
user_groups => [],
initial_admin_username => 'admin',
initial_admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
server_ssl_key => $key,
server_ssl_crl => '',
logging_type => 'journald',
}
EOS
end
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/foreman_prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class { '::apache::mod::passenger':
class { '::foreman':
repo => 'nightly',
user_groups => [],
admin_username => 'admin',
admin_password => 'changeme',
initial_admin_username => 'admin',
initial_admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/foreman_statsd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class { '::apache::mod::passenger':
class { '::foreman':
repo => 'nightly',
user_groups => [],
admin_username => 'admin',
admin_password => 'changeme',
initial_admin_username => 'admin',
initial_admin_password => 'changeme',
server_ssl_ca => $certificate,
server_ssl_chain => $certificate,
server_ssl_cert => $certificate,
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/foreman_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
let :pre_condition do
<<-PUPPET
class { 'foreman':
admin_username => 'jane',
admin_password => 'supersecret',
foreman_url => 'https://foreman.example.com',
server_ssl_chain => '/etc/puppetlabs/puppet/ssl/certs/ca.pub',
initial_admin_username => 'jane',
initial_admin_password => 'supersecret',
foreman_url => 'https://foreman.example.com',
server_ssl_chain => '/etc/puppetlabs/puppet/ssl/certs/ca.pub',
}
PUPPET
end
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/foreman_database_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
describe 'with seed parameters' do
let(:params) do
super().merge(
admin_username: 'joe',
admin_password: 'secret'
initial_admin_username: 'joe',
initial_admin_password: 'secret'
)
end

Expand Down
10 changes: 5 additions & 5 deletions spec/classes/foreman_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ class {'apache':
passenger_prestart: false,
passenger_min_instances: 3,
passenger_start_timeout: 20,
admin_username: 'admin',
admin_password: 'secret',
admin_first_name: 'Alice',
admin_last_name: 'Bob',
admin_email: 'alice@bob.com',
initial_admin_username: 'admin',
initial_admin_password: 'secret',
initial_admin_first_name: 'Alice',
initial_admin_last_name: 'Bob',
initial_admin_email: 'alice@bob.com',
initial_organization: 'acme',
initial_location: 'acme',
ipa_authentication: false,
Expand Down

0 comments on commit 81fcf11

Please sign in to comment.