Instead of the single log file defined in log_path, I want to have separate log files per playbook run in Ansible.
As far as I know there is no built-in way to do that. So I am looking for clever "hacks".
More specifically, I want after a playbook is ran a log file to be generated in the format [playbook name].[date].log
I found this thread in SO but it doesn't meet my needs. The alias would be a solution if I could pass somehow the playbook name dynamically, not only the date. The lookup solution would be ok if I could copy only the relevant part from the main log file without all the history up until the moment of the copy. Additionally, if you have many playbooks running in parallel I don't know how good this method will work.
Any clues / ideas? What I thought is creating a shell script that would be called inside a playbook to somehow "extract" the relevant entries from the main log and create a separate one. But I believe I am making it too complex.