Remove password hash generation in each puppet modules

... and migrate it to openstacklib so that all logics about database
configuration are implemented in one common place.

Depends-on: https://review.opendev.org/#/c/728595/
Change-Id: I6a46e45b8af4c8c1cdf7913bc625b57e49a79687
This commit is contained in:
Takashi Kajinami 2020-05-19 19:35:58 +09:00
parent 8c956ab506
commit f562e27069
5 changed files with 18 additions and 19 deletions

View File

@ -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,

View File

@ -35,7 +35,7 @@ class ceilometer::db::postgresql(
include ceilometer::deps
openstacklib::db::postgresql { 'ceilometer':
password_hash => postgresql_password($user, $password),
password => $password,
dbname => $dbname,
user => $user,
encoding => $encoding,

View File

@ -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": ">=16.3.0 <17.0.0"

View File

@ -7,7 +7,7 @@ describe 'ceilometer::db::mysql' do
end
let :params do
{ :password => 's3cr3t',
{ :password => 'ceilometerpass',
:dbname => 'ceilometer',
:user => 'ceilometer',
:host => 'localhost',
@ -26,7 +26,7 @@ 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',
:password => params[:password],
:host => params[:host],
:charset => params[:charset]
)

View File

@ -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(
it { is_expected.to contain_openstacklib__db__postgresql('ceilometer').with(
:user => 'ceilometer',
:password => 'md52899c518e96bce6633ab342b0ca38292'
:password => 'ceilometerpass',
:dbname => 'ceilometer',
:encoding => nil,
:privileges => 'ALL',
)}
end