I thought
- name: Clone repo
git: repo="{{ git_repo }}"
dest="{{ git_dest }}"
version="{{ git_version | lookup('env','git_version') |
default('master') }}"
notify: reload apache
would work to use the git_version group_var, ENV if it was set and master
otherwise.
I think I was thinking of | as or rather than a filter when I first wrote
it but still can't figure out how to do what I want, weirdly the error is
stderr: fatal: '{{git_repo}}' does not appear to be a git repository
so I think the whole Jinja templating fails.
If I do
lookup('env','git_version') | default('master')
It gets '' if the env var is not set, rather then taking the default as I
hoped
Thanks,
Tom
--
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/3dd58b3e-f9ab-447d-8221-0a56b798bb37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.