Workflow Template - Prompted Inventory or pass variable

822 views
Skip to first unread message

Martyn Kempster

unread,
Nov 17, 2017, 8:23:42 AM11/17/17
to AWX Project
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

Alan Rominger

unread,
Nov 17, 2017, 8:33:57 AM11/17/17
to Martyn Kempster, AWX Project
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.

Alan
github: AlanCoding

On Fri, Nov 17, 2017 at 8:23 AM, Martyn Kempster <mkemps...@gmail.com> wrote:
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 received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/16925ec1-2d5d-4281-b0ed-0ceaa82c866e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martyn Kempster

unread,
Nov 17, 2017, 8:47:20 AM11/17/17
to AWX Project
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


On Friday, November 17, 2017 at 1:33:57 PM UTC, Alan Rominger wrote:
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.

Alan
github: AlanCoding

On Fri, Nov 17, 2017 at 8:23 AM, Martyn Kempster <mkemps...@gmail.com> wrote:
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 received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.

Alan Rominger

unread,
Nov 17, 2017, 9:05:15 AM11/17/17
to Martyn Kempster, AWX Project
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
github: AlanCoding

To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.

To post to this group, send email to awx-p...@googlegroups.com.

Bill Nottingham

unread,
Nov 17, 2017, 10:05:48 AM11/17/17
to Alan Rominger, Martyn Kempster, AWX Project
Alan Rominger (arom...@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

Martyn Kempster

unread,
Nov 20, 2017, 3:30:36 AM11/20/17
to AWX Project
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
Reply all
Reply to author
Forward
0 new messages