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': ::openstacklib::db::mysql { 'glare':
user => $user, user => $user,
password_hash => mysql::password($password), password => $password,
dbname => $dbname, dbname => $dbname,
host => $host, host => $host,
charset => $charset, charset => $charset,

View File

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

View File

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

View File

@ -7,22 +7,22 @@ describe 'glare::db::mysql' do
end end
let :required_params do let :required_params do
{ :password => 'fooboozoo_default_password', } { :password => 'glarepass', }
end end
shared_examples_for 'glare-db-mysql' do shared_examples_for 'glare::db::mysql' do
context 'with only required params' do context 'with only required params' do
let :params do let :params do
required_params required_params
end end
it { is_expected.to contain_openstacklib__db__mysql('glare').with( it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare', :user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206', :password => 'glarepass',
:dbname => 'glare', :dbname => 'glare',
: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 'glare::db::mysql' do
end end
it { is_expected.to contain_openstacklib__db__mysql('glare').with( it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare', :user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206', :password => 'glarepass',
:dbname => 'glare', :dbname => 'glare',
: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 'glare::db::mysql' do
end end
it { is_expected.to contain_openstacklib__db__mysql('glare').with( it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare', :user => 'glare',
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206', :password => 'glarepass',
:dbname => 'glare', :dbname => 'glare',
: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
@ -67,7 +67,7 @@ describe 'glare::db::mysql' do
facts.merge!(OSDefaults.get_facts()) facts.merge!(OSDefaults.get_facts())
end end
it_behaves_like 'glare-db-mysql' it_behaves_like 'glare::db::mysql'
end end
end end
end end

View File

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