vars_prompt variables aren't being expanded with inventory scoped variables, because the question is only going to be asked once. Therefore it's storing the literal string value.
I really don't recommend relying on vars_prompt because playbooks really should be non-interative, "-e" extra variables also work a bit more nicely. You can still define defaults if the variables are not there using the "| default" Jinja2 function. On Wed, Aug 27, 2014 at 3:46 PM, Jeremy Gailor <[email protected]> wrote: > Can anyone explain to me if this just doesn't work or if I'm doing > something wrong; > > /production > [webapps:vars] > default_branch=master > > /staging > [webapps:vars] > default_branch=staging > > /my_playbook.yml > - hosts: webapps > vars_prompt: > - name: "release_branch" > prompt: "Deploy Branch:" > default: "{{default_branch}}" > > > Basically is just takes the text in 'default' verbatim (i.e. - no > substitution). Given how Ansible puts itself into the deployment process, > and how well that actually works, this is a really common use case that it > feels like should be supported. > > -- > 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/90b98beb-1b0a-4023-9026-c845d3f5c03d%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/90b98beb-1b0a-4023-9026-c845d3f5c03d%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%2BnsWgx4PaBi81GdQf6o_YkhCC_qsT7hV8Wr1sQa7CU-4cKJ6A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
