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 11:10:40 +0200
commit935912dd73da4325faaa1d5e47c2555c6d84359d (patch)
tree3ca7a7ce8019938b527ad656336e53de3efcb562
parentfb27e73b32462b97347cdebc366d32dc71c6f835 (diff)
Ensure Swift Rings backup container and URLsstable/newton
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: Yurii Prokulevych <yprokule@redhat.com> Code-Review+2: Carlos Camacho <ccamacho@redhat.com> Code-Review+2: Marios Andreou <marios@redhat.com> Workflow+1: Marios Andreou <marios@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 19 Jun 2017 09:54:54 +0000 Reviewed-on: https://review.openstack.org/469131 Project: openstack/tripleo-common Branch: refs/heads/stable/newton
-rw-r--r--workbooks/deployment.yaml51
-rw-r--r--workbooks/plan_management.yaml15
-rw-r--r--workbooks/swift_rings_backup.yaml87
3 files changed, 115 insertions, 38 deletions
diff --git a/workbooks/deployment.yaml b/workbooks/deployment.yaml
index a666800..93fdd4a 100644
--- a/workbooks/deployment.yaml
+++ b/workbooks/deployment.yaml
@@ -110,53 +110,28 @@ workflows:
110 110
111 add_validation_ssh_key: 111 add_validation_ssh_key:
112 workflow: tripleo.validations.v1.add_validation_ssh_key_parameter container=<% $.container %> 112 workflow: tripleo.validations.v1.add_validation_ssh_key_parameter container=<% $.container %>
113 on-complete: check_container 113 on-complete: create_swift_rings_backup_plan
114 114
115 check_container: 115 create_swift_rings_backup_plan:
116 action: swift.head_container container=<% $.container %> 116 workflow: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
117 on-success: get_tempurl 117 on-success: deploy
118 on-error: create_container 118 on-error: create_swift_rings_backup_plan_set_status_failed
119
120 create_container:
121 action: tripleo.plan.create_container container="<% $.container %>-swift-rings"
122 on-success: get_tempurl
123
124 get_tempurl:
125 action: tripleo.swift.tempurl
126 on-success: set_get_tempurl
127 input:
128 container: "<% $.container %>-swift-rings"
129 obj: "swift-rings.tar.gz"
130
131 set_get_tempurl:
132 action: tripleo.parameters.update
133 input:
134 parameters:
135 SwiftRingGetTempurl: <% task(get_tempurl).result %>
136 container: <% $.container %>
137 on-success: put_tempurl
138
139 put_tempurl:
140 action: tripleo.swift.tempurl
141 on-success: set_put_tempurl
142 input:
143 container: "<% $.container %>-swift-rings"
144 obj: "swift-rings.tar.gz"
145 method: "PUT"
146
147 set_put_tempurl:
148 action: tripleo.parameters.update
149 input: 119 input:
150 parameters:
151 SwiftRingPutTempurl: <% task(put_tempurl).result %>
152 container: <% $.container %> 120 container: <% $.container %>
153 on-success: deploy 121 queue_name: <% $.queue_name %>
122 use_default_templates: true
154 123
155 deploy: 124 deploy:
156 action: tripleo.deployment.deploy timeout=<% $.timeout %> container=<% $.container %> 125 action: tripleo.deployment.deploy timeout=<% $.timeout %> container=<% $.container %>
157 on-success: send_message 126 on-success: send_message
158 on-error: set_deployment_failed 127 on-error: set_deployment_failed
159 128
129 create_swift_rings_backup_plan_set_status_failed:
130 on-success: send_message
131 publish:
132 status: FAILED
133 message: <% task(create_swift_rings_backup_plan).result %>
134
160 set_deployment_failed: 135 set_deployment_failed:
161 on-success: send_message 136 on-success: send_message
162 publish: 137 publish:
diff --git a/workbooks/plan_management.yaml b/workbooks/plan_management.yaml
index b44d3dc..4c5149e 100644
--- a/workbooks/plan_management.yaml
+++ b/workbooks/plan_management.yaml
@@ -67,6 +67,15 @@ workflows:
67 - container 67 - container
68 - queue_name: tripleo 68 - queue_name: tripleo
69 tasks: 69 tasks:
70 create_swift_rings_backup_plan:
71 workflow: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
72 on-success: update_plan
73 on-error: create_swift_rings_backup_plan_set_status_failed
74 input:
75 container: <% $.container %>
76 queue_name: <% $.queue_name %>
77 use_default_templates: true
78
70 update_plan: 79 update_plan:
71 action: tripleo.plan.update container=<% $.container %> 80 action: tripleo.plan.update container=<% $.container %>
72 on-success: ensure_passwords_exist 81 on-success: ensure_passwords_exist
@@ -88,6 +97,12 @@ workflows:
88 status: SUCCESS 97 status: SUCCESS
89 message: <% task(update_plan).result %> 98 message: <% task(update_plan).result %>
90 99
100 create_swift_rings_backup_plan_set_status_failed:
101 on-success: notify_zaqar
102 publish:
103 status: FAILED
104 message: <% task(create_swift_rings_backup_plan).result %>
105
91 update_plan_set_status_failed: 106 update_plan_set_status_failed:
92 on-success: notify_zaqar 107 on-success: notify_zaqar
93 publish: 108 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" %>