From f7f2ef7d4548e125245b06c9aa30dfa476bf4ff6 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Fri, 10 May 2013 13:34:23 +0200 Subject: [PATCH] Make service tenant name configurable in keystone::roles::admin Though "services" seems to be a fairly common name for the service tenant, some people may prefer to use "service" or some other name. The puppet-glance module, and others, do allow overriding the service tenant name. Change-Id: I4764cbf21821db96fac93ea4abdaf7d14bd12771 --- manifests/roles/admin.pp | 7 ++++--- spec/classes/keystone_roles_admin_spec.rb | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/manifests/roles/admin.pp b/manifests/roles/admin.pp index 521d688c0..d937833a2 100644 --- a/manifests/roles/admin.pp +++ b/manifests/roles/admin.pp @@ -29,11 +29,12 @@ class keystone::roles::admin( $email, $password, - $admin = 'admin', - $admin_tenant = 'openstack' + $admin = 'admin', + $admin_tenant = 'openstack', + $service_tenant = 'services' ) { - keystone_tenant { 'services': + keystone_tenant { $service_tenant: ensure => present, enabled => 'True', description => 'Tenant for the openstack services', diff --git a/spec/classes/keystone_roles_admin_spec.rb b/spec/classes/keystone_roles_admin_spec.rb index f8b457146..82d75fb75 100644 --- a/spec/classes/keystone_roles_admin_spec.rb +++ b/spec/classes/keystone_roles_admin_spec.rb @@ -5,8 +5,9 @@ describe 'keystone::roles::admin' do let :params do { - :email => 'foo@bar', - :password => 'ChangeMe' + :email => 'foo@bar', + :password => 'ChangeMe', + :service_tenant => 'services' } end @@ -41,13 +42,19 @@ describe 'keystone::roles::admin' do let :params do { - :admin => 'admin', - :email => 'foo@baz', - :password => 'foo', - :admin_tenant => 'admin' + :admin => 'admin', + :email => 'foo@baz', + :password => 'foo', + :admin_tenant => 'admin', + :service_tenant => 'foobar' } end + it { should contain_keystone_tenant('foobar').with( + :ensure => 'present', + :enabled => 'True', + :description => 'Tenant for the openstack services' + )} it { should contain_keystone_tenant('admin').with( :ensure => 'present', :enabled => 'True',