Restrict user providing asterisk * on the prompt

Hello Everyone,

I am trying to create a self service job template for our users through Ansible AWX , and want to restrict the users to mention the exact host detail where they want to run the job.

During testing I have noticed , If on the limit ( I have enabled prompt on launch ) one provides “*” , it executes on every node in the inventory , which is something I want to avoid and not let happen.

So let me explain you my requirement first

  1. User will login as themselves and run a job template . This job template needs to be run on node or pattern of node or group mentioned by that user.
  2. So I do not want to restrict execution of this playbook to a single group or multiple groups , I would like to promt user to provide hostname where they want to execute this playbook.

How I am trying to achieve this

  1. This is my playbook ( again just a example )

How many hosts do you have? If they are not many, you could do a multiple choice question on the survey. Then they will be forced to pick one of the hosts defined there.

Nearly 900 and counting, not feasible .Thanks though for suggestion.

Why not have a task at the top of your template that checks for regex which in turn will fail the entire job?

Thanks,

John Foley
LOC

Thanks , Thats a good suggestion, I tried something like this

This is resolved now … Thank you

solution