diff --git a/manifests/keystone/dispersion.pp b/manifests/keystone/dispersion.pp index 15ea2193..8bf2e040 100644 --- a/manifests/keystone/dispersion.pp +++ b/manifests/keystone/dispersion.pp @@ -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] diff --git a/spec/classes/swift_keystone_dispersion_spec.rb b/spec/classes/swift_keystone_dispersion_spec.rb index ff77817c..61d111b5 100644 --- a/spec/classes/swift_keystone_dispersion_spec.rb +++ b/spec/classes/swift_keystone_dispersion_spec.rb @@ -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