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: I96f0496889fe6fa349259689f2a46ac5e029c46d
This commit is contained in:
parent
cc5c2e5198
commit
ce663a7718
@ -49,7 +49,7 @@ class watcher::db::mysql(
|
|||||||
|
|
||||||
::openstacklib::db::mysql { 'watcher':
|
::openstacklib::db::mysql { 'watcher':
|
||||||
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 watcher::db::postgresql(
|
|||||||
include watcher::deps
|
include watcher::deps
|
||||||
|
|
||||||
::openstacklib::db::postgresql { 'watcher':
|
::openstacklib::db::postgresql { 'watcher':
|
||||||
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['watcher::db::begin']
|
Anchor['watcher::db::begin']
|
||||||
|
@ -13,10 +13,6 @@
|
|||||||
"name": "puppet/rabbitmq",
|
"name": "puppet/rabbitmq",
|
||||||
"version_requirement": ">=8.4.0 <11.0.0"
|
"version_requirement": ">=8.4.0 <11.0.0"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "puppetlabs/mysql",
|
|
||||||
"version_requirement": ">=6.0.0 <11.0.0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "openstack/openstacklib",
|
"name": "openstack/openstacklib",
|
||||||
"version_requirement": ">=16.3.0 <17.0.0"
|
"version_requirement": ">=16.3.0 <17.0.0"
|
||||||
|
@ -7,7 +7,7 @@ describe 'watcher::db::mysql' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let :required_params do
|
let :required_params do
|
||||||
{ :password => 'fooboozoo_default_password', }
|
{ :password => 'watcherpass', }
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'watcher-db-mysql' do
|
shared_examples_for 'watcher-db-mysql' do
|
||||||
@ -17,12 +17,12 @@ describe 'watcher::db::mysql' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
||||||
:user => 'watcher',
|
:user => 'watcher',
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
:password => 'watcherpass',
|
||||||
:dbname => 'watcher',
|
:dbname => 'watcher',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,13 +32,13 @@ describe 'watcher::db::mysql' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
||||||
:user => 'watcher',
|
:user => 'watcher',
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
:password => 'watcherpass',
|
||||||
:dbname => 'watcher',
|
:dbname => 'watcher',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
:allowed_hosts => ['127.0.0.1','%']
|
:allowed_hosts => ['127.0.0.1','%']
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -48,13 +48,13 @@ describe 'watcher::db::mysql' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
it { is_expected.to contain_openstacklib__db__mysql('watcher').with(
|
||||||
:user => 'watcher',
|
:user => 'watcher',
|
||||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
:password => 'watcherpass',
|
||||||
:dbname => 'watcher',
|
:dbname => 'watcher',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
:allowed_hosts => '192.168.1.1'
|
:allowed_hosts => '192.168.1.1'
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@ describe 'watcher::db::postgresql' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let :required_params do
|
let :required_params do
|
||||||
{ :password => 'pw' }
|
{ :password => 'watcherpass' }
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'watcher-db-postgresql' do
|
shared_examples_for 'watcher-db-postgresql' do
|
||||||
@ -16,9 +16,12 @@ describe 'watcher::db::postgresql' do
|
|||||||
required_params
|
required_params
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_postgresql__server__db('watcher').with(
|
it { is_expected.to contain_openstacklib__db__postgresql('watcher').with(
|
||||||
:user => 'watcher',
|
:user => 'watcher',
|
||||||
:password => 'md5bb8678c96047fcce9b899ad5da021642'
|
:password => 'watcherpass',
|
||||||
|
:dbname => 'watcher',
|
||||||
|
:encoding => nil,
|
||||||
|
:privileges => 'ALL',
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user