Add support for calling validations in deploy and introspect workflows

Following blueprint
https://blueprints.launchpad.net/tripleo/+spec/validations-in-workflows

This adds support for calling the validations from the deployment and
introspection workflows. They default to off, and can be enabled by
passing 'True' to the run_validations parameters of these workflows.

Currently this is just for the 'pre-inspection' and 'pre-deployment'
validation groups. The 'post-deployment' group will be added once
Ibbb359de8a873ee76b0e274e631307d4e4804fca lands with the ability
for a workflow to block.

Change-Id: I439361ae20c4e302b83870cdc06a5baa90ea683c
Partial-Bug: #1638697
This commit is contained in:
Brad P. Crochet 2017-01-03 11:12:31 -05:00
parent 7c1bf4bd29
commit 5cb5678a31
3 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
features:
- Adds support for calling the external TripleO
validations from the deployment and introspection
workflows. They default to off, and can be enabled
by passing 'True' to the run_validations parameters
of these workflows.

View File

@ -343,9 +343,29 @@ workflows:
input:
- node_uuids
- run_validations: False
- queue_name: tripleo
tasks:
pre_run_validations:
on-complete:
- run_validations: <% $.run_validations %>
- start_introspection: <% not $.run_validations %>
run_validations:
workflow: tripleo.validations.v1.run_groups
input:
group_names:
- 'pre-introspection'
queue_name: <% $.queue_name %>
on-success: start_introspection
on-error: set_validations_failed
set_validations_failed:
on-success: send_message
publish:
status: FAILED
message: <% task(run_validations).result %>
start_introspection:
on-success: wait_for_introspection_to_finish
@ -394,6 +414,7 @@ workflows:
description: Introspect all nodes in a 'manageable' state.
input:
- run_validations: False
- queue_name: tripleo
tasks:
@ -417,6 +438,7 @@ workflows:
workflow: tripleo.baremetal.v1.introspect
input:
node_uuids: <% $.managed_nodes %>
run_validations: <% $.run_validations %>
queue_name: <% $.queue_name %>
publish:
introspected_nodes: <% task(introspect_manageable).result.introspected_nodes %>

View File

@ -114,6 +114,7 @@ workflows:
input:
- container
- run_validations: False
- timeout: 240
- queue_name: tripleo
@ -124,7 +125,25 @@ workflows:
input:
container: <% $.container %>
queue_name: <% $.queue_name %>
on-complete: get_heat_stack
on-complete:
- run_validations: <% $.run_validations %>
- get_heat_stack: <% not $.run_validations %>
run_validations:
workflow: tripleo.validations.v1.run_groups
input:
group_names:
- 'pre-deployment'
plan: <% $.container %>
queue_name: <% $.queue_name %>
on-success: get_heat_stack
on-error: set_validations_failed
set_validations_failed:
on-success: send_message
publish:
status: FAILED
message: <% task(run_validations).result %>
get_heat_stack:
action: heat.stacks_get stack_id=<% $.container %>
@ -140,7 +159,10 @@ workflows:
message: The Heat stack is busy.
deploy:
action: tripleo.deployment.deploy timeout=<% $.timeout %> container=<% $.container %>
action: tripleo.deployment.deploy
input:
timeout: <% $.timeout %>
container: <% $.container %>
on-success: send_message
on-error: set_deployment_failed