Merge pull request #74 from fcharlier/fc/dispersion_with_tenant
Update swift::keystone::dispersion
This commit is contained in:
@@ -24,15 +24,19 @@
|
|||||||
|
|
||||||
class swift::keystone::dispersion(
|
class swift::keystone::dispersion(
|
||||||
$auth_user = 'dispersion',
|
$auth_user = 'dispersion',
|
||||||
$auth_pass = 'dispersion_password'
|
$auth_pass = 'dispersion_password',
|
||||||
|
$email = 'swift@localhost',
|
||||||
|
$tenant = 'services'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
keystone_user { $auth_user:
|
keystone_user { $auth_user:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
password => $auth_pass,
|
password => $auth_pass,
|
||||||
|
email => $email,
|
||||||
|
tenant => $tenant,
|
||||||
}
|
}
|
||||||
|
|
||||||
keystone_user_role { "${auth_user}@services":
|
keystone_user_role { "${auth_user}@${tenant}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
roles => 'admin',
|
roles => 'admin',
|
||||||
require => Keystone_user[$auth_user]
|
require => Keystone_user[$auth_user]
|
||||||
|
@@ -6,7 +6,9 @@ describe 'swift::keystone::dispersion' do
|
|||||||
|
|
||||||
it { should contain_keystone_user('dispersion').with(
|
it { should contain_keystone_user('dispersion').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:password => 'dispersion_password'
|
:password => 'dispersion_password',
|
||||||
|
:email => 'swift@localhost',
|
||||||
|
:tenant => 'services'
|
||||||
) }
|
) }
|
||||||
|
|
||||||
it { should contain_keystone_user_role('dispersion@services').with(
|
it { should contain_keystone_user_role('dispersion@services').with(
|
||||||
@@ -16,32 +18,25 @@ describe 'swift::keystone::dispersion' do
|
|||||||
) }
|
) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding password' do
|
describe 'when overriding parameters' do
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:auth_pass => 'foo'
|
:auth_user => 'bar',
|
||||||
|
:auth_pass => 'foo',
|
||||||
|
:email => 'bar@example.com',
|
||||||
|
:tenant => 'dummyTenant'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_keystone_user('dispersion').with(
|
it { should contain_keystone_user('bar').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:password => 'foo'
|
:password => 'foo',
|
||||||
|
:email => 'bar@example.com',
|
||||||
|
:tenant => 'dummyTenant'
|
||||||
) }
|
) }
|
||||||
|
|
||||||
end
|
it { should contain_keystone_user_role('bar@dummyTenant') }
|
||||||
|
|
||||||
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') }
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user