# Cannot get log\_plays callback to work

**URL:** <https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504>\
**Category:** Get Help\
**Tags:** callback, galaxy-ng\
**Created:** [October 21, 2026, 9:23am UTC](https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504 "2026-10-21T09:23:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ab203972](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ab203972](https://forum.ansible.com/u/ab203972)\
**Post date:** [October 21, 2026, 9:23am UTC](https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504/1 "2026-10-21T09:23:23Z")

</div>

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:

```yaml
---
collections:
  - name: community.general
    version: "13.5.0"
    source: https://galaxy.ansible.com

```

I have enabled the callback plugin in ansible.cfg:

```ini
[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!

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [October 21, 2026, 10:40am UTC](https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504/2 "2026-10-21T10:40:45Z")

</div>

> [@ab203972](#):
>
> I cannot find any examples

It works for me with 2.21. See [callback community.general.log\_plays](https://github.com/vbotka/ansible-examples/tree/master/examples/example-250).

---

<div class="post-metadata">

**Author:** ![Rei\_Kurosawa](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Rei\_Kurosawa](https://forum.ansible.com/u/Rei_Kurosawa)\
**Post date:** [October 21, 2026, 1:34pm UTC](https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504/3 "2026-10-21T13:34:27Z")

</div>

One thing worth checking first: whether the ansible.cfg you edited is actually the one being read in your GitLab job (ansible-config dump --only-changed in the pipeline shows the effective config). The log\_plays plugin normally creates its log folder on startup (makedirs\_safe in the plugin source), so which folders exist or get created can hint at which config took effect; just note a missing custom folder can also mean the path resolved differently, for example via ANSIBLE\_LOG\_FOLDER or an ini typo falling back to the default /var/log/ansible/hosts. ansible-doc -t callback community.general.log\_plays is a decent smoke test that the plugin is discoverable, though it does not prove it is enabled at runtime. One more hypothesis: the community.general 13.x series declares requires\_ansible \>= 2.18 in its published meta/runtime.yml (your installed copy carries the same file) while you are on core 2.16, so that combination is not officially supported. If the callback errors during a run Ansible only prints a warning, so the start of the job log is worth a scan.

Assisted-by: LLM (drafting, source lookup)

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 21, 2026, 2:23pm UTC](https://forum.ansible.com/t/cannot-get-log-plays-callback-to-work/46504/4 "2026-10-21T14:23:47Z")

</div>

`ansible-config` has a `dump` option (very useful with `--only-changed` flag) and a `verify` option, both should help ensure your configuration is what you expect.
