Hey Folks
So while executing playbooks via the PlaybookExecutor API , I want to pass my custom callback derived from CallbackBase + also to get the log file written with an command line like output.
run_pbook = PlaybookExecutor(
playbooks=[playbook], inventory=inventory, loader=loader,
variable_manager=variable_manager, options=options,
passwords=passwords
)
callback = ResultCallback() ----->My custom call back for API responses
run_pbook._tqm._stdout_callback = callback-----------------> this accepts only one stdout call back
So I am wondering how would I achieve my use case of writing an command-line like output to log files
Things tried so far
- when using PlaybookExecutor call , the log_path in ansible.cfg does get written to.
- I wanted to capture sys.stdout and sys.stderr to lo streaming- but though it captures warnings but not the actual TASK and Play output.
I would really appreciate some help on how I can achieve this .
Regards
VB