vars_prompt goes on the play level, not the task level. It's not a
task and you don't have control over when the prompt happens. It will
ask you before the play starts to answer any questions in the prompt.

Just a helpful way to think about what can go in the task list: Is it
a module? (
http://docs.ansible.com/list_of_all_modules.html). If not, then it
can't be a task.


On Wed, Oct 15, 2014 at 2:02 PM, Tiglath <te...@tiglath.net> wrote:
>
> Between my lack of Ansible mastery and its kind of syntax, rare is the day I
> don't get stuck...
>
> Either the syntax is not intuitive or I have no intuition.
>
> I am trying to do something very simple and it seems very complicated in
> Ansible.  I hope it just seems so.
>
> I  figure out what release to deploy in a play and then confirm the release
> is correct, if not all stops, if correct run with the wind...
>
> So:
>
> If I put vars_prompt between the tasks it gives an error.   Where can the
> prompt go then?    When is code position indicative of order of execution
> and when not?
>
>
> ---
>
> hosts: appserver
>
> tasks:
>
> - name: Get the latest release.
>
>    local_action: shell grep XXX  /tmp/releases | cut -f2 -d':' | tr -d "," |
> tr -d "'"
>
>    register: rel
>
> --->>><  "Deploying release {{ rel.stdout }} Correct?  (y/n): "  > prompt
> goes here  <<< ----
>
> - name: Remove old installation files.
>
>   script: /tmp/clean.sh "{{ rel.stdout }}"
>
> - name: Run local build.
>
>   local_action: shell /tmp/build.py "{{ inventory_hostname }}" "{{
> rel.stdout }}"
>
> - name: Run deploy.py on target.
>
> script: /export/home/jsuriol/deploy/migration/apps/TV2G/tools/deploy.py "{{
> rel.stdout }}"
>
> Thank you for your patience with neophites...
>
>
>
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/1bbaf9f6-56df-41fa-b3fb-c78faa2d980b%40googlegroups.com.
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJQqANejGW3-HLou6ztRN8_fPvBM-aesb6vzZn%3DVDm9piVB3kg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to