From 6f6e806cd3940f2be6107f4d7fea604aed05ec56 Mon Sep 17 00:00:00 2001 From: Mike Fedosin Date: Tue, 10 Apr 2018 13:12:45 +0200 Subject: [PATCH] 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 --- ...apabilities_workbook-091f0ce2ab5fff3a.yaml | 5 + workbooks/heat_environments.yaml | 97 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 releasenotes/notes/create_heat_capabilities_workbook-091f0ce2ab5fff3a.yaml create mode 100644 workbooks/heat_environments.yaml diff --git a/releasenotes/notes/create_heat_capabilities_workbook-091f0ce2ab5fff3a.yaml b/releasenotes/notes/create_heat_capabilities_workbook-091f0ce2ab5fff3a.yaml new file mode 100644 index 000000000..54c8f3f20 --- /dev/null +++ b/releasenotes/notes/create_heat_capabilities_workbook-091f0ce2ab5fff3a.yaml @@ -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. diff --git a/workbooks/heat_environments.yaml b/workbooks/heat_environments.yaml new file mode 100644 index 000000000..44bae5637 --- /dev/null +++ b/workbooks/heat_environments.yaml @@ -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', []) %>