tripleo-common/workbooks/swift_backup.yaml
Rabi Mishra 957c9bd514 Fix access of input parameters
In change I9c54379925339eaaa9a0ee61cb823bddc95737c7, we did not
access workflow input parameters correctly.

Change-Id: I56258428d7a9461af64055a5605f3227bfadda2f
Closes-Bug: #1818926
2019-03-07 02:45:48 +00:00

72 lines
2.0 KiB
YAML

---
version: '2.0'
name: tripleo.swift_backup.v1
description: TripleO Swift backup container Deployment Workflow v1
workflows:
create_swift_backup_container_plan:
description: >
Ensures the existence of containers for backups, e.g. swift_rings
input:
- container
- queue_name: tripleo
- container_suffix: "-swift-rings"
- swift_tar: "swift-rings.tar.gz"
- get_url_parm: SwiftRingGetTempurl
- put_url_parm: SwiftRingPutTempurl
- validate_stack: true
tags:
- tripleo-common-managed
tasks:
swift_container:
publish:
swift_container: "<% $.container %><% $.container_suffix %>"
on-complete: get_tempurl
get_tempurl:
action: tripleo.swift.tempurl
on-success: put_tempurl
input:
container: <% $.swift_container %>
obj: <% $.swift_tar %>
put_tempurl:
action: tripleo.swift.tempurl
on-success: set_tempurl
input:
container: <% $.swift_container %>
obj: <% $.swift_tar %>
method: "PUT"
set_tempurl:
action: tripleo.parameters.update
input:
parameters: <% {$.get_url_parm => task(get_tempurl).result, $.put_url_parm => task(put_tempurl).result} %>
container: <% $.container %>
validate: <% $.validate_stack %>
on-success: set_status_success
on-error: set_tempurl_failed
set_status_success:
on-success: notify_zaqar
publish:
status: SUCCESS
message: 'Temporary Swift GET/PUT URL parameters have successfully been updated.'
set_tempurl_failed:
on-success: notify_zaqar
publish:
status: FAILED
message: <% task(set_tempurl).result %>
notify_zaqar:
workflow: tripleo.messaging.v1.send
input:
queue_name: <% $.queue_name %>
type: <% execution().name %>
status: <% $.get('status', 'SUCCESS') %>
message: <% $.get('message', '') %>
execution: <% execution() %>