# Prompt option listing all the servers in inventory

**URL:** <https://forum.ansible.com/t/prompt-option-listing-all-the-servers-in-inventory/37349>\
**Category:** Ansible Project\
**Created:** [November 14, 2022, 9:40pm UTC](https://forum.ansible.com/t/prompt-option-listing-all-the-servers-in-inventory/37349 "2022-11-14T21:40:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veera](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/veera/32/4107_2.png) [@Veera](https://forum.ansible.com/u/Veera)\
**Post date:** [November 14, 2022, 9:40pm UTC](https://forum.ansible.com/t/prompt-option-listing-all-the-servers-in-inventory/37349/1 "2022-11-14T21:40:07Z")

</div>

Hi ,

I am trying to confirm the hosts which are selected for the execution with the prompt option. However I am prompted with all the servers in my inventory .(not sure how it pulls , may be _ansible\_play\_batch)_

Help me on what i am missing?

_- name: Playbook to update the package in the given list of servers_

_hosts: server1_  
_gather\_facts: no_

_vars\_files:_  
_- vars/postcheck\_vars.yml_

_vars\_prompt:_  
_- name: confirm the below list of servers are part of patching for the given wave_  
_prompt: \>-_  
_You have selected {{ ansible\_play\_batch }} . Do you want to continue? Press y_

_tasks:_  
_- name: Waiting for confirmation_  
_fail:_  
_when: confirm.lower() != ‘y’_

_**If i replace server1 with group1 , all the servers in the group has to be listed(prompted) before the execution of the play .**_
