From 81fcf11a48d3b5bee659e9a84c8927701e5d2674 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 7 Jan 2019 11:06:59 -0500 Subject: [PATCH] Fixes #25170 - Update admin/pass param to initial_param. --- manifests/cli.pp | 4 ++-- manifests/database.pp | 10 +++++----- manifests/init.pp | 22 +++++++++++----------- manifests/params.pp | 10 +++++----- spec/acceptance/foreman_basic_spec.rb | 18 +++++++++--------- spec/acceptance/foreman_journald_spec.rb | 20 ++++++++++---------- spec/acceptance/foreman_prometheus_spec.rb | 4 ++-- spec/acceptance/foreman_statsd_spec.rb | 4 ++-- spec/classes/foreman_cli_spec.rb | 8 ++++---- spec/classes/foreman_database_spec.rb | 4 ++-- spec/classes/foreman_spec.rb | 10 +++++----- 11 files changed, 57 insertions(+), 57 deletions(-) diff --git a/manifests/cli.pp b/manifests/cli.pp index 5cefcfbf0..ba92608f4 100644 --- a/manifests/cli.pp +++ b/manifests/cli.pp @@ -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 diff --git a/manifests/database.pp b/manifests/database.pp index 277f472f0..6020bc05c 100644 --- a/manifests/database.pp +++ b/manifests/database.pp @@ -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, } diff --git a/manifests/init.pp b/manifests/init.pp index efc08d56e..01c459e88 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 # @@ -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, diff --git a/manifests/params.pp b/manifests/params.pp index 7b24b0563..c2b755206 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 diff --git a/spec/acceptance/foreman_basic_spec.rb b/spec/acceptance/foreman_basic_spec.rb index e75ccd125..cc4f6951b 100644 --- a/spec/acceptance/foreman_basic_spec.rb +++ b/spec/acceptance/foreman_basic_spec.rb @@ -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 diff --git a/spec/acceptance/foreman_journald_spec.rb b/spec/acceptance/foreman_journald_spec.rb index a99388c42..c78b7cb1d 100644 --- a/spec/acceptance/foreman_journald_spec.rb +++ b/spec/acceptance/foreman_journald_spec.rb @@ -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 diff --git a/spec/acceptance/foreman_prometheus_spec.rb b/spec/acceptance/foreman_prometheus_spec.rb index b91280bd1..9fd09914e 100644 --- a/spec/acceptance/foreman_prometheus_spec.rb +++ b/spec/acceptance/foreman_prometheus_spec.rb @@ -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, diff --git a/spec/acceptance/foreman_statsd_spec.rb b/spec/acceptance/foreman_statsd_spec.rb index abab8a3f2..fda86e32b 100644 --- a/spec/acceptance/foreman_statsd_spec.rb +++ b/spec/acceptance/foreman_statsd_spec.rb @@ -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, diff --git a/spec/classes/foreman_cli_spec.rb b/spec/classes/foreman_cli_spec.rb index 35da28c15..f9b0c603b 100644 --- a/spec/classes/foreman_cli_spec.rb +++ b/spec/classes/foreman_cli_spec.rb @@ -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 diff --git a/spec/classes/foreman_database_spec.rb b/spec/classes/foreman_database_spec.rb index 038554b1f..f6d7659d0 100644 --- a/spec/classes/foreman_database_spec.rb +++ b/spec/classes/foreman_database_spec.rb @@ -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 diff --git a/spec/classes/foreman_spec.rb b/spec/classes/foreman_spec.rb index 41bc8c71f..c1cb45a43 100644 --- a/spec/classes/foreman_spec.rb +++ b/spec/classes/foreman_spec.rb @@ -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,