Tag all Heat packages

Some users wish to override the default package provider by their own.

Tag all packages with the 'openstack' to allow mass resource attributes
override using resource collectors.

Closes-bug: #1391209

Change-Id: I09e54700438894e22d29605fec51bb056baf4050
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud 2015-03-28 19:07:21 +01:00
parent 6c2de4990c
commit 73df608936
9 changed files with 60 additions and 2 deletions

View File

@ -76,6 +76,7 @@ class heat::api (
package { 'heat-api':
ensure => installed,
name => $::heat::params::api_package_name,
tag => 'openstack',
}
if $manage_service {

View File

@ -79,6 +79,7 @@ class heat::api_cfn (
package { 'heat-api-cfn':
ensure => installed,
name => $::heat::params::api_cfn_package_name,
tag => 'openstack',
}
if $manage_service {

View File

@ -78,6 +78,7 @@ class heat::api_cloudwatch (
package { 'heat-api-cloudwatch':
ensure => installed,
name => $::heat::params::api_cloudwatch_package_name,
tag => 'openstack',
}
if $manage_service {

View File

@ -16,6 +16,7 @@ class heat::client (
package { 'python-heatclient':
ensure => $ensure,
name => $::heat::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -81,6 +81,7 @@ class heat::engine (
package { 'heat-engine':
ensure => installed,
name => $::heat::params::engine_package_name,
tag => 'openstack',
notify => Exec['heat-dbsync'],
}

View File

@ -279,6 +279,7 @@ class heat(
package { 'heat-common':
ensure => $package_ensure,
name => $::heat::params::common_package_name,
tag => 'openstack',
}
Package['heat-common'] -> Heat_config<||>
@ -483,6 +484,7 @@ class heat(
package {'heat-backend-package':
ensure => present,
name => $backend_package,
tag => 'openstack',
}
}

View File

@ -0,0 +1,45 @@
require 'spec_helper'
describe 'heat::client' do
let :params do
{}
end
let :default_params do
{ :package_ensure => 'present' }
end
shared_examples_for 'heat client' do
let :p do
default_params.merge(params)
end
it { is_expected.to contain_class('heat::params') }
it 'installs heat client package' do
is_expected.to contain_package('python-heatclient').with(
:name => 'python-heatclient',
:ensure => p[:package_ensure],
:tag => 'openstack'
)
end
end
context 'on Debian platform' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'heat client'
end
context 'on RedHat platform' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'heat client'
end
end

View File

@ -42,7 +42,12 @@ describe 'heat::engine' do
default_params.merge(params)
end
it { is_expected.to contain_package('heat-engine').with_name(os_params[:package_name]) }
it { is_expected.to contain_package('heat-engine').with(
:ensure => 'installed',
:name => os_params[:package_name],
:tag => 'openstack',
:notify => 'Exec[heat-dbsync]'
) }
it { is_expected.to contain_service('heat-engine').with(
:ensure => (expected_params[:manage_service] && expected_params[:enabled]) ? 'running' : 'stopped',

View File

@ -116,7 +116,8 @@ describe 'heat' do
it 'installs heat common package' do
is_expected.to contain_package('heat-common').with(
:ensure => 'present',
:name => platform_params[:common_package_name]
:name => platform_params[:common_package_name],
:tag => 'openstack'
)
end