Ansible plays are hashes, they are a collection of attributes.

Tasks are an ordered list.

Thus including "vars_prompt" ahead or behind "tasks" makes no difference.

vars_prompt happens before the current play runs, every time.

You can solve this problem by stopping the current play, starting a new one
with a vars_prompt in it, and then continuing, since a playbook can contain
multiple plays in a single file.




On Tue, Sep 9, 2014 at 1:25 PM, Tiglath <[email protected]> wrote:

>
>
> My test playbook for the flow I want is shown below:
>
> I want some work done, then prompt the user, then more work, a pause, and
> the end.
>
> The thing is that the prompt comes up even before gathering facts, not as
> suggested by its placement in the playbook.
>
> Can the prompting be done between tasks?
>
> Thanks
>
>
>
>
> ---
>
> hosts: "{{ target }}"
>
> tasks:
>
>       - name: boo
>
>         debug: msg="vars {{ inventory_hostname }} , env {{ env }} op {{
> op }} rel {{ rel }}"
>
>       - name: build the release
>
>         debug: msg="building"
>
>       - name: installing/updating
>
>         debug: msg="installing"
>
>
>
> hosts: "{{ target }}"
>
>       vars_prompt:
>
>       ltvup: "Is the app up on {{ target }} ? (y/n): "
>
>       tasks:
>
>            - name: Stop app
>
>              debug: msg="the server is {{ ltvup }}"
>
>            - name: postinstall
>
>              debug: msg="post"
>
>            - name: wait
>
>              pause: prompt="Have admins do sudo blah blah blah"
>
>   cleanup tasks here.
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e78ba643-6db5-4ffb-9af5-ab90daf811d7%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/e78ba643-6db5-4ffb-9af5-ab90daf811d7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxGbg_i%3D2JdOS0ONfyPp7j3TtFA47_guRXOLZLobMfhzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to