summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Bezdicka <lbezdick@redhat.com>2017-05-29 22:54:33 +0200
committerLukas Bezdicka <lbezdick@redhat.com>2017-06-12 10:58:37 +0200
commit5046bea8c9b5dc819568ee2008271496c6669c9d (patch)
treef0f7bd6eeb443fab5ab1efeebc4330a001005c52
parent67599bbc803b771cf0072f5f204b71849f153ddf (diff)
Ensure Swift Rings backup container and URLs
Swift Rings backup container and URLs for it are created only during deploy but there is possibility of minor update or change of deployment when they should be created. Adding them in plan_management update_deployment_plan fixes these cases. Closes-Bug: #1695778 Resolves: rhbz#1455616 Change-Id: Ifcedd54da5c74f12c863b8ec63679360673dd8f6 (cherry picked from commit bfabb3f5755628f707be58b1ead41b2f799ca099)
Notes
Notes (review): Code-Review+1: Athlan-Guyot sofer <sathlang@redhat.com> Code-Review+2: Marios Andreou <marios@redhat.com> Code-Review+1: mathieu bultel <mat.bultel@gmail.com> Code-Review+2: Carlos Camacho <ccamacho@redhat.com> Workflow+1: Carlos Camacho <ccamacho@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 16 Jun 2017 14:36:40 +0000 Reviewed-on: https://review.openstack.org/473319 Project: openstack/tripleo-common Branch: refs/heads/stable/ocata
-rw-r--r--workbooks/deployment.yaml53
-rw-r--r--workbooks/plan_management.yaml15
-rw-r--r--workbooks/swift_rings_backup.yaml87
3 files changed, 116 insertions, 39 deletions
diff --git a/workbooks/deployment.yaml b/workbooks/deployment.yaml
index bb5c5ae..1376d21 100644
--- a/workbooks/deployment.yaml
+++ b/workbooks/deployment.yaml
@@ -128,7 +128,7 @@ workflows:
128 queue_name: <% $.queue_name %> 128 queue_name: <% $.queue_name %>
129 on-complete: 129 on-complete:
130 - run_validations: <% $.run_validations %> 130 - run_validations: <% $.run_validations %>
131 - check_container: <% not $.run_validations %> 131 - create_swift_rings_backup_plan: <% not $.run_validations %>
132 132
133 run_validations: 133 run_validations:
134 workflow: tripleo.validations.v1.run_groups 134 workflow: tripleo.validations.v1.run_groups
@@ -137,7 +137,7 @@ workflows:
137 - 'pre-deployment' 137 - 'pre-deployment'
138 plan: <% $.container %> 138 plan: <% $.container %>
139 queue_name: <% $.queue_name %> 139 queue_name: <% $.queue_name %>
140 on-success: check_container 140 on-success: create_swift_rings_backup_plan
141 on-error: set_validations_failed 141 on-error: set_validations_failed
142 142
143 set_validations_failed: 143 set_validations_failed:
@@ -146,45 +146,14 @@ workflows:
146 status: FAILED 146 status: FAILED
147 message: <% task(run_validations).result %> 147 message: <% task(run_validations).result %>
148 148
149 check_container: 149 create_swift_rings_backup_plan:
150 action: swift.head_container container=<% $.container %> 150 workflow: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
151 on-success: get_tempurl 151 on-success: get_heat_stack
152 on-error: create_container 152 on-error: create_swift_rings_backup_plan_set_status_failed
153
154 create_container:
155 action: tripleo.plan.create_container container="<% $.container %>-swift-rings"
156 on-success: get_tempurl
157
158 get_tempurl:
159 action: tripleo.swift.tempurl
160 on-success: set_get_tempurl
161 input:
162 container: "<% $.container %>-swift-rings"
163 obj: "swift-rings.tar.gz"
164
165 set_get_tempurl:
166 action: tripleo.parameters.update
167 input:
168 parameters:
169 SwiftRingGetTempurl: <% task(get_tempurl).result %>
170 container: <% $.container %>
171 on-success: put_tempurl
172
173 put_tempurl:
174 action: tripleo.swift.tempurl
175 on-success: set_put_tempurl
176 input:
177 container: "<% $.container %>-swift-rings"
178 obj: "swift-rings.tar.gz"
179 method: "PUT"
180
181 set_put_tempurl:
182 action: tripleo.parameters.update
183 input: 153 input:
184 parameters:
185 SwiftRingPutTempurl: <% task(put_tempurl).result %>
186 container: <% $.container %> 154 container: <% $.container %>
187 on-success: get_heat_stack 155 queue_name: <% $.queue_name %>
156 use_default_templates: true
188 157
189 get_heat_stack: 158 get_heat_stack:
190 action: heat.stacks_get stack_id=<% $.container %> 159 action: heat.stacks_get stack_id=<% $.container %>
@@ -208,6 +177,12 @@ workflows:
208 on-success: send_message 177 on-success: send_message
209 on-error: set_deployment_failed 178 on-error: set_deployment_failed
210 179
180 create_swift_rings_backup_plan_set_status_failed:
181 on-success: send_message
182 publish:
183 status: FAILED
184 message: <% task(create_swift_rings_backup_plan).result %>
185
211 set_deployment_failed: 186 set_deployment_failed:
212 on-success: send_message 187 on-success: send_message
213 publish: 188 publish:
diff --git a/workbooks/plan_management.yaml b/workbooks/plan_management.yaml
index 6a759ac..05253a2 100644
--- a/workbooks/plan_management.yaml
+++ b/workbooks/plan_management.yaml
@@ -76,6 +76,15 @@ workflows:
76 - queue_name: tripleo 76 - queue_name: tripleo
77 - generate_passwords: true 77 - generate_passwords: true
78 tasks: 78 tasks:
79 create_swift_rings_backup_plan:
80 workflow: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
81 on-success: update_plan
82 on-error: create_swift_rings_backup_plan_set_status_failed
83 input:
84 container: <% $.container %>
85 queue_name: <% $.queue_name %>
86 use_default_templates: true
87
79 update_plan: 88 update_plan:
80 action: tripleo.plan.update container=<% $.container %> 89 action: tripleo.plan.update container=<% $.container %>
81 on-success: 90 on-success:
@@ -99,6 +108,12 @@ workflows:
99 status: SUCCESS 108 status: SUCCESS
100 message: <% task(update_plan).result %> 109 message: <% task(update_plan).result %>
101 110
111 create_swift_rings_backup_plan_set_status_failed:
112 on-success: notify_zaqar
113 publish:
114 status: FAILED
115 message: <% task(create_swift_rings_backup_plan).result %>
116
102 update_plan_set_status_failed: 117 update_plan_set_status_failed:
103 on-success: notify_zaqar 118 on-success: notify_zaqar
104 publish: 119 publish:
diff --git a/workbooks/swift_rings_backup.yaml b/workbooks/swift_rings_backup.yaml
new file mode 100644
index 0000000..870e176
--- /dev/null
+++ b/workbooks/swift_rings_backup.yaml
@@ -0,0 +1,87 @@
1---
2version: '2.0'
3name: tripleo.swift_rings_backup.v1
4description: TripleO Swift Rings backup container Deployment Workflow v1
5
6workflows:
7
8 create_swift_rings_backup_container_plan:
9 description: >
10 This plan ensures existence of container for Swift Rings backup.
11 input:
12 - container
13 - queue_name: tripleo
14 tasks:
15 check_container:
16 action: swift.head_container container=<% $.container %>
17 on-success: get_tempurl
18 on-error: create_container
19
20 create_container:
21 action: tripleo.plan.create_container container="<% $.container %>-swift-rings"
22 on-error: set_create_container_failed
23 on-success: get_tempurl
24
25 get_tempurl:
26 action: tripleo.swift.tempurl
27 on-success: set_get_tempurl
28 input:
29 container: "<% $.container %>-swift-rings"
30 obj: "swift-rings.tar.gz"
31
32 set_get_tempurl:
33 action: tripleo.parameters.update
34 input:
35 parameters:
36 SwiftRingGetTempurl: <% task(get_tempurl).result %>
37 container: <% $.container %>
38 on-success: put_tempurl
39
40 put_tempurl:
41 action: tripleo.swift.tempurl
42 on-success: set_put_tempurl
43 input:
44 container: "<% $.container %>-swift-rings"
45 obj: "swift-rings.tar.gz"
46 method: "PUT"
47
48 set_put_tempurl:
49 action: tripleo.parameters.update
50 input:
51 parameters:
52 SwiftRingPutTempurl: <% task(put_tempurl).result %>
53 container: <% $.container %>
54 on-success: set_status_success
55 on-error: set_put_tempurl_failed
56
57 set_status_success:
58 on-success: notify_zaqar
59 publish:
60 status: SUCCESS
61 message: <% task(set_put_tempurl).result %>
62
63 set_put_tempurl_failed:
64 on-success: notify_zaqar
65 publish:
66 status: FAILED
67 message: <% task(set_put_tempurl).result %>
68
69 set_create_container_failed:
70 on-success: notify_zaqar
71 publish:
72 status: FAILED
73 message: <% task(create_container_failed).result %>
74
75 notify_zaqar:
76 action: zaqar.queue_post
77 input:
78 queue_name: <% $.queue_name %>
79 messages:
80 body:
81 type: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
82 payload:
83 status: <% $.status %>
84 message: <% $.get('message', '') %>
85 execution: <% execution() %>
86 on-success:
87 - fail: <% $.get('status') = "FAILED" %>