# Playbook | Prompt to confirm before to do some action

**URL:** <https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608>\
**Category:** Get Help\
**Created:** [October 3, 2025, 3:33pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608 "2025-10-03T15:33:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chumi](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@chumi](https://forum.ansible.com/u/chumi)\
**Post date:** [October 3, 2025, 3:33pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/1 "2025-10-03T15:33:56Z")

</div>

Hi,

I like to ask a confirmation at prompt before some action.  
But the plabook skipped all the tasks.

Here is the plabook:

> * * *
> 
> - name: domain management  
> hosts: foo  
> gather\_facts: true

Here is the output:\>

> ok: [machine]
> 
> TASK [Group hosts by distribution] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [machine]
> 
> TASK [Confirmation to quit the domain] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [machine]
> 
> TASK [Run leave\_ad role] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [machine]
> 
> TASK [Confirmation to join the domain] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [machine]
> 
> TASK [Run join\_ad role] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [machine]
> 
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> machine : ok=2 changed=0 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0

Thanks for in advance.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 3, 2025, 3:35pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/2 "2025-10-03T15:35:28Z")

</div>

In your case, the tasks are being skipped, probably because `"YES"` is not an exact match to the input, use a `debug` action to confirm the content.

Just FYI, the prompts themselves are skipped in 2 cases:

- no tty, ansible assumes it is in batch mode
- The variable requested has already been provided at higher precedence, like via an extra var.

---

<div class="post-metadata">

**Author:** ![chumi](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@chumi](https://forum.ansible.com/u/chumi)\
**Post date:** [October 3, 2025, 4:14pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/3 "2025-10-03T16:14:55Z")

</div>

There are no extra variable.  
When running the playbook on a console, it does not _ask_ the confirmation, it just run and skipped the tasks.  
I expected a pause and the question into the console, but nothing.

I remove the ‘vars’ and ‘user’ and ‘password’ in var\_prompt to see the behavior but it is not better.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 3, 2025, 4:19pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/4 "2025-10-03T16:19:44Z")

</div>

i should have been more explicit, i used extra vars as an example, but you are setting the `domain_join_credentials` and `domain_join_user` already in `vars:` , those will never prompt, i’m guessing something similar is going on with the `action_leave_domain`

---

<div class="post-metadata">

**Author:** ![chumi](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@chumi](https://forum.ansible.com/u/chumi)\
**Post date:** [October 3, 2025, 5:09pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/5 "2025-10-03T17:09:05Z")

</div>

> [@bcoca](#):
>
> domain\_join\_credentials

Yes, i am aware about that declaration.  
To try to debug, i disabled the ‘vars’ and ‘var\_prompt’ of these declarations.

But i expected a different behaviour with join and leave domain action.  
But there is no prompt.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [October 5, 2025, 1:10am UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/6 "2025-10-05T01:10:25Z")

</div>

Have you verified that `machine` is in `foo`? That would cause skips also I think.

---

<div class="post-metadata">

**Author:** ![chumi](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@chumi](https://forum.ansible.com/u/chumi)\
**Post date:** [October 8, 2025, 3:52pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/7 "2025-10-08T15:52:35Z")

</div>

It is probably the error that is from the way i enter the vault to run the playbook.

> pass ansible/vault | head -1 | ansible-playbook --vault-password-file=/bin/cat -i inventories/template …

stdin is already used.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 8, 2025, 3:56pm UTC](https://forum.ansible.com/t/playbook-prompt-to-confirm-before-to-do-some-action/44608/8 "2025-10-08T15:56:23Z")

</div>

that will fall under the ‘no tty’ reason why `vars_prompt` won’t prompt
