Update swift::keystone::dispersion

• Use the new keystone_user & keystone_user_role parameters
• Add email & tenant parameters
This commit is contained in:
François Charlier 2012-11-21 20:15:53 +01:00
parent a6f98ad3e3
commit b885ed7488
2 changed files with 19 additions and 20 deletions

View File

@ -24,15 +24,19 @@
class swift::keystone::dispersion(
$auth_user = 'dispersion',
$auth_pass = 'dispersion_password'
$auth_pass = 'dispersion_password',
$email = 'swift@localhost',
$tenant = 'services',
) {
keystone_user { $auth_user:
ensure => present,
password => $auth_pass,
email => $email,
tenant => $tenant,
}
keystone_user_role { "${auth_user}@services":
keystone_user_role { "${auth_user}@${tenant}":
ensure => present,
roles => 'admin',
require => Keystone_user[$auth_user]

View File

@ -6,7 +6,9 @@ describe 'swift::keystone::dispersion' do
it { should contain_keystone_user('dispersion').with(
:ensure => 'present',
:password => 'dispersion_password'
:password => 'dispersion_password',
:email => 'swift@localhost',
:tenant => 'services'
) }
it { should contain_keystone_user_role('dispersion@services').with(
@ -16,32 +18,25 @@ describe 'swift::keystone::dispersion' do
) }
end
describe 'when overriding password' do
describe 'when overriding parameters' do
let :params do
{
:auth_pass => 'foo'
:auth_user => 'bar',
:auth_pass => 'foo',
:email => 'bar@example.com',
:tenant => 'dummyTenant'
}
end
it { should contain_keystone_user('dispersion').with(
it { should contain_keystone_user('bar').with(
:ensure => 'present',
:password => 'foo'
:password => 'foo',
:email => 'bar@example.com',
:tenant => 'dummyTenant'
) }
end
describe 'when overriding auth user' do
let :params do
{
:auth_user => 'bar'
}
end
it { should contain_keystone_user('bar') }
it { should contain_keystone_user_role('bar@services') }
it { should contain_keystone_user_role('bar@dummyTenant') }
end