Create Heat Environments workbook

This patch creates a workbook that contains workflows
wrapping the heat capabilities actions: update and get.

Change-Id: If20856329817bc6f81fe652bfc7d3b8902353bf3
Partial-bug: #1759411
Partial-bug: #1759414
Co-Authored-By: Ryan Brady <rbrady@redhat.com>
This commit is contained in:
Mike Fedosin 2018-04-10 13:12:45 +02:00 committed by Ryan Brady
parent bd71949bc5
commit 6f6e806cd3
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Creates a workbook to update and get heat capabilities, so the related actions
do not need to be called directly.

View File

@ -0,0 +1,97 @@
---
version: '2.0'
name: tripleo.heat_environments.v1
description: TripleO Heat Environments Workflows
workflows:
update:
description: >
Update plan environment with selected environments.
Takes a list of environment files and depending on the value of the
enabled flag, adds or removes them from the plan environment.
input:
- environments
- container
- purge_missing: false
- sort_environments: false
- queue_name: tripleo
output:
plan_environment: <% $.result %>
tags:
- tripleo-common-managed
tasks:
update:
input:
environments: <% $.environments %>
container: <% $.container %>
purge_missing: <% $.purge_missing %>
sort_environments: <% $.sort_environments %>
action: tripleo.heat_capabilities.update
on-complete: send_message
publish:
status: SUCCESS
message: <% task().result %>
plan_environment: <% task().result %>
publish-on-error:
status: FAILED
message: <% task().result %>
send_message:
workflow: tripleo.messaging.v1.send
input:
queue_name: <% $.queue_name %>
type: <% execution().name %>
status: <% $.get('status', 'SUCCESS')
execution: <% execution() %>
messages: <% $.get('message', '') %>
payload:
plan_environment: <% $.get('plan_environment', []) %>
get:
description: >
Get list of available heat environments.
Parses the capabilities_map.yaml file in a given plan and
returns a list of environments.
input:
- container
- queue_name: tripleo
output:
capabilities: <% $.result %>
tags:
- tripleo-common-managed
tasks:
get:
action: tripleo.heat_capabilities.get container=<% $.container %>
on-complete: send_message
publish:
status: SUCCESS
message: <% task().result %>
capabilities: <% task().result %>
publish-on-error:
status: FAILED
message: <% task().result %>
send_message:
workflow: tripleo.messaging.v1.send
input:
queue_name: <% $.queue_name %>
type: <% execution().name %>
status: <% $.get('status', 'SUCCESS')
execution: <% execution() %>
messages: <% $.get('message', '') %>
payload:
capabilities: <% $.get('capabilities', []) %>