-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Use Case
I'd like to filter nodes in the inventory with a plan and pass the node list to another plan as a targets list. For example:
bolt plan run inventory::filter variable=pp_role value=sandbox | \
bolt plan run example::foo -t-
The only value bolt plan run
prints on stdout is the plan result value, which is always printed as JSON:
bolt plan run inventory::filter variable=pp_role value=sandbox
[...]
[
"node1.example.tld",
"node2.example.tld",
]
Describe the Solution You Would Like
With all the above in mind, the best solution is to teach bolt -t-
to understand if JSON is given on stdin, I guess.
Describe Alternatives You've Considered
- Use
jq -r
between bolt invocations to convert from JSON array to the plain text list. - Use
--params=-
instead of-t-
and passtargets
there.. Though, it makes passing other parameters to the 2nd plan much more complicated. One need to merge JSON documents for this.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request