Skip to content
An Ansible callback plugin to output suitable for TeamCity
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.gitignore
LICENSE
README.md
log_view_with.png
log_view_without.png
teamcity.py

README.md

Ansible Callback Plugin for Teamcity

Introduction

This Ansible callback plugin formats the output of an Ansible playbook, so that it can be better interpreted by TeamCity.

Why?

Because Ansible logs in Teamcity look like this:

Log without this plugin

With this plugin in place, they look like this:

Log with this plugin

All plays and tasks are nicely put into their own blocks allowing TeamCity to collapse them and calculate the different times.

Usage

You have different options of using this plugin:

  • In your playbook repository:
    • Create a folder named callback_plugins directly where your playbook lives
    • Download the file teamcity.py and place it in inside the callback_plugins directory
  • Somewhere else:
    • Download or clone the plugin, unzip it and place the folder somewhere accessible (i.e. use the Teamcity tools feature to distribute the plugin to all agents)
    • Use the following environment variable to tell Ansible where to find your plugin:
      export ANSIBLE_CALLBACK_PLUGINS=<path of your plugin>

Set the following environment variable to use the plugin:

export ANSIBLE_STDOUT_CALLBACK=teamcity

Then run your playbook.

You can’t perform that action at this time.