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: I14c7305e36a0d72215da987a7cd0d0207be6d1d0
This commit is contained in:
Takashi Kajinami 2020-05-19 20:40:06 +09:00
parent 1fd97574bf
commit 7224590e4c
5 changed files with 20 additions and 21 deletions

View File

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

View File

@ -35,11 +35,11 @@ class zaqar::db::postgresql(
include zaqar::deps
::openstacklib::db::postgresql { 'zaqar':
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['zaqar::db::begin']

View File

@ -9,10 +9,6 @@
"name": "puppetlabs/stdlib",
"version_requirement": ">=5.0.0 <7.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

@ -12,18 +12,18 @@ describe 'zaqar::db::mysql' do
let :params do
{
'password' => 'fooboozoo_default_password',
'password' => 'zaqarpass',
}
end
describe 'with only required params' do
it { is_expected.to contain_openstacklib__db__mysql('zaqar').with(
'user' => 'zaqar',
'password_hash' => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
'dbname' => 'zaqar',
'host' => '127.0.0.1',
'charset' => 'utf8',
:collate => 'utf8_general_ci',
'user' => 'zaqar',
'password' => 'zaqarpass',
'dbname' => 'zaqar',
'host' => '127.0.0.1',
'charset' => 'utf8',
:collate => 'utf8_general_ci',
)}
end

View File

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