Prompt in ansible

17 views
Skip to first unread message

ryad9...@gmail.com

unread,
Feb 12, 2019, 9:52:45 AM2/12/19
to Ansible Project
Hi all,

Why when i use prompt in playbook.yml it's works but not in /roles/tasks/main.yml ??

-  vars_prompt:
     - name: reponse
       prompt: "Voulez-vous effectuer ce deploiement ? (o/n)"

When i use prompt in my main playbook it's work when i launch this line commande :

ansible-playbook playbook.yml


Pcis

unread,
Feb 12, 2019, 10:06:09 AM2/12/19
to Ansible Project
To prompt in a task you have to pause, you can only prompt without a pause inside -  vars_prompt:

e.g.

under tasks use:

- pause:
    prompt: "Voulez-vous effectuer ce deploiement ? (o/n)"
  register: response

ryad9...@gmail.com

unread,
Feb 12, 2019, 10:58:09 AM2/12/19
to Ansible Project
Thank you for your answer Pcis !! :)

In the ansible documentation, there is not this explication.

Now it's work !! ^^

You are the best ;)

subject solved
Reply all
Reply to author
Forward
0 new messages