diff --git a/manifests/api.pp b/manifests/api.pp index 916493b0..b90a4e0c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -76,6 +76,7 @@ class heat::api ( package { 'heat-api': ensure => installed, name => $::heat::params::api_package_name, + tag => 'openstack', } if $manage_service { diff --git a/manifests/api_cfn.pp b/manifests/api_cfn.pp index 175d9c14..9738eb41 100644 --- a/manifests/api_cfn.pp +++ b/manifests/api_cfn.pp @@ -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 { diff --git a/manifests/api_cloudwatch.pp b/manifests/api_cloudwatch.pp index d57fe523..8f4a64cd 100644 --- a/manifests/api_cloudwatch.pp +++ b/manifests/api_cloudwatch.pp @@ -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 { diff --git a/manifests/client.pp b/manifests/client.pp index b594b0a7..3fdd35fa 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -16,6 +16,7 @@ class heat::client ( package { 'python-heatclient': ensure => $ensure, name => $::heat::params::client_package_name, + tag => 'openstack', } } diff --git a/manifests/engine.pp b/manifests/engine.pp index c3aea1de..6a62cec0 100644 --- a/manifests/engine.pp +++ b/manifests/engine.pp @@ -76,6 +76,7 @@ class heat::engine ( package { 'heat-engine': ensure => installed, name => $::heat::params::engine_package_name, + tag => 'openstack', notify => Exec['heat-dbsync'], } diff --git a/manifests/init.pp b/manifests/init.pp index b33d8e38..0d56db64 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -289,6 +289,7 @@ class heat( package { 'heat-common': ensure => $package_ensure, name => $::heat::params::common_package_name, + tag => 'openstack', } Package['heat-common'] -> Heat_config<||> @@ -493,6 +494,7 @@ class heat( package {'heat-backend-package': ensure => present, name => $backend_package, + tag => 'openstack', } } diff --git a/spec/classes/heat_client_spec.rb b/spec/classes/heat_client_spec.rb new file mode 100644 index 00000000..c436131f --- /dev/null +++ b/spec/classes/heat_client_spec.rb @@ -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 diff --git a/spec/classes/heat_engine_spec.rb b/spec/classes/heat_engine_spec.rb index b20255e7..495d088d 100644 --- a/spec/classes/heat_engine_spec.rb +++ b/spec/classes/heat_engine_spec.rb @@ -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', diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index 1366f3d4..52f20349 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -117,7 +117,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