Browse Source

Add support for initial state to the register_or_update workflow

Currently, it is not possible to set nodes to an 'enroll' state. It's
either 'manageable' or 'available'. This adds support for the
initial_state to be set to something other than just available.

Change-Id: I40f0b27a0f38447372181f9fae6a31e57dbd79e4
Partial-Bug: #1637474
tags/5.8.0
Brad P. Crochet 3 years ago
committed by Dougal Matthews
parent
commit
06197370db
1 changed files with 21 additions and 2 deletions
  1. +21
    -2
      workbooks/baremetal.yaml

+ 21
- 2
workbooks/baremetal.yaml View File

@@ -99,11 +99,14 @@ workflows:
- kernel_name: null
- ramdisk_name: null
- instance_boot_option: local
- initial_state: manageable

tasks:
register_or_update_nodes:
action: tripleo.baremetal.register_or_update_nodes
on-success: set_nodes_managed
on-success:
- set_nodes_managed: <% $.initial_state != "enroll" %>
- send_message: <% $.initial_state = "enroll" %>
on-error: set_status_failed_register_or_update_nodes
input:
nodes_json: <% $.nodes_json %>
@@ -123,7 +126,9 @@ workflows:
registered_nodes: []

set_nodes_managed:
on-success: send_message
on-success:
- set_nodes_available: <% $.initial_state = "available" %>
- send_message: <% $.initial_state != "available" %>
on-error: set_status_failed_nodes_managed
with-items: node in <% $.new_nodes %>
workflow: tripleo.baremetal.v1.set_node_state node_uuid=<% $.node.uuid %> state_action='manage' target_state='manageable'
@@ -137,6 +142,20 @@ workflows:
status: FAILED
message: <% task(set_nodes_managed).result %>

set_nodes_available:
on-success: send_message
on-error: set_status_failed_nodes_available
workflow: tripleo.baremetal.v1.provide node_uuids=<% $.new_nodes.uuid %> queue_name=<% $.queue_name %>
publish:
status: SUCCESS
message: Nodes set to available.

set_status_failed_nodes_available:
on-success: send_message
publish:
status: FAILED
message: <% task(set_nodes_available).result %>

send_message:
action: zaqar.queue_post
retry: count=5 delay=1


Loading…
Cancel
Save