Browse Source

Merge "Remove password hash generation in each puppet modules"

changes/90/730790/1
Zuul 2 years ago committed by Gerrit Code Review
parent
commit
10075a5c7a
  1. 2
      manifests/db/mysql.pp
  2. 10
      manifests/db/postgresql.pp
  3. 4
      metadata.json
  4. 10
      spec/classes/ceilometer_db_mysql_spec.rb
  5. 11
      spec/classes/ceilometer_db_postgresql_spec.rb

2
manifests/db/mysql.pp

@ -48,7 +48,7 @@ class ceilometer::db::mysql(
openstacklib::db::mysql { 'ceilometer':
user => $user,
password_hash => mysql::password($password),
password => $password,
dbname => $dbname,
host => $host,
charset => $charset,

10
manifests/db/postgresql.pp

@ -35,11 +35,11 @@ class ceilometer::db::postgresql(
include ceilometer::deps
openstacklib::db::postgresql { 'ceilometer':
password_hash => postgresql_password($user, $password),
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
password => $password,
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
}
Anchor['ceilometer::db::begin']

4
metadata.json

@ -13,10 +13,6 @@
"name": "puppet/rabbitmq",
"version_requirement": ">=8.4.0 <11.0.0"
},
{
"name": "puppetlabs/mysql",
"version_requirement": ">=6.0.0 <11.0.0"
},
{
"name": "openstack/keystone",
"version_requirement": ">=17.0.0 <18.0.0"

10
spec/classes/ceilometer_db_mysql_spec.rb

@ -7,7 +7,7 @@ describe 'ceilometer::db::mysql' do
end
let :params do
{ :password => 's3cr3t',
{ :password => 'ceilometerpass',
:dbname => 'ceilometer',
:user => 'ceilometer',
:host => 'localhost',
@ -25,10 +25,10 @@ describe 'ceilometer::db::mysql' do
it 'creates a mysql database' do
is_expected.to contain_openstacklib__db__mysql( params[:dbname] ).with(
:user => params[:user],
:password_hash => '*58C036CDA51D8E8BBBBF2F9EA5ABF111ADA444F0',
:host => params[:host],
:charset => params[:charset]
:user => params[:user],
:password => params[:password],
:host => params[:host],
:charset => params[:charset]
)
end

11
spec/classes/ceilometer_db_postgresql_spec.rb

@ -4,7 +4,7 @@ describe 'ceilometer::db::postgresql' do
shared_examples_for 'ceilometer::db::postgresql' do
let :req_params do
{ :password => 'pw' }
{ :password => 'ceilometerpass' }
end
let :pre_condition do
@ -16,9 +16,12 @@ describe 'ceilometer::db::postgresql' do
req_params
end
it { is_expected.to contain_postgresql__server__db('ceilometer').with(
:user => 'ceilometer',
:password => 'md52899c518e96bce6633ab342b0ca38292'
it { is_expected.to contain_openstacklib__db__postgresql('ceilometer').with(
:user => 'ceilometer',
:password => 'ceilometerpass',
:dbname => 'ceilometer',
:encoding => nil,
:privileges => 'ALL',
)}
end

Loading…
Cancel
Save