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
- 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.
- 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
- This is my playbook ( again just a example )
--- - hosts: "{{ target }}" gather_facts: no tasks: - name: Gather Hostname information shell: hostname register: hostname_result - debug: var=hostname_result.stdout_lines
- I have created one job template , with Survey to provide hostname where they want to run this job .
I see when we put * on that survey , this job template gets executed on all the hosts , which we do not want that.
Can anyone let me know how we can restrict users to put exact host details, not any regex or * ?
Appreciate your help.