Using lookup with log_path in ansible.cfg

124 views
Skip to first unread message

Kevin Ying

unread,
Aug 31, 2016, 2:12:24 PM8/31/16
to Ansible Project
I've seen some examples referring to the use of lookup with log_path to log output to datestamped logfiles:

e.g.

log_path = ~/.ansible/logs/ansible.{{ lookup('pipe', 'date +%Y%m%d') }}.log

I've been trying various permutations of this pattern but nothing seems to work.  File permissions are correct as the logfile that is written to is quite literally the label from above including the curly braces and parens.

Is this use of lookup with log_path in ansible.cfg no longer supported?

Brian Coca

unread,
Sep 20, 2016, 11:29:20 AM9/20/16
to ansible...@googlegroups.com
This won't work, I don't believe it ever has as there is no general templating support in ansible.cfg. 

A few things like `ansible_managed` have a 'special' substitution or use of ~/ or $HOME for some paths, but nothing  allows for lookups or any other jinja2 templating.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages