menu prompts

96 views
Skip to first unread message

Jim McMahon

unread,
Oct 18, 2014, 9:31:15 AM10/18/14
to ansible...@googlegroups.com
All of the examples I've seen with Ansible prompts have been simple single line prompts.  For example,

  vars_prompt:
    name: "what is your name?"
    quest: "what is your quest?"
    favcolor: "what is your favorite color?"
Is there any way to make a prompt include newlines or a menu like this:
what's your favorite color?
1) red
2) green
3) blue


Michael Peters

unread,
Oct 19, 2014, 5:37:22 PM10/19/14
to ansible...@googlegroups.com
Try embedding new line characters in your prompt string:

vars_prompt:
name: "what is your name?"
quest: "what is your quest?"
favcolor: "what is your favorite color?\n 1) red\n 2) green\n 3) blue"
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/2d2dea88-22a1-47c2-a407-f04fbcb1c7b5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jim McMahon

unread,
Oct 20, 2014, 2:13:07 PM10/20/14
to ansible...@googlegroups.com
It works!  I thought I tried this before, but it worked this time.  Thanks.
Reply all
Reply to author
Forward
0 new messages