Skip to content

Commit

Permalink
Merge pull request #289 from imcsk8/update-glance
Browse files Browse the repository at this point in the history
Automatic update
  • Loading branch information
EmilienM committed Jun 10, 2015
2 parents 41eeefb + ca66d2b commit f1a2bb3
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mod 'galera',
:git => 'https://github.com/redhat-openstack/puppet-galera.git'

mod 'glance',
:commit => 'c76d39605ff311eaba6ca226ac7dac19f86279ed',
:commit => '88b74f869aed0c3fd2fb4b27e0f3956991399414',
:git => 'https://github.com/stackforge/puppet-glance.git'

mod 'gluster',
Expand Down
1 change: 1 addition & 0 deletions glance/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', '~> 2.1.0', :require => false
gem 'minitest', '~> 4.7', :require => 'minitest/unit'

gem 'metadata-json-lint'
gem 'puppet-lint-param-docs'
Expand Down
6 changes: 6 additions & 0 deletions glance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@ Beaker-Rspec

This module has beaker-rspec tests

To run the tests on the default vagrant node:

To run:

```shell
bundle install
bundle exec rspec spec/acceptance
```

For more information on writing and running beaker-rspec tests visit the documentation:

* https://github.com/puppetlabs/beaker/wiki/How-to-Write-a-Beaker-Test-for-a-Module

Development
-----------

Expand Down
8 changes: 7 additions & 1 deletion glance/manifests/backend/swift.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ # == class: glance::backend::swift
# [*swift_store_create_container_on_put*]
# Optional. Default: 'False'
#
# [*swift_store_endpoint_type*]
# Optional. Default: 'internalURL'
#
class glance::backend::swift(
$swift_store_user,
$swift_store_key,
$swift_store_auth_address = '127.0.0.1:5000/v2.0/',
$swift_store_container = 'glance',
$swift_store_auth_version = '2',
$swift_store_large_object_size = '5120',
$swift_store_create_container_on_put = false
$swift_store_create_container_on_put = false,
$swift_store_endpoint_type = 'internalURL'
) {

glance_api_config {
Expand All @@ -47,6 +51,8 @@ # == class: glance::backend::swift
value => $swift_store_create_container_on_put;
'DEFAULT/swift_store_large_object_size':
value => $swift_store_large_object_size;
'glance_store/swift_store_endpoint_type':
value => $swift_store_endpoint_type;
}

glance_cache_config {
Expand Down
7 changes: 6 additions & 1 deletion glance/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class glance::params {

$client_package_name = 'python-glanceclient'
$pyceph_package_name = 'python-ceph'

$cache_cleaner_command = 'glance-cache-cleaner'
$cache_pruner_command = 'glance-cache-pruner'
Expand All @@ -15,13 +14,19 @@
$api_service_name = 'openstack-glance-api'
$registry_service_name = 'openstack-glance-registry'
$db_sync_command = 'glance-manage --config-file=/etc/glance/glance-registry.conf db_sync'
if ($::operatingsystem != 'fedora' and versioncmp($::operatingsystemrelease, '7') < 0) {
$pyceph_package_name = 'python-ceph'
} else {
$pyceph_package_name = 'python-rbd'
}
}
'Debian': {
$api_package_name = 'glance-api'
$registry_package_name = 'glance-registry'
$api_service_name = 'glance-api'
$registry_service_name = 'glance-registry'
$db_sync_command = 'glance-manage --config-file=/etc/glance/glance-registry.conf db_sync'
$pyceph_package_name = 'python-ceph'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,30 @@
case $::osfamily {
'Debian': {
include ::apt
# some packages are not autoupgraded in trusty.
# it will be fixed in liberty, but broken in kilo.
$need_to_be_upgraded = ['python-tz', 'python-pbr']
apt::source { 'trusty-updates-kilo':
location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu/',
release => 'trusty-updates',
required_packages => 'ubuntu-cloud-keyring',
repos => 'kilo/main',
trusted_source => true,
} ->
package { $need_to_be_upgraded:
ensure => latest,
class { '::openstack_extras::repo::debian::ubuntu':
release => 'kilo',
package_require => true,
}
}
'RedHat': {
include ::epel # Get our epel on
class { '::openstack_extras::repo::redhat::redhat':
# Kilo is not GA yet, so let's use the testing repo
manage_rdo => false,
repo_hash => {
'rdo-kilo-testing' => {
'baseurl' => 'https://repos.fedorapeople.org/repos/openstack/openstack-kilo/testing/el7/',
# packages are not GA so not signed
'gpgcheck' => '0',
'priority' => 97,
},
},
}
}
default: {
fail("Unsupported osfamily (${::osfamily})")
}
}
class { '::mysql::server': }
# Keystone resources, needed by Glance to run
Expand Down Expand Up @@ -68,7 +74,7 @@ class { '::glance::keystone::auth':
class { '::glance::api':
database_connection => 'mysql://glance:[email protected]/glance?charset=utf8',
verbose => false,
keystone_password => 'big_secret',
keystone_password => 'a_big_secret',
}
class { '::glance::registry':
database_connection => 'mysql://glance:[email protected]/glance?charset=utf8',
Expand Down
9 changes: 0 additions & 9 deletions glance/spec/acceptance/nodesets/centos-70-x64.yml

This file was deleted.

9 changes: 4 additions & 5 deletions glance/spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
HOSTS:
ubuntu-server-1404-x64:
ubuntu-14.04-amd64:
roles:
- master
platform: ubuntu-14.04-amd64
box : trusty-server-cloudimg-amd64-vagrant-disk1
box_url : puppetlabs/ubuntu-14.04-64-nocm
box : puppetlabs/ubuntu-14.04-64-nocm
box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
hypervisor : vagrant
CONFIG:
log_level : debug
type: git
type: foss
2 changes: 1 addition & 1 deletion glance/spec/acceptance/nodesets/nodepool-trusty.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOSTS:
ubuntu-server-1404-x64:
ubuntu-14.04-amd64:
roles:
- master
platform: ubuntu-14.04-amd64
Expand Down
9 changes: 0 additions & 9 deletions glance/spec/acceptance/nodesets/nodepool.yml

This file was deleted.

11 changes: 0 additions & 11 deletions glance/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml

This file was deleted.

27 changes: 27 additions & 0 deletions glance/spec/classes/glance_backend_rbd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,31 @@
)
}
end

describe 'package on RedHat platform el6' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '6.5',
}
end
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-ceph',
:ensure => 'present'
)
}
end
describe 'package on RedHat platform el7' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0'
}
end
it { is_expected.to contain_package('python-ceph').with(
:name => 'python-rbd',
:ensure => 'present'
)
}
end
end
5 changes: 4 additions & 1 deletion glance/spec/classes/glance_backend_swift_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
is_expected.to contain_glance_api_config('DEFAULT/swift_store_container').with_value('glance')
is_expected.to contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value(false)
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
end

it 'configures glance-cache.conf' do
Expand All @@ -51,7 +52,8 @@
:swift_store_large_object_size => '100',
:swift_store_auth_address => '127.0.0.2:8080/v1.0/',
:swift_store_container => 'swift',
:swift_store_create_container_on_put => true
:swift_store_create_container_on_put => true,
:swift_store_endpoint_type => 'publicURL'
}
end

Expand All @@ -61,6 +63,7 @@
is_expected.to contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('1')
is_expected.to contain_glance_api_config('DEFAULT/swift_store_large_object_size').with_value('100')
is_expected.to contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
is_expected.to contain_glance_api_config('glance_store/swift_store_endpoint_type').with_value('publicURL')
end

it 'configures glance-cache.conf' do
Expand Down
3 changes: 2 additions & 1 deletion glance/spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
# install library modules from the forge
on host, puppet('module','install', '--force', 'puppetlabs-mysql', '--version', '3.2.0'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','dprince/qpid'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-apt', '--version', '1.8.0'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-inifile'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','puppetlabs-rabbitmq'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module','install','stahnma-epel'), { :acceptable_exit_codes => [0,1] }

# install puppet modules from git, use master
shell('git clone https://git.openstack.org/stackforge/puppet-openstacklib /etc/puppet/modules/openstacklib')
shell('git clone https://git.openstack.org/stackforge/puppet-keystone /etc/puppet/modules/keystone')
shell('git clone https://git.openstack.org/stackforge/puppet-openstack_extras /etc/puppet/modules/openstack_extras')

# Install the module being tested
puppet_module_install(:source => proj_root, :module_name => 'glance')
Expand Down

0 comments on commit f1a2bb3

Please sign in to comment.