# Ansible-playbooks now in full technicolor

**URL:** <https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717>\
**Category:** Ansible Project\
**Created:** [July 24, 2012, 11:40pm UTC](https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717 "2012-07-24T23:40:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 24, 2012, 11:40pm UTC](https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717/1 "2012-07-24T23:40:08Z")

</div>

@jp\_mens pushed some very nice additions this morning to colorize parts of playbooks. Failure counts in red, success in green, changes in yellow.

I've taken this a bit further and applied this to the rest of ansible playbook output. Job status messages for async show up in blue.

Let me know if you have any issues with the tty detection NOT working or anything else, and if you really don't like it, set ANSIBLE\_NOCOLOR=1

As with past releases, it works especially well if cowsay is installed.

--Michael

---

<div class="post-metadata">

**Author:** ![Chamberlain\_Darren](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Chamberlain\_Darren](https://forum.ansible.com/u/Chamberlain_Darren)\
**Post date:** [July 25, 2012, 12:43am UTC](https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717/2 "2012-07-25T00:43:13Z")

</div>

Got this from a fresh git clone:

TASK: [Create /etc/services] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [bcomdhcp5029] =\> Traceback (most recent call last):  
&nbsp;&nbsp;&nbsp;File "/usr/local/ansible/lib/ansible/runner/\_\_init\_\_.py", line 445,  
in \_executor  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exec\_rc = self.\_executor\_internal(host)  
&nbsp;&nbsp;&nbsp;File "/usr/local/ansible/lib/ansible/runner/\_\_init\_\_.py", line 485,  
in \_executor\_internal  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return self.\_executor\_internal\_inner(host, inject, port)  
&nbsp;&nbsp;&nbsp;File "/usr/local/ansible/lib/ansible/runner/\_\_init\_\_.py", line 600,  
in \_executor\_internal\_inner  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.callbacks.on\_failed(result.host, data)  
&nbsp;&nbsp;&nbsp;File "/usr/local/ansible/lib/ansible/callbacks.py", line 271, in  
on\_failed  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return color.string(msg, 'red')  
NameError: global name 'color' is not defined

$ env | grep -i ansible  
ANSIBLE\_NOCOLOR=1  
ANSIBLE\_LIBRARY=/usr/local/ansible/library  
PATH=/usr/local/ansible/bin:/usr/bin:/bin  
PYTHONPATH=/usr/local/ansible/lib

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 25, 2012, 1:32am UTC](https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717/3 "2012-07-25T01:32:02Z")

</div>

Fix pushed.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 26, 2012, 1:29am UTC](https://forum.ansible.com/t/ansible-playbooks-now-in-full-technicolor/11717/4 "2012-07-26T01:29:07Z")

</div>

I’ve made some updates to change ‘black’ to the default color, as well as change the darker blue to cyan, so if you were using a black terminal and secretly cursing my name, it looks pretty decent now, and you might like it. Not entirely happy with yellow-on-white

Apologies to Kenny Wayne Shepherd for the commit message:

[https://github.com/ansible/ansible/commit/e035ce97ce893fab9a1b8ccb37fc2e2b80c406b8](https://github.com/ansible/ansible/commit/e035ce97ce893fab9a1b8ccb37fc2e2b80c406b8)

Could probably change the red to “bright red” if that would make it easier to see.
