Skip to content

Commit

Permalink
Merge pull request #264 from strider/openstack-pm-update-master
Browse files Browse the repository at this point in the history
Update only Puppet Modules from Stackforge (Master)
  • Loading branch information
paramite committed Feb 26, 2015
2 parents 1f7a020 + 91a9e71 commit ca2e745
Show file tree
Hide file tree
Showing 132 changed files with 1,424 additions and 427 deletions.
24 changes: 12 additions & 12 deletions 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 All @@ -35,7 +35,7 @@ mod 'galera',
:git => 'https://github.com/redhat-openstack/puppet-galera.git'

mod 'glance',
:commit => '553d098745bdbe4d22fba7eef6978444fee258fe',
:commit => '9a4568c3610d96ab0fe8543b133b317aca801b76',
:git => 'https://github.com/stackforge/puppet-glance.git'

mod 'gluster',
Expand All @@ -51,11 +51,11 @@ mod 'haproxy',
:git => 'https://github.com/puppetlabs/puppetlabs-haproxy.git'

mod 'heat',
:commit => '511c3dbf303acb6042cc4b20d68858a67ce69c97',
:commit => 'a0e1f3ab69995b7183e8eb3532e5c0acb80adfca',
:git => 'https://github.com/stackforge/puppet-heat.git'

mod 'horizon',
:commit => '1c31420b4a444443eba2d9d1710b1200d905ccdf',
:commit => '915f0741adcd4becfa2f5156203a5c06a6cc62d6',
:git => 'https://github.com/stackforge/puppet-horizon.git'

mod 'inifile',
Expand All @@ -67,11 +67,11 @@ mod 'ipa',
:git => 'https://github.com/xbezdick/puppet-ipa-1.git'

mod 'ironic',
:commit => '2edcdcfbcc02e868982f2158d13a75037f8c702e',
:commit => '6733465482dc092486ee7d9227e9068fee506d6b',
:git => 'https://github.com/stackforge/puppet-ironic.git'

mod 'keystone',
:commit => '36e4c8861803c7b698a3f36612fffeb1614646d1',
:commit => '6b0e35989aa380fc5c2c363de9d8512086f0c260',
:git => 'https://github.com/stackforge/puppet-keystone.git'

mod 'manila',
Expand Down Expand Up @@ -107,11 +107,11 @@ mod 'nagios',
:git => 'https://github.com/gildub/puppet-nagios-openstack.git'

mod 'neutron',
:commit => 'b561004004b62488a5cdbaf8dd45c4ef522c68c6',
:commit => 'ba0eb6f2f6db6b4a9d455a3ea54150ccc8020be7',
:git => 'https://github.com/stackforge/puppet-neutron.git'

mod 'nova',
:commit => 'f0227c71b1b9694560fcf845fa2b47d4eeee8b05',
:commit => '00e744a9b1568ab832fd46203baa83575dcf94ec',
:git => 'https://github.com/stackforge/puppet-nova.git'

mod 'nssdb',
Expand All @@ -127,7 +127,7 @@ mod 'openstack_extras',
:git => 'https://github.com/stackforge/puppet-openstack_extras.git'

mod 'openstacklib',
:commit => 'b7d3c8eaaf47ffbddb50cd942f8654e1aa8fe2f2',
:commit => '83320443dfd08fc2e4ffbdb0c90da9db17a214fb',
:git => 'https://github.com/stackforge/puppet-openstacklib.git'

mod 'pacemaker',
Expand Down Expand Up @@ -175,15 +175,15 @@ mod 'stdlib',
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git'

mod 'swift',
:commit => '2c61fd3187b2f367aa4738bb8239933aec1ff883',
:commit => '0d40df78fe40b002380cb3c58ac22dc6ee8b913f',
:git => 'https://github.com/stackforge/puppet-swift.git'

mod 'sysctl',
:commit => 'c4486acc2d66de857dbccd8b4b945ea803226705',
:git => 'https://github.com/puppetlabs/puppetlabs-sysctl.git'

mod 'tempest',
:commit => '7a3369949fc8af41e190dd8115391354a7575ecb',
:commit => '48a850e38f7937e19b687f7a18c6b7d388ea1069',
:git => 'https://github.com/stackforge/puppet-tempest.git'

mod 'timezone',
Expand All @@ -195,7 +195,7 @@ mod 'tripleo',
:git => 'https://github.com/stackforge/puppet-tripleo.git'

mod 'trove',
:commit => 'c345e128c7fec585acf00b5a275a78cd1ae89f03',
:commit => 'c6d7addb151d572b5146d59898179434d1c2ba73',
:git => 'https://github.com/stackforge/puppet-trove'

mod 'vcsrepo',
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
12 changes: 11 additions & 1 deletion glance/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ source 'https://rubygems.org'

group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
gem 'rspec-puppet', '~> 1.0.1'
gem 'puppet-lint', '~> 1.1.0'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-trailing_newline-check'

# Puppet 4.x related lint checks
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-numericvariable'

gem 'rake', '10.1.1'
gem 'rspec', '< 2.99'
gem 'json'
Expand Down
92 changes: 66 additions & 26 deletions glance/manifests/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,36 @@
# (optional) Type is authorization being used.
# Defaults to 'keystone'
#
# [* auth_host*]
# (optional) Host running auth service.
# [*auth_host*]
# (optional) DEPRECATED Host running auth service.
# Defaults to '127.0.0.1'.
#
# [*auth_url*]
# (optional) Authentication URL.
# (optional) DEPRECATED Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [* auth_port*]
# (optional) Port to use for auth service on auth_host.
# [*auth_port*]
# (optional) DEPRECATED Port to use for auth service on auth_host.
# Defaults to '35357'.
#
# [* auth_uri*]
# [*auth_uri*]
# (optional) Complete public Identity API endpoint.
# Defaults to false.
#
# [*auth_admin_prefix*]
# (optional) Path part of the auth url.
# (optional) DEPRECATED Path part of the auth url.
# This allow admin auth URIs like http://auth_host:35357/keystone/admin.
# (where '/keystone/admin' is auth_admin_prefix)
# Defaults to false for empty. If defined, should be a string with a leading '/' and no trailing '/'.
#
# [* auth_protocol*]
# (optional) Protocol to use for auth.
# [*auth_protocol*]
# (optional) DEPRECATED Protocol to use for auth.
# Defaults to 'http'.
#
# [*identity_uri*]
# (optional) Complete admin Identity API endpoint.
# Defaults to: false
#
# [*pipeline*]
# (optional) Partial name of a pipeline in your paste configuration file with the
# service name removed.
Expand Down Expand Up @@ -192,12 +196,8 @@
$registry_port = '9191',
$registry_client_protocol = 'http',
$auth_type = 'keystone',
$auth_host = '127.0.0.1',
$auth_url = 'http://localhost:5000/v2.0',
$auth_port = '35357',
$auth_uri = false,
$auth_admin_prefix = false,
$auth_protocol = 'http',
$identity_uri = false,
$pipeline = 'keystone+cachemanagement',
$keystone_tenant = 'services',
$keystone_user = 'glance',
Expand All @@ -219,17 +219,26 @@
$validation_options = {},
# DEPRECATED PARAMETERS
$mysql_module = undef,
$auth_host = '127.0.0.1',
$auth_url = 'http://localhost:5000/v2.0',
$auth_port = '35357',
$auth_admin_prefix = false,
$auth_protocol = 'http',
) inherits glance {

include glance::policy
include ::glance::policy
require keystone::python

if $mysql_module {
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
}

if ( $glance::params::api_package_name != $glance::params::registry_package_name ) {
ensure_packages([$glance::params::api_package_name])
ensure_packages([$glance::params::api_package_name],
{
tag => ['openstack'],
}
)
}

Package[$glance::params::api_package_name] -> File['/etc/glance/']
Expand Down Expand Up @@ -315,26 +324,57 @@
'DEFAULT/registry_port': value => $registry_port;
}

if $identity_uri {
glance_api_config { 'keystone_authtoken/identity_uri': value => $identity_uri; }
} else {
glance_api_config { 'keystone_authtoken/identity_uri': ensure => absent; }
}

if $auth_uri {
glance_api_config { 'keystone_authtoken/auth_uri': value => $auth_uri; }
} else {
glance_api_config { 'keystone_authtoken/auth_uri': value => "${auth_protocol}://${auth_host}:5000/"; }
}

# auth config
glance_api_config {
'keystone_authtoken/auth_host': value => $auth_host;
'keystone_authtoken/auth_port': value => $auth_port;
'keystone_authtoken/auth_protocol': value => $auth_protocol;
}
# if both auth_uri and identity_uri are set we skip these deprecated settings entirely
if !$auth_uri or !$identity_uri {

if $auth_admin_prefix {
validate_re($auth_admin_prefix, '^(/.+[^/])?$')
glance_api_config {
'keystone_authtoken/auth_admin_prefix': value => $auth_admin_prefix;
if $auth_host {
warning('The auth_host parameter is deprecated. Please use auth_uri and identity_uri instead.')
glance_api_config { 'keystone_authtoken/auth_host': value => $auth_host; }
} else {
glance_api_config { 'keystone_authtoken/auth_host': ensure => absent; }
}

if $auth_port {
warning('The auth_port parameter is deprecated. Please use auth_uri and identity_uri instead.')
glance_api_config { 'keystone_authtoken/auth_port': value => $auth_port; }
} else {
glance_api_config { 'keystone_authtoken/auth_port': ensure => absent; }
}

if $auth_protocol {
warning('The auth_protocol parameter is deprecated. Please use auth_uri and identity_uri instead.')
glance_api_config { 'keystone_authtoken/auth_protocol': value => $auth_protocol; }
} else {
glance_api_config { 'keystone_authtoken/auth_protocol': ensure => absent; }
}

if $auth_admin_prefix {
warning('The auth_admin_prefix parameter is deprecated. Please use auth_uri and identity_uri instead.')
validate_re($auth_admin_prefix, '^(/.+[^/])?$')
glance_api_config {
'keystone_authtoken/auth_admin_prefix': value => $auth_admin_prefix;
}
} else {
glance_api_config { 'keystone_authtoken/auth_admin_prefix': ensure => absent; }
}

} else {
glance_api_config {
'keystone_authtoken/auth_host': ensure => absent;
'keystone_authtoken/auth_port': ensure => absent;
'keystone_authtoken/auth_protocol': ensure => absent;
'keystone_authtoken/auth_admin_prefix': ensure => absent;
}
}
Expand Down
Loading

0 comments on commit ca2e745

Please sign in to comment.