I have playbook that, when run by itself, looks up various values on the
ansible host (e.g. the repository version of a roles directory) and writes
them to a log on the ansible target.
The idea being keeping a log of who ran what versions of what playbooks
from where. It's the kind of info you hope to never need but can be
invaluable if you do.
Anyway; here's a snippet.
.....
AnsibleGit: "{{ lookup('pipe', 'git log | head -1') }}"
.....
- shell: echo "{{ EpochTime }} git {{ AnsibleGit }}" >> {{
Log }}
When I include the playbook as one playbook among many in setting up a
server (as opposed to running it standalone) the lookups run on
the target rather than the host.
I can make something that gets that information by other means but I'd
rather use lookup if I can.
Any ideas how to get lookup to always run on the host?
-david
--
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/e7a621a0-0da0-4ccd-b984-983db85e501b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.