Add tag to package and service resources

In order to be able to take an action after all the packages of the
module have been installed/updated or all the services have been
started/restarted, we set a 'glance-package' and 'glance-service'
tag for each package and service of this module.

At the moment, there is a generic openstack tag that is not specific
enough if one wants to take action upon a single module change.

Use case :

If an action needs to be taken after all the packages have been
installed or updated : Package <| tag == 'glance-package' |> -> X

Change-Id: If43e27e80500deebf6b758b11541d3d6f50cb129
This commit is contained in:
Yanis Guenane
2015-07-22 10:14:50 +02:00
parent d09db618b6
commit 92180ae9a1
6 changed files with 19 additions and 13 deletions

View File

@@ -87,7 +87,8 @@ describe 'glance::api' do
'ensure' => (param_hash[:manage_service] && param_hash[:enabled]) ? 'running': 'stopped',
'enable' => param_hash[:enabled],
'hasstatus' => true,
'hasrestart' => true
'hasrestart' => true,
'tag' => 'glance-service',
) }
it { is_expected.to_not contain_exec('validate_nova_api') }
@@ -183,7 +184,8 @@ describe 'glance::api' do
'ensure' => nil,
'enable' => false,
'hasstatus' => true,
'hasrestart' => true
'hasrestart' => true,
'tag' => 'glance-service',
) }
end
@@ -441,7 +443,7 @@ describe 'glance::api' do
let(:params) { default_params.merge({ :package_ensure => package_ensure }) }
it { is_expected.to contain_package('glance-api').with(
:ensure => package_ensure,
:tag => ['openstack']
:tag => ['openstack', 'glance-package']
)}
end
end
@@ -454,7 +456,7 @@ describe 'glance::api' do
let(:params) { default_params }
it { is_expected.to contain_package('openstack-glance').with(
:tag => ['openstack'],
:tag => ['openstack', 'glance-package'],
)}
end