# Restrict user providing asterisk \* on the prompt

**URL:** <https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [January 24, 2019, 8:56am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512 "2019-01-24T08:56:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamlightsocialxen](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@iamlightsocialxen](https://forum.ansible.com/u/iamlightsocialxen)\
**Post date:** [January 24, 2019, 8:56am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/1 "2019-01-24T08:56:32Z")

</div>

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 )

---

<div class="post-metadata">

**Author:** ![Darkhan](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Darkhan](https://forum.ansible.com/u/Darkhan)\
**Post date:** [January 24, 2019, 12:49pm UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/2 "2019-01-24T12:49:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iamlightsocialxen](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@iamlightsocialxen](https://forum.ansible.com/u/iamlightsocialxen)\
**Post date:** [January 25, 2019, 1:40am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/3 "2019-01-25T01:40:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Foley\_John](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@Foley\_John](https://forum.ansible.com/u/Foley_John)\
**Post date:** [January 25, 2019, 2:06am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/4 "2019-01-25T02:06:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iamlightsocialxen](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@iamlightsocialxen](https://forum.ansible.com/u/iamlightsocialxen)\
**Post date:** [January 25, 2019, 3:55am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/5 "2019-01-25T03:55:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iamlightsocialxen](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@iamlightsocialxen](https://forum.ansible.com/u/iamlightsocialxen)\
**Post date:** [January 25, 2019, 5:38am UTC](https://forum.ansible.com/t/restrict-user-providing-asterisk-on-the-prompt/29512/6 "2019-01-25T05:38:18Z")

</div>

This is resolved now … Thank you

solution
