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: I7a1ef6c25871b993279413c6bbfbee38838eb4d9
This commit is contained in:
parent
76a880860f
commit
7244048a70
|
@ -46,7 +46,7 @@ class neutron::db::mysql (
|
||||||
|
|
||||||
::openstacklib::db::mysql { 'neutron':
|
::openstacklib::db::mysql { 'neutron':
|
||||||
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 neutron::db::postgresql(
|
||||||
include neutron::deps
|
include neutron::deps
|
||||||
|
|
||||||
::openstacklib::db::postgresql { 'neutron':
|
::openstacklib::db::postgresql { 'neutron':
|
||||||
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['neutron::db::begin']
|
Anchor['neutron::db::begin']
|
||||||
|
|
|
@ -9,10 +9,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/keystone",
|
"name": "openstack/keystone",
|
||||||
"version_requirement": ">=16.3.0 <17.0.0"
|
"version_requirement": ">=16.3.0 <17.0.0"
|
||||||
|
|
|
@ -7,32 +7,32 @@ describe 'neutron::db::mysql' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:password => 'passw0rd',
|
:password => 'neutronpass',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'neutron::db::mysql' do
|
shared_examples 'neutron::db::mysql' do
|
||||||
context 'with only required params' do
|
context 'with only required params' do
|
||||||
it { should contain_openstacklib__db__mysql('neutron').with(
|
it { should contain_openstacklib__db__mysql('neutron').with(
|
||||||
:user => 'neutron',
|
:user => 'neutron',
|
||||||
:password_hash => '*74B1C21ACE0C2D6B0678A5E503D2A60E8F9651A3',
|
:password => 'neutronpass',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "overriding allowed_hosts param to array" do
|
context "overriding allowed_hosts param to array" do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:password => 'neutronpass',
|
:password => 'neutronpass',
|
||||||
:allowed_hosts => ['127.0.0.1','%'],
|
:allowed_hosts => ['127.0.0.1','%'],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_openstacklib__db__mysql('neutron').with(
|
it { should contain_openstacklib__db__mysql('neutron').with(
|
||||||
:user => 'neutron',
|
:user => 'neutron',
|
||||||
:password_hash => '*E7D4FEBBE0A141B5E4B413EAF85CCB49746A2497',
|
:password => 'neutronpass',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
|
@ -43,14 +43,14 @@ describe 'neutron::db::mysql' do
|
||||||
context "overriding allowed_hosts param to string" do
|
context "overriding allowed_hosts param to string" do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:password => 'neutronpass2',
|
:password => 'neutronpass2',
|
||||||
:allowed_hosts => '192.168.1.1',
|
:allowed_hosts => '192.168.1.1',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_openstacklib__db__mysql('neutron').with(
|
it { should contain_openstacklib__db__mysql('neutron').with(
|
||||||
:user => 'neutron',
|
:user => 'neutron',
|
||||||
:password_hash => '*32C4202C8C2D4430442B55CCA765BD47D5D2E1A2',
|
:password => 'neutronpass2',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
|
@ -61,14 +61,14 @@ describe 'neutron::db::mysql' do
|
||||||
context "overriding allowed_hosts param equals to host param " do
|
context "overriding allowed_hosts param equals to host param " do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:password => 'neutronpass2',
|
:password => 'neutronpass2',
|
||||||
:allowed_hosts => '127.0.0.1',
|
:allowed_hosts => '127.0.0.1',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_openstacklib__db__mysql('neutron').with(
|
it { should contain_openstacklib__db__mysql('neutron').with(
|
||||||
:user => 'neutron',
|
:user => 'neutron',
|
||||||
:password_hash => '*32C4202C8C2D4430442B55CCA765BD47D5D2E1A2',
|
:password => 'neutronpass2',
|
||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:charset => 'utf8',
|
:charset => 'utf8',
|
||||||
:collate => 'utf8_general_ci',
|
:collate => 'utf8_general_ci',
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
||||||
describe 'neutron::db::postgresql' do
|
describe 'neutron::db::postgresql' do
|
||||||
shared_examples 'neutron::db::postgresql' do
|
shared_examples 'neutron::db::postgresql' do
|
||||||
let :req_params do
|
let :req_params do
|
||||||
{ :password => 'pw' }
|
{ :password => 'neutronpass' }
|
||||||
end
|
end
|
||||||
|
|
||||||
let :pre_condition do
|
let :pre_condition do
|
||||||
|
@ -15,9 +15,12 @@ describe 'neutron::db::postgresql' do
|
||||||
req_params
|
req_params
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_postgresql__server__db('neutron').with(
|
it { is_expected.to contain_openstacklib__db__postgresql('neutron').with(
|
||||||
:user => 'neutron',
|
:user => 'neutron',
|
||||||
:password => 'md5696acd1dd66513a556a18a1beccd03d1'
|
:password => 'neutronpass',
|
||||||
|
:dbname => 'neutron',
|
||||||
|
:encoding => nil,
|
||||||
|
:privileges => 'ALL',
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue