Skip to content
Snippets Groups Projects

Add a custom callback plugin for managing logs

Merged Simone Spinelli requested to merge add_custom_callback_module into develop

To be tested in our collection.

Changes to ansible.cfg:

[defaults]
stdout_callback = filtering_syslog
callback_plugins = ./callback_plugins << Not sure.

How to use it in plays: By default you have no output, if you need the task to be printed add tag [print_action]. Example:

---
- name: A verbose playbook
  hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - name: Print something on screen
      debug:
        msg: "First something"

    - name: Print something on screen again
      debug:
        msg: "Second something"

    - name: Print something on screen and again
      debug:
        msg:
          "Third something very long
          with multiline
          in it
          "
      tags: [print_action]

    - name: Print something on screen again again
      debug:
        msg: "5th something"

Merge request reports

Pipeline #95538 passed

Pipeline passed for f17cb6a9 on add_custom_callback_module

Code Quality is loading

Merged by Aleksandr KurbatovAleksandr Kurbatov 5 days ago (Jul 9, 2025 10:22am UTC)

Loading

Pipeline #95539 passed

Pipeline passed for db86e21e on develop

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading