Create Variable for MySQL Root Password
The mysql module REQUIRES a root_password for the mysql::server module. I changed a statically-set password to a parameter to make this process a bit easier.
This commit is contained in:
@@ -16,6 +16,7 @@ To install the Puppet Dashboard and configure it with sane defaults, include the
|
|||||||
dashboard_password => 'changeme',
|
dashboard_password => 'changeme',
|
||||||
dashboard_db => 'dashboard_db',
|
dashboard_db => 'dashboard_db',
|
||||||
dashboard_charset => 'utf8',
|
dashboard_charset => 'utf8',
|
||||||
|
mysql_root_pw => 'REALLY_change_me',
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
# [*dashbaord_password*] - Password for the puppet-dashboard database user.
|
# [*dashbaord_password*] - Password for the puppet-dashboard database user.
|
||||||
# [*dashboard_db*] - The puppet-dashboard database name.
|
# [*dashboard_db*] - The puppet-dashboard database name.
|
||||||
# [*dashboard_charset*] - Character set for the puppet-dashboard database.
|
# [*dashboard_charset*] - Character set for the puppet-dashboard database.
|
||||||
|
# [*mysql_root_pw*] - Password for root on MySQL
|
||||||
#
|
#
|
||||||
# Actions:
|
# Actions:
|
||||||
# Install mysql, ruby-mysql, and mysql-server
|
# Install mysql, ruby-mysql, and mysql-server
|
||||||
@@ -39,6 +40,7 @@ class dashboard (
|
|||||||
$dashboard_password = $dashboard::params::dashboard_password,
|
$dashboard_password = $dashboard::params::dashboard_password,
|
||||||
$dashboard_db = $dashboard::params::dashboard_db,
|
$dashboard_db = $dashboard::params::dashboard_db,
|
||||||
$dashboard_charset = $dashboard::params::dashboard_charset
|
$dashboard_charset = $dashboard::params::dashboard_charset
|
||||||
|
$mysql_root_pw = $dashboard::params::mysql_root_pw
|
||||||
|
|
||||||
) inherits dashboard::params {
|
) inherits dashboard::params {
|
||||||
|
|
||||||
@@ -49,15 +51,17 @@ class dashboard (
|
|||||||
validate_re($dashboard_password, $v_alphanum)
|
validate_re($dashboard_password, $v_alphanum)
|
||||||
validate_re($dashboard_db, $v_alphanum)
|
validate_re($dashboard_db, $v_alphanum)
|
||||||
validate_re($dashboard_charset, $v_alphanum)
|
validate_re($dashboard_charset, $v_alphanum)
|
||||||
|
validate_re($mysql_root_pw, $v_alphanum)
|
||||||
|
|
||||||
$dashboard_ensure_real = $dashboard_ensure
|
$dashboard_ensure_real = $dashboard_ensure
|
||||||
$dashboard_user_real = $dashboard_user
|
$dashboard_user_real = $dashboard_user
|
||||||
$dashboard_password_real = $dashboard_password
|
$dashboard_password_real = $dashboard_password
|
||||||
$dashboard_db_real = $dashboard_db
|
$dashboard_db_real = $dashboard_db
|
||||||
$dashboard_charset_real = $dashboard_charset
|
$dashboard_charset_real = $dashboard_charset
|
||||||
|
$mysql_root_pw_real = $mysql_root_pw
|
||||||
|
|
||||||
class { 'mysql': }
|
class { 'mysql': }
|
||||||
class { 'mysql::server': root_password => "Ch@ngem3!" }
|
class { 'mysql::server': root_password => $mysql_root_pw_real }
|
||||||
class { 'mysql::ruby':
|
class { 'mysql::ruby':
|
||||||
package_provider => $dashboard::params::mysql_package_provider,
|
package_provider => $dashboard::params::mysql_package_provider,
|
||||||
package_name => $dashboard::params::ruby_mysql_package,
|
package_name => $dashboard::params::ruby_mysql_package,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ node default {
|
|||||||
dashboard_password => 'changeme',
|
dashboard_password => 'changeme',
|
||||||
dashboard_db => 'dashboard_production',
|
dashboard_db => 'dashboard_production',
|
||||||
dashboard_charset => 'utf8'
|
dashboard_charset => 'utf8'
|
||||||
|
mysql_root_pw => 'REALLY_change_me',
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user