To preface; I apologize for asking what is probably a very simple question, but no matter what I try, it just doesn’t work.
I want to collect the output of an Ansible run in a Gitlab pipeline, format it, and send an e-mail with the results - preferably without additional software (like ARA). I came across the log_plays callback plugin and thought it to be exactly the thing that I needed for that first step. However, I cannot seem to get it to work, and I don’t know what I’m missing.
I have the community.general collection installed through ansible-galaxy install -r requirements.yml with the following requirements file:
---
collections:
- name: community.general
version: "13.5.0"
source: https://galaxy.ansible.com
I have enabled the callback plugin in ansible.cfg:
[defaults]
callbacks_enabled = community.general.log_plays
[callback_log_plays]
log_folder = /tmp/log/ansible_hosts
I cannot find any examples of people explicitly enabling the callback or running it in a dedicated job or the like, so as far as I’m aware, it should generate the log files. However, when I check my submitted directory, it is empty. I have also checked the directory above it in case it treats the directory as a file to write to and the default /var/log/ansible/hosts directory in case it ignores it, but all of them were empty. My community general collection version is 13.5.0, Ansible version is 2.16.19. I didn’t get any notification that those were incompatible, but perhaps that is the issue.
Does anyone here know what I might be missing, or what I could investigate to help debug this further? Any help or tips are much appreciated!