tripleo-common/workbooks/swift_rings_backup.yaml
Lukas Bezdicka bfabb3f575 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
2017-06-05 13:14:35 +00:00

88 lines
2.5 KiB
YAML

---
version: '2.0'
name: tripleo.swift_rings_backup.v1
description: TripleO Swift Rings backup container Deployment Workflow v1
workflows:
create_swift_rings_backup_container_plan:
description: >
This plan ensures existence of container for Swift Rings backup.
input:
- container
- queue_name: tripleo
tasks:
check_container:
action: swift.head_container container=<% $.container %>
on-success: get_tempurl
on-error: create_container
create_container:
action: tripleo.plan.create_container container="<% $.container %>-swift-rings"
on-error: set_create_container_failed
on-success: get_tempurl
get_tempurl:
action: tripleo.swift.tempurl
on-success: set_get_tempurl
input:
container: "<% $.container %>-swift-rings"
obj: "swift-rings.tar.gz"
set_get_tempurl:
action: tripleo.parameters.update
input:
parameters:
SwiftRingGetTempurl: <% task(get_tempurl).result %>
container: <% $.container %>
on-success: put_tempurl
put_tempurl:
action: tripleo.swift.tempurl
on-success: set_put_tempurl
input:
container: "<% $.container %>-swift-rings"
obj: "swift-rings.tar.gz"
method: "PUT"
set_put_tempurl:
action: tripleo.parameters.update
input:
parameters:
SwiftRingPutTempurl: <% task(put_tempurl).result %>
container: <% $.container %>
on-success: set_status_success
on-error: set_put_tempurl_failed
set_status_success:
on-success: notify_zaqar
publish:
status: SUCCESS
message: <% task(set_put_tempurl).result %>
set_put_tempurl_failed:
on-success: notify_zaqar
publish:
status: FAILED
message: <% task(set_put_tempurl).result %>
set_create_container_failed:
on-success: notify_zaqar
publish:
status: FAILED
message: <% task(create_container_failed).result %>
notify_zaqar:
action: zaqar.queue_post
input:
queue_name: <% $.queue_name %>
messages:
body:
type: tripleo.swift_rings_backup.v1.create_swift_rings_backup_container_plan
payload:
status: <% $.status %>
message: <% $.get('message', '') %>
execution: <% execution() %>
on-success:
- fail: <% $.get('status') = "FAILED" %>