Add configuration for swift auth in controller

The openstack::keystone class already supports the
ability to configure authorization for swift, but
it was not possible to set this configuration
in the openstack::controller class.

This commits adds two parameters to openstack::controller:
  - swift - Indicates that swift auth should be configured in keystone
  - swift_user_password - password to use for swift user in keystone

These commits allow swift to be configured together with this
controller class.

Change-Id: I93455da30786d41ae6e56b32f53f30fa57852df0
This commit is contained in:
bodepd
2013-06-24 13:05:44 -07:00
committed by Gerrit Code Review
parent 75723ff7c4
commit 5108cb3a75
3 changed files with 42 additions and 10 deletions

View File

@@ -63,6 +63,13 @@
# [horizon_app_links] array as in '[ ["Nagios","http://nagios_addr:port/path"],["Ganglia","http://ganglia_addr"] ]'
# [enabled] Whether services should be enabled. This parameter can be used to
# implement services in active-passive modes for HA. Optional. Defaults to true.
# [swift]
# Whether or not to configure keystone for swift authorization.
# (Optional). Defaults to false.
#
# [swift_user_password]
# Auth password for swift.
# (Optional) Defaults to false. Required if swift is set to true.
#
# === Examples
#
@@ -101,6 +108,7 @@ class openstack::controller (
$quantum_db_password = false,
$cinder_user_password = false,
$cinder_db_password = false,
$swift_user_password = false,
# Database
$db_host = '127.0.0.1',
$db_type = 'mysql',
@@ -178,6 +186,8 @@ class openstack::controller (
$quantum_auth_url = 'http://127.0.0.1:35357/v2.0',
$enable_quantum_server = true,
$ovs_local_ip = false,
# swift
$swift = false,
$enabled = true
) {
@@ -264,6 +274,8 @@ class openstack::controller (
cinder_user_password => $cinder_user_password,
quantum => $quantum,
quantum_user_password => $quantum_user_password,
swift => $swift,
swift_user_password => $swift_user_password,
enabled => $enabled,
bind_host => $keystone_bind_address,
}

View File

@@ -24,6 +24,9 @@
# [glance] Set up glance endpoints and auth. Optional. Defaults to true
# [nova] Set up nova endpoints and auth. Optional. Defaults to true
# [swift] Set up swift endpoints and auth. Optional. Defaults to false
# [swift_user_password]
# Auth password for swift.
# (Optional) Defaults to false.
# [enabled] If the service is active (true) or passive (false).
# Optional. Defaults to true
#

View File

@@ -175,16 +175,22 @@ describe 'openstack::controller' do
default_params
end
it { should contain_class('keystone').with(
:verbose => 'False',
:debug => 'False',
:catalog_type => 'sql',
:enabled => true,
:admin_token => 'keystone_admin_token',
:sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone"
) }
it 'should configure default keystone configuration' do
should contain_class('openstack::keystone').with(
:swift => false,
:swift_user_password => false
)
should contain_class('keystone').with(
:verbose => 'False',
:debug => 'False',
:catalog_type => 'sql',
:enabled => true,
:admin_token => 'keystone_admin_token',
:sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone"
)
it 'should contain endpoints' do
should contain_class('keystone::roles::admin').with(
:email => 'some_user@some_fake_email_address.foo',
:password => 'ChangeMe',
@@ -209,7 +215,18 @@ describe 'openstack::controller' do
:admin_address => '10.0.0.1',
:region => 'RegionOne'
)
end
end
end
context 'when configuring swift' do
before :each do
params.merge!(:swift => true, :swift_user_password => 'foo')
end
it 'should configure swift auth in keystone' do
should contain_class('openstack::keystone').with(
:swift => true,
:swift_user_password => 'foo'
)
end
end
end
context 'when not enabled' do