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: I6b4f8479030b28957c540c5f0775d5f799dff5dd
This commit is contained in:
parent
a5a8b53078
commit
4e7d912fde
@ -49,7 +49,7 @@ class mistral::db::mysql(
|
|||||||
|
|
||||||
::openstacklib::db::mysql { 'mistral':
|
::openstacklib::db::mysql { 'mistral':
|
||||||
user => $user,
|
user => $user,
|
||||||
password_hash => mysql::password($password),
|
password => $password,
|
||||||
dbname => $dbname,
|
dbname => $dbname,
|
||||||
host => $host,
|
host => $host,
|
||||||
charset => $charset,
|
charset => $charset,
|
||||||
|
@ -35,11 +35,11 @@ class mistral::db::postgresql(
|
|||||||
include mistral::deps
|
include mistral::deps
|
||||||
|
|
||||||
::openstacklib::db::postgresql { 'mistral':
|
::openstacklib::db::postgresql { 'mistral':
|
||||||
password_hash => postgresql_password($user, $password),
|
password => $password,
|
||||||
dbname => $dbname,
|
dbname => $dbname,
|
||||||
user => $user,
|
user => $user,
|
||||||
encoding => $encoding,
|
encoding => $encoding,
|
||||||
privileges => $privileges,
|
privileges => $privileges,
|
||||||
}
|
}
|
||||||
|
|
||||||
Anchor['mistral::db::begin']
|
Anchor['mistral::db::begin']
|
||||||
|
@ -13,10 +13,6 @@
|
|||||||
"name": "puppetlabs/stdlib",
|
"name": "puppetlabs/stdlib",
|
||||||
"version_requirement": ">=5.0.0 <7.0.0"
|
"version_requirement": ">=5.0.0 <7.0.0"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "puppetlabs/mysql",
|
|
||||||
"version_requirement": ">=6.0.0 <11.0.0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "openstack/keystone",
|
"name": "openstack/keystone",
|
||||||
"version_requirement": ">=16.3.0 <17.0.0"
|
"version_requirement": ">=16.3.0 <17.0.0"
|
||||||
|
@ -7,19 +7,19 @@ describe 'mistral::db::mysql' do
|
|||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:password => 'fooboozoo_default_password',
|
:password => 'mistralpass',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'mistral::db::mysql' do
|
shared_examples 'mistral::db::mysql' do
|
||||||
context 'with only required params' do
|
context 'with only required params' do
|
||||||
it { should contain_openstacklib__db__mysql('mistral').with(
|
it { should contain_openstacklib__db__mysql('mistral').with(
|
||||||
:user => 'mistral',
|
:user => 'mistral',
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
:password => 'mistralpass',
|
||||||
:dbname => 'mistral',
|
:dbname => 'mistral',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ describe 'mistral::db::postgresql' do
|
|||||||
|
|
||||||
shared_examples_for 'mistral::db::postgresql' do
|
shared_examples_for 'mistral::db::postgresql' do
|
||||||
let :req_params do
|
let :req_params do
|
||||||
{ :password => 'pw' }
|
{ :password => 'mistralpass' }
|
||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
@ -16,9 +16,12 @@ describe 'mistral::db::postgresql' do
|
|||||||
req_params
|
req_params
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_postgresql__server__db('mistral').with(
|
it { is_expected.to contain_openstacklib__db__postgresql('mistral').with(
|
||||||
:user => 'mistral',
|
:user => 'mistral',
|
||||||
:password => 'md56cc4a9db977897a441d3a498a5d94fce'
|
:password => 'mistralpass',
|
||||||
|
:dbname => 'mistral',
|
||||||
|
:encoding => nil,
|
||||||
|
:privileges => 'ALL',
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user