How to set ansible facts to logs

71 views
Skip to first unread message

Siddharth Thakur

unread,
Jan 4, 2024, 10:05:49 AM1/4/24
to Ansible Project
I have a scenario where I am executing my Ansible playbook with Jenkins. I have to save the execution output in a txt file which the ansible itself should generate. 

The naming convention of the log file should be like <system data and time >_< Jenkins build number >.json.

The log should contain the exact status of the execution. If the execution failed then the failure reason should go to logs and if it is successful then what tasks get executed successfully should go to logs.

Does anyone know how to do this?

Brian Coca

unread,
Jan 4, 2024, 10:59:56 AM1/4/24
to ansible...@googlegroups.com
The simplest way would be a callback, the `tree` callback already does
something similar, I don't know if any of the existing do exactly what
you want, but it should be easy to modify the `tree` one to do so.


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

Siddharth Thakur

unread,
Jan 5, 2024, 2:23:36 AM1/5/24
to Ansible Project
Can you share any web-link where I can find more information regarding tree and more details.

Dick Visser

unread,
Jan 5, 2024, 3:58:02 AM1/5/24
to ansible...@googlegroups.com
On Fri, 5 Jan 2024 at 08:23, Siddharth Thakur <siddharth.thak...@gmail.com> wrote:
Can you share any web-link where I can find more information regarding tree and more details.

Reply all
Reply to author
Forward
0 new messages