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 _< 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?