Browse Source

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)
ZhongShengping 1 year ago
parent
commit
dcfb0d345f

+ 2
- 0
manifests/db/sync.pp View File

@@ -20,6 +20,7 @@ class mistral::db::sync {
20 20
       Anchor['mistral::dbsync::begin']
21 21
     ],
22 22
     notify      => Anchor['mistral::dbsync::end'],
23
+    tag         => 'openstack-db',
23 24
   }
24 25
 
25 26
   exec { 'mistral-db-populate':
@@ -35,6 +36,7 @@ class mistral::db::sync {
35 36
       Anchor['mistral::dbsync::begin']
36 37
     ],
37 38
     notify      => Anchor['mistral::dbsync::end'],
39
+    tag         => 'openstack-db',
38 40
   }
39 41
 
40 42
 }

+ 3
- 0
releasenotes/notes/openstack_db_tag-a79c0b390eeba4bb.yaml View File

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

+ 4
- 2
spec/classes/mistral_db_sync_spec.rb View File

@@ -13,7 +13,8 @@ describe 'mistral::db::sync' do
13 13
         :refreshonly => 'true',
14 14
         :try_sleep   => 5,
15 15
         :tries       => 10,
16
-        :logoutput   => 'on_failure'
16
+        :logoutput   => 'on_failure',
17
+        :tag         => 'openstack-db',
17 18
       )
18 19
 
19 20
       is_expected.to contain_exec('mistral-db-populate').with(
@@ -21,7 +22,8 @@ describe 'mistral::db::sync' do
21 22
         :path        => '/usr/bin',
22 23
         :user        => 'mistral',
23 24
         :refreshonly => 'true',
24
-        :logoutput   => 'on_failure'
25
+        :logoutput   => 'on_failure',
26
+        :tag         => 'openstack-db',
25 27
       )
26 28
 
27 29
     end

Loading…
Cancel
Save