Skip to content

Instantly share code, notes, and snippets.

@hardys
Created March 3, 2017 10:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hardys/b1999c500185ccc832f0ac8731174b2a to your computer and use it in GitHub Desktop.
---
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