https://github.com/dodevops/ansible-teamcity-callback
An Ansible callback plugin to output suitable for TeamCity
https://github.com/dodevops/ansible-teamcity-callback
ansible ansible-playbook output python teamcity
Last synced: 5 months ago
JSON representation
An Ansible callback plugin to output suitable for TeamCity
- Host: GitHub
- URL: https://github.com/dodevops/ansible-teamcity-callback
- Owner: dodevops
- License: mit
- Created: 2019-04-24T11:43:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-25T12:30:39.000Z (about 6 years ago)
- Last Synced: 2025-03-30T12:22:27.641Z (6 months ago)
- Topics: ansible, ansible-playbook, output, python, teamcity
- Language: Python
- Size: 599 KB
- Stars: 22
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Callback Plugin for Teamcity
## Introduction
This [Ansible](https://ansible.com) [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:

With this plugin in place, they look like this:

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](https://raw.githubusercontent.com/dodevops/ansible-teamcity-callback/master/teamcity.py) and place it in inside the `callback_plugins` directory
* Somewhere else:
* [Download](https://github.com/dodevops/ansible-teamcity-callback/archive/master.zip) or [clone](https://github.com/dodevops/ansible-teamcity-callback.git) the plugin, unzip it and place the folder somewhere accessible (i.e. use the [Teamcity tools feature](https://confluence.jetbrains.com/display/TCD18/Installing+Agent+Tools) to distribute the plugin to all agents)
* Use the following environment variable to tell Ansible where to find your plugin:\
`export ANSIBLE_CALLBACK_PLUGINS=`Set the following environment variable to use the plugin:
export ANSIBLE_STDOUT_CALLBACK=teamcity
Then run your playbook.