Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
---
version: '2.0'
test_nodes_with_profile:
description: Find nodes with a specific profile tag
input:
- profile: test
tasks:
get_available_nodes:
action: ironic.node_list maintenance=False
on-success: get_nodes_for_role
publish:
available_nodes: <% task(get_available_nodes).result.where($.provision_state = 'available').uuid %>
get_nodes_for_role:
with-items: node_uuid in <% $.available_nodes %>
action: ironic.node_get node_id=<% $.node_uuid %>
publish:
matching_nodes: <% let(profile => concat("profile:", $.profile)) -> task(get_nodes_for_role).result.where($profile in $.properties.capabilities).uuid %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment