Add system/project reader roles parameters
Change-Id: I34640f6245ad94d32c0a8eba46bf5ffc5e2efb81
This commit is contained in:
parent
787a87d24f
commit
969babc71e
@ -20,6 +20,18 @@
|
||||
# (Optional)
|
||||
# Defaults to Undef.
|
||||
#
|
||||
# [*project_reader_roles*]
|
||||
# Project reader roles are similar to account owners, but are not
|
||||
# allowed to write any data.
|
||||
# (Optional)
|
||||
# Default to $::os_service_default
|
||||
#
|
||||
# [*system_reader_roles*]
|
||||
# System reader roles are similar to reseller_admin_roles, but are not
|
||||
# allowed to write any data.
|
||||
# (Optional)
|
||||
# Default to $::os_service_default
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
# Dan Bode dan@puppetlabs.com
|
||||
@ -29,6 +41,8 @@ class swift::proxy::keystone(
|
||||
$operator_roles = ['admin', 'SwiftOperator'],
|
||||
$reseller_prefix = 'AUTH_',
|
||||
$reseller_admin_role = undef,
|
||||
$project_reader_roles = $::os_service_default,
|
||||
$system_reader_roles = $::os_service_default,
|
||||
) {
|
||||
|
||||
include swift::deps
|
||||
@ -38,5 +52,7 @@ class swift::proxy::keystone(
|
||||
'filter:keystone/operator_roles': value => join(any2array($operator_roles), ', ');
|
||||
'filter:keystone/reseller_prefix': value => $reseller_prefix;
|
||||
'filter:keystone/reseller_admin_role': value => $reseller_admin_role;
|
||||
'filter:keystone/project_reader_roles': value => join(any2array($project_reader_roles), ', ');
|
||||
'filter:keystone/system_reader_roles': value => join(any2array($system_reader_roles), ', ');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Adds new parameters to set system and project reader role configs in Swift.
|
@ -7,6 +7,8 @@ describe 'swift::proxy::keystone' do
|
||||
describe 'with defaults' do
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/operator_roles').with_value('admin, SwiftOperator') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_prefix').with_value('AUTH_') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/project_reader_roles').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/system_reader_roles').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
describe 'with parameter overrides' do
|
||||
@ -14,12 +16,16 @@ describe 'swift::proxy::keystone' do
|
||||
{
|
||||
:operator_roles => 'foo',
|
||||
:reseller_prefix => 'SWIFT_',
|
||||
:reseller_admin_role => 'ResellerAdmin'
|
||||
:reseller_admin_role => 'ResellerAdmin',
|
||||
:project_reader_roles => ['SwiftProjectReader'],
|
||||
:system_reader_roles => ['SwiftSystemReader'],
|
||||
}
|
||||
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/operator_roles').with_value('foo') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_prefix').with_value('SWIFT_') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/reseller_admin_role').with_value('ResellerAdmin') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/project_reader_roles').with_value('SwiftProjectReader') }
|
||||
it { is_expected.to contain_swift_proxy_config('filter:keystone/system_reader_roles').with_value('SwiftSystemReader') }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user