Skip to content

Commit

Permalink
Update cinder to 8cc6d0e60ee6d9d0c1ebcf3523b07c3024c47064
Browse files Browse the repository at this point in the history
8cc6d0e60ee6d9d0c1ebcf3523b07c3024c47064 Merge "Adds ability to override service name for service catalog"
e7830879336d5cae338567e41f121ee15628b9ac Adds ability to override service name for service catalog
abdc513f32476ba8f7cf7696529befd8bcfca3be Merge "Don't add a new line if the rbd_user changes"
3641ea9547e2ba9fb5107e160e76b57d576a5cb3 Don't add a new line if the rbd_user changes

Signed-off-by: Gael Chamoulaud <[email protected]>
  • Loading branch information
strider committed Feb 19, 2015
1 parent 1f7a020 commit dae89d0
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod 'certmonger',
:git => 'https://github.com/rcritten/puppet-certmonger.git'

mod 'cinder',
:commit => 'd120750c1dd000411fd41b0fe9bcb3d6e47aa877',
:commit => '8cc6d0e60ee6d9d0c1ebcf3523b07c3024c47064',
:git => 'https://github.com/stackforge/puppet-cinder.git'

mod 'common',
Expand Down
3 changes: 3 additions & 0 deletions cinder/manifests/backend/rbd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@
case $::osfamily {
'Debian': {
$override_line = "env CEPH_ARGS=\"--id ${rbd_user}\""
$override_match = '^env CEPH_ARGS='
}
'RedHat': {
$override_line = "export CEPH_ARGS=\"--id ${rbd_user}\""
$override_match = '^export CEPH_ARGS='
}
default: {
fail("unsuported osfamily ${::osfamily}, currently Debian and Redhat are the only supported platforms")
Expand All @@ -91,6 +93,7 @@
ensure_resource('file_line', 'set initscript env', {
line => $override_line,
path => $::cinder::params::ceph_init_override,
match => $override_match,
notify => Service['cinder-volume']
})

Expand Down
36 changes: 31 additions & 5 deletions cinder/manifests/keystone/auth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Username for Cinder service. Optional. Defaults to 'cinder'.
#
# [*auth_name_v2*]
# Username for Cinder v2 service. Optional. Defaults to 'cinder2'.
# Username for Cinder v2 service. Optional. Defaults to 'cinderv2'.
#
# [*configure_endpoint*]
# Should Cinder endpoint be configured? Optional. Defaults to 'true'.
Expand All @@ -30,6 +30,16 @@
# Should the admin role be configured for the service user?
# Optional. Defaults to 'true'.
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name, but must differ from the value
# of service_name_v2.
#
# [*service_name_v2*]
# (optional) Name of the v2 service.
# Defaults to the value of auth_name_v2, but must differ from the value
# of service_name.
#
# [*service_type*]
# Type of service. Optional. Defaults to 'volume'.
#
Expand Down Expand Up @@ -76,6 +86,8 @@
$configure_endpoint_v2 = true,
$configure_user = true,
$configure_user_role = true,
$service_name = undef,
$service_name_v2 = undef,
$service_type = 'volume',
$service_type_v2 = 'volumev2',
$public_address = '127.0.0.1',
Expand All @@ -88,15 +100,29 @@
$admin_protocol = 'http',
$internal_protocol = 'http'
) {
if $service_name {
$real_service_name = $service_name
} else {
$real_service_name = $auth_name
}
if $service_name_v2 {
$real_service_name_v2 = $service_name_v2
} else {
$real_service_name_v2 = $auth_name_v2
}

keystone::resource::service_identity { $auth_name:
if $real_service_name == $real_service_name_v2 {
fail('cinder::keystone::auth parameters service_name and service_name_v2 must be different.')
}
keystone::resource::service_identity { 'cinder':
configure_user => $configure_user,
configure_user_role => $configure_user_role,
configure_endpoint => $configure_endpoint,
service_type => $service_type,
service_description => 'Cinder Service',
service_name => $auth_name,
service_name => $real_service_name,
region => $region,
auth_name => $auth_name,
password => $password,
email => $email,
tenant => $tenant,
Expand All @@ -105,13 +131,13 @@
internal_url => "${internal_protocol}://${internal_address}:${port}/${volume_version}/%(tenant_id)s",
}

keystone::resource::service_identity { $auth_name_v2:
keystone::resource::service_identity { 'cinderv2':
configure_user => false,
configure_user_role => false,
configure_endpoint => $configure_endpoint_v2,
service_type => $service_type_v2,
service_description => 'Cinder Service v2',
service_name => $auth_name_v2,
service_name => $real_service_name_v2,
region => $region,
public_url => "${public_protocol}://${public_address}:${port}/v2/%(tenant_id)s",
admin_url => "${admin_protocol}://${admin_address}:${port}/v2/%(tenant_id)s",
Expand Down
18 changes: 18 additions & 0 deletions cinder/spec/classes/cinder_keystone_auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,22 @@

end

describe 'when overriding service names' do

let :params do
req_params.merge(
:service_name => 'cinder_service',
:service_name_v2 => 'cinder_service_v2',
)
end

it { should contain_keystone_user('cinder') }
it { should contain_keystone_user_role('cinder@services') }
it { should contain_keystone_service('cinder_service') }
it { should contain_keystone_service('cinder_service_v2') }
it { should contain_keystone_endpoint('RegionOne/cinder_service') }
it { should contain_keystone_endpoint('RegionOne/cinder_service_v2') }

end

end

0 comments on commit dae89d0

Please sign in to comment.