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: Ia379746038f028bef57cfa198f7fdc348647db18
This commit is contained in:
parent
185f16eb87
commit
9e30e74b9b
|
@ -51,7 +51,7 @@ class manila::db::mysql (
|
|||
|
||||
::openstacklib::db::mysql { 'manila':
|
||||
user => $user,
|
||||
password_hash => mysql::password($password),
|
||||
password => $password,
|
||||
dbname => $dbname,
|
||||
host => $host,
|
||||
charset => $charset,
|
||||
|
|
|
@ -35,11 +35,11 @@ class manila::db::postgresql(
|
|||
include manila::deps
|
||||
|
||||
::openstacklib::db::postgresql { 'manila':
|
||||
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['manila::db::begin']
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
"name": "puppet/rabbitmq",
|
||||
"version_requirement": ">=8.4.0 <11.0.0"
|
||||
},
|
||||
{
|
||||
"name": "puppetlabs/mysql",
|
||||
"version_requirement": ">=6.0.0 <11.0.0"
|
||||
},
|
||||
{
|
||||
"name": "puppetlabs/stdlib",
|
||||
"version_requirement": ">=5.0.0 <7.0.0"
|
||||
|
|
|
@ -3,8 +3,7 @@ require 'spec_helper'
|
|||
describe 'manila::db::mysql' do
|
||||
|
||||
let :req_params do
|
||||
{:password => 'pw',
|
||||
}
|
||||
{ :password => 'manilapass' }
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
|
@ -17,13 +16,14 @@ describe 'manila::db::mysql' do
|
|||
req_params
|
||||
end
|
||||
it { is_expected.to contain_openstacklib__db__mysql('manila').with(
|
||||
:user => 'manila',
|
||||
:password_hash => '*D821809F681A40A6E379B50D0463EFAE20BDD122',
|
||||
:host => '127.0.0.1',
|
||||
:charset => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
:user => 'manila',
|
||||
:password => 'manilapass',
|
||||
:host => '127.0.0.1',
|
||||
:charset => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
) }
|
||||
end
|
||||
|
||||
context "overriding allowed_hosts param to array" do
|
||||
let :params do
|
||||
{
|
||||
|
@ -31,8 +31,8 @@ describe 'manila::db::mysql' do
|
|||
:allowed_hosts => ['127.0.0.1','%']
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "overriding allowed_hosts param to string" do
|
||||
let :params do
|
||||
{
|
||||
|
@ -40,8 +40,8 @@ describe 'manila::db::mysql' do
|
|||
:allowed_hosts => '192.168.1.1'
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "overriding allowed_hosts param equals to host param " do
|
||||
let :params do
|
||||
{
|
||||
|
@ -49,7 +49,6 @@ describe 'manila::db::mysql' do
|
|||
:allowed_hosts => '127.0.0.1'
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ describe 'manila::db::postgresql' do
|
|||
|
||||
shared_examples_for 'manila::db::postgresql' do
|
||||
let :req_params do
|
||||
{ :password => 'pw' }
|
||||
{ :password => 'manilapass' }
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
|
@ -16,12 +16,14 @@ describe 'manila::db::postgresql' do
|
|||
req_params
|
||||
end
|
||||
|
||||
it { is_expected.to contain_postgresql__server__db('manila').with(
|
||||
:user => 'manila',
|
||||
:password => 'md5b15a47e3dd847f86827b328466426faf'
|
||||
it { is_expected.to contain_openstacklib__db__postgresql('manila').with(
|
||||
:user => 'manila',
|
||||
:password => 'manilapass',
|
||||
:dbname => 'manila',
|
||||
:encoding => nil,
|
||||
:privileges => 'ALL',
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue