From 2a845da2944cb0a33e2f411c22be12f866b60a4f Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 5 Sep 2014 18:42:04 -0400 Subject: [PATCH] Allow setting reseller_prefix for keystone filter When using keystone, it's possible to modify the behaviour to use a different prefix instead of the default AUTH_. This patch allows you to be able to set that option when declaring your class definition. Change-Id: I11ff23d118e0f3d1792b43e1dc7a2c82c6826427 --- manifests/proxy/keystone.pp | 3 ++- spec/classes/swift_proxy_keystone_spec.rb | 7 +++++-- templates/proxy/keystone.conf.erb | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/manifests/proxy/keystone.pp b/manifests/proxy/keystone.pp index 7b9dca88..da57dce7 100644 --- a/manifests/proxy/keystone.pp +++ b/manifests/proxy/keystone.pp @@ -19,7 +19,8 @@ class swift::proxy::keystone( $operator_roles = ['admin', 'SwiftOperator'], - $is_admin = true + $is_admin = true, + $reseller_prefix = 'AUTH_' ) { concat::fragment { 'swift_keystone': diff --git a/spec/classes/swift_proxy_keystone_spec.rb b/spec/classes/swift_proxy_keystone_spec.rb index 56f7a42b..ec3a4edf 100644 --- a/spec/classes/swift_proxy_keystone_spec.rb +++ b/spec/classes/swift_proxy_keystone_spec.rb @@ -27,6 +27,7 @@ describe 'swift::proxy::keystone' do it { should contain_file(fragment_file).with_content(/operator_roles = admin, SwiftOperator/) } it { should contain_file(fragment_file).with_content(/is_admin = true/) } + it { should contain_file(fragment_file).with_content(/reseller_prefix = AUTH_/) } end @@ -34,12 +35,14 @@ describe 'swift::proxy::keystone' do let :params do { - :operator_roles => 'foo', - :is_admin => 'false', + :operator_roles => 'foo', + :is_admin => 'false', + :reseller_prefix => 'SWIFT_' } it { should contain_file(fragment_file).with_content(/operator_roles = foo/) } it { should contain_file(fragment_file).with_content(/is_admin = false/) } + it { should contain_file(fragment_file).with_content(/reseller_prefix = SWIFT_/) } end diff --git a/templates/proxy/keystone.conf.erb b/templates/proxy/keystone.conf.erb index 661dee45..15c01cd6 100644 --- a/templates/proxy/keystone.conf.erb +++ b/templates/proxy/keystone.conf.erb @@ -3,3 +3,4 @@ use = egg:swift#keystoneauth operator_roles = <%= @operator_roles.to_a.join(', ') %> is_admin = <%= @is_admin %> +reseller_prefix = <%= @reseller_prefix %>