Make service name and type configurable

Change-Id: I3176bd266a89506db52ed9469c3aa68ce6839da2
Closes-Bug: #1452555
This commit is contained in:
Masaki Matsushita 2015-05-07 13:41:12 +09:00
parent b4ae9f3dec
commit 12d1c1ab83
4 changed files with 29 additions and 4 deletions

View File

@ -94,6 +94,8 @@ Cinder attributes
* `openstack["block-storage"]["service_tenant_name"]` - name of tenant to use for the cinder service account in keystone
* `openstack["block-storage"]["service_user"]` - cinder service user in keystone
* `openstack["block-storage"]["service_role"]` - role for the cinder service user in keystone
* `openstack["block-storage"]["service_name"]` - Cinder Volume Service name in keystone, cinder for V1 and cinderv2 for v2.
* `openstack["block-storage"]["service_type"]` - Cinder Volume Service type in keystone, volume for V1 and volumev2 for v2.
* `openstack["block-storage"]["notification_driver"]` - Set the notification driver to be used (default to cinder.openstack.common.notifier.rpc_notifier)
* `openstack["block-storage"]["syslog"]["use"]`
* `openstack["block-storage"]["syslog"]["facility"]`

View File

@ -130,6 +130,8 @@ end
default['openstack']['block-storage']['service_tenant_name'] = 'service'
default['openstack']['block-storage']['service_user'] = 'cinder'
default['openstack']['block-storage']['service_role'] = 'service'
default['openstack']['block-storage']['service_name'] = 'cinderv2'
default['openstack']['block-storage']['service_type'] = 'volumev2'
# SAN Support
default['openstack']['block-storage']['san']['san_ip'] = '127.0.0.1'

View File

@ -37,6 +37,8 @@ region = node['openstack']['block-storage']['region']
service_tenant_name = node['openstack']['block-storage']['service_tenant_name']
service_user = node['openstack']['block-storage']['service_user']
service_role = node['openstack']['block-storage']['service_role']
service_name = node['openstack']['block-storage']['service_name']
service_type = node['openstack']['block-storage']['service_type']
openstack_identity_register 'Register Service Tenant' do
auth_uri auth_uri
@ -50,8 +52,8 @@ end
openstack_identity_register 'Register Cinder V2 Volume Service' do
auth_uri auth_uri
bootstrap_token bootstrap_token
service_name 'cinderv2'
service_type 'volumev2'
service_name service_name
service_type service_type
service_description 'Cinder Volume Service V2'
endpoint_region region
endpoint_adminurl ::URI.decode admin_cinder_api_endpoint.to_s
@ -63,8 +65,8 @@ end
openstack_identity_register 'Register Cinder V2 Volume Endpoint' do
auth_uri auth_uri
bootstrap_token bootstrap_token
service_name 'cinderv2'
service_type 'volumev2'
service_name service_name
service_type service_type
service_description 'Cinder Volume Service V2'
endpoint_region region
endpoint_adminurl ::URI.decode admin_cinder_api_endpoint.to_s

View File

@ -152,6 +152,25 @@ describe 'openstack-block-storage::identity_registration' do
)
end
it 'with different service type/name' do
node.set['openstack']['block-storage']['service_name'] = 'cinder'
node.set['openstack']['block-storage']['service_type'] = 'volume'
expect(chef_run).to create_endpoint_openstack_identity_register(
'Register Cinder V2 Volume Endpoint'
).with(
auth_uri: 'http://127.0.0.1:35357/v2.0',
bootstrap_token: 'bootstrap-token',
service_name: 'cinder',
service_type: 'volume',
service_description: 'Cinder Volume Service V2',
endpoint_region: 'RegionOne',
endpoint_adminurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s',
endpoint_internalurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s',
endpoint_publicurl: 'http://127.0.0.1:8776/v2/%(tenant_id)s'
)
end
it 'with custom region override' do
node.set['openstack']['block-storage']['region'] = 'volumeRegion'
expect(chef_run).to create_endpoint_openstack_identity_register(