Add 'openstack-db' tag to db-sync Exec resource

In order to make easy orchestration on all OpenStack db-sync, add this
tag so people can use this tag in composition layer.
A use case it to set some orchestration to make sure MySQL Galera is
ready before running any Exec with this tag.

Change-Id: I0769f75d92e87d686387286041502261fad871e7
Closes-Bug: #1755102
(cherry picked from commit f5078648ea)
This commit is contained in:
ZhongShengping 2018-03-12 16:33:09 +08:00 committed by zhongshengping
parent 280f5d7806
commit b99381c7c9
3 changed files with 9 additions and 2 deletions

View File

@ -20,6 +20,7 @@ class mistral::db::sync {
Anchor['mistral::dbsync::begin'] Anchor['mistral::dbsync::begin']
], ],
notify => Anchor['mistral::dbsync::end'], notify => Anchor['mistral::dbsync::end'],
tag => 'openstack-db',
} }
exec { 'mistral-db-populate': exec { 'mistral-db-populate':
@ -35,6 +36,7 @@ class mistral::db::sync {
Anchor['mistral::dbsync::begin'] Anchor['mistral::dbsync::begin']
], ],
notify => Anchor['mistral::dbsync::end'], notify => Anchor['mistral::dbsync::end'],
tag => 'openstack-db',
} }
} }

View File

@ -0,0 +1,3 @@
---
features:
- Add openstack-db tag to Exec that run db-sync.

View File

@ -13,7 +13,8 @@ describe 'mistral::db::sync' do
:refreshonly => 'true', :refreshonly => 'true',
:try_sleep => 5, :try_sleep => 5,
:tries => 10, :tries => 10,
:logoutput => 'on_failure' :logoutput => 'on_failure',
:tag => 'openstack-db',
) )
is_expected.to contain_exec('mistral-db-populate').with( is_expected.to contain_exec('mistral-db-populate').with(
@ -21,7 +22,8 @@ describe 'mistral::db::sync' do
:path => '/usr/bin', :path => '/usr/bin',
:user => 'mistral', :user => 'mistral',
:refreshonly => 'true', :refreshonly => 'true',
:logoutput => 'on_failure' :logoutput => 'on_failure',
:tag => 'openstack-db',
) )
end end