Merge "Remove password hash generation in each puppet modules"

This commit is contained in:
Zuul 2020-05-21 01:07:02 +00:00 committed by Gerrit Code Review
commit a89c1dc06b
5 changed files with 38 additions and 39 deletions

View File

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

View File

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

View File

@ -43,10 +43,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/openstacklib",
"version_requirement": ">=17.0.0 <18.0.0"

View File

@ -7,22 +7,22 @@ describe 'glare::db::mysql' do
end
let :required_params do
{ :password => 'fooboozoo_default_password', }
{ :password => 'glarepass', }
end
shared_examples_for 'glare-db-mysql' do
shared_examples_for 'glare::db::mysql' do
context 'with only required params' do
let :params do
required_params
end
it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
)}
end
@ -32,13 +32,13 @@ describe 'glare::db::mysql' do
end
it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%']
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%']
)}
end
@ -48,13 +48,13 @@ describe 'glare::db::mysql' do
end
it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1'
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1'
)}
end
end
@ -67,7 +67,7 @@ describe 'glare::db::mysql' do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'glare-db-mysql'
it_behaves_like 'glare::db::mysql'
end
end
end

View File

@ -7,18 +7,21 @@ describe 'glare::db::postgresql' do
end
let :required_params do
{ :password => 'pw' }
{ :password => 'glarepass' }
end
shared_examples_for 'glare-db-postgresql' do
shared_examples_for 'glare::db::postgresql' do
context 'with only required parameters' do
let :params do
required_params
end
it { is_expected.to contain_postgresql__server__db('glare').with(
:user => 'glare',
:password => 'md5000e10ee12052d5996f40620414c021a'
it { is_expected.to contain_openstacklib__db__postgresql('glare').with(
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:encoding => nil,
:privileges => 'ALL',
)}
end
end
@ -31,7 +34,7 @@ describe 'glare::db::postgresql' do
facts.merge!(OSDefaults.get_facts({ :concat_basedir => '/var/lib/puppet/concat' }))
end
it_behaves_like 'glare-db-postgresql'
it_behaves_like 'glare::db::postgresql'
end
end
end