(A) The lookup plugin will return empty string, not None, if that env is not found.
However that is still False in Python. That's curious and may be related to how "default" is implemented. Will have to try that. (B) In YAML, the first is a string, the second is a boolean. As passed to arguments in ansible modules that take booleans, both will do the right thing. On Fri, Jul 18, 2014 at 9:02 AM, Yasir Saleem <[email protected]> wrote: > Hi, > I want to important env variables as fellow in a group_vars file.: > > project_id: "{{ lookup('env','PROJECT_ID') | default('FOO_PROJECT') }}" > > I want it to pick default value if ENV variable is not defined. Default > part is not working. Am I doing it right? Is there a better way to do it? > > > Another unrelated question: > > What is difference between? > > flag: 'True' > flag: True > > Thanks, > Yasir. > > -- > 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/b238a149-c601-4329-be35-199296d23729%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/b238a149-c601-4329-be35-199296d23729%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%2BnsWgyDbGSDVUDhxTWaBTN5WyVCFAZbzw%2BPsiu7QyCkAAG-cw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
