different log_path per ansible-playbook run?

27 views
Skip to first unread message

Dick Visser

unread,
Apr 2, 2024, 10:05:04 AM4/2/24
to ansible...@googlegroups.com
Hii

I am currently logging output of playbook runs by setting in ansbile.cfg:

log_path = ansible.log

What would be the simplest way to have one file per playbook run?
I tried to use jinja in ansible.cfg but that didn't work...

thx

Dick

Brian Coca

unread,
Apr 2, 2024, 11:32:16 AM4/2/24
to ansible...@googlegroups.com
Most configuration settings are not templatable, but you can always do
it when calling it:
for playname in "play1 play2 play3"; do
ANSIBLE_LOG_PATH="ansilbe.${playname}.log" ansilbe-playbook
"${playname}.yml"; done


--
----------
Brian Coca (he/him/yo)

Dick Visser

unread,
Apr 2, 2024, 3:39:56 PM4/2/24
to ansible...@googlegroups.com
thx, we already use a shell wrapper anyway so this is easy to do.
> --
> 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 ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7e-FbcY7GCh4vwRQqu_PqL1x-NxW1Z16bjbFz4j%2BTgkbQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages