diff --git a/releasenotes/notes/validations-in-workflow-8ce6a053cacece0d.yaml b/releasenotes/notes/validations-in-workflow-8ce6a053cacece0d.yaml new file mode 100644 index 000000000..6d8dfc623 --- /dev/null +++ b/releasenotes/notes/validations-in-workflow-8ce6a053cacece0d.yaml @@ -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. diff --git a/workbooks/baremetal.yaml b/workbooks/baremetal.yaml index 2b23f9b0b..e09407b64 100644 --- a/workbooks/baremetal.yaml +++ b/workbooks/baremetal.yaml @@ -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 %> diff --git a/workbooks/deployment.yaml b/workbooks/deployment.yaml index 816eba3fe..3975f425d 100644 --- a/workbooks/deployment.yaml +++ b/workbooks/deployment.yaml @@ -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