Workflow Template - Prompted Inventory or pass variable

With usual job templates you can prompt for both what inventory to use and the limit on launch. In the workflow editor there doesn’t seem to be any way of doing this. Can you pass variable names into this box and then have a survey at the beginning or would prompt on launch need to be a new feature request?

Thanks

You can set inventory & limit inside workflows, it’s just done as you add the job template to the tree structure. Also, the job template needs to be set to prompt for inventory or limit before it will let you override these fields.

You can create surveys for workflow job templates, and the variables defined as answers in the survey will be passed to jobs that the workflow runs as --extra-vars.

Hi Alan, Thanks for the reply. I more wanted to be able to set the inventory & limit at the launch of the template. For example I have 2 jobs; 1 that patched a redhat server with yum and another that reboots the server and waits for it to come back. I would like to be able to put these together in a workflow then limit what this runs against as I would only ever want to patch a certain amount of hosts of one service (i.e. 4 production servers running jenkins) at a time not the entire RHEL - Production inventory I have.

With an individual job you can be prompted when you launch it to set a limit each time, you can’t seem to do that with a workflow template so users would need to go in and edit the workflow tree each time they wanted to run it

Regarding this:

I more wanted to be able to set the inventory & limit at the launch of the template.

(the “template” in this case being the workflow job template)

Yes, that would be a new feature request. Similar to how the workflow applies variables to all jobs it runs, it could prompt for limit and apply it to all jobs that it runs. That’s not on the agenda for enhancements right now, but it could be eventually, I see where you’re coming from.

Alan Rominger (arominge@redhat.com) said:

Regarding this:

I more wanted to be able to set the inventory & limit at the launch of the
> template.
>

(the "template" in this case being the workflow job template)

Yes, that would be a new feature request. Similar to how the workflow
applies variables to all jobs it runs, it could prompt for limit and apply
it to all jobs that it runs. That's not on the agenda for enhancements
right now, but it could be eventually, I see where you're coming from.

My concern with this (and the reason why we haven't tried to tackle this
yet) is the semantics when a workflow is already using ten different
inventories across all of its templates... applying a 'single'
inventory/limit at launch time is likely nonsensical there.

Bill

I see where you are coming from with that, I guess with it being an optional field though you would only use it if your jobs inside the workflow were all regarding the same list of hosts. All depends on you job and inventory setups