Site icon UnixArena

Jenkins Console – Xterm Terminal – Colorized Ansible playbook Output

Logo - ANSI Color Jenkins

Logo - ANSI Color Jenkins

This artcile will walk through the installing and configuring Ansicolor plugin in Jenkins to make colorized output in ansible playbook stdout. Jenkins console is very plain and simple. If you are using Jenkins to run the ansible playbook, you might notice that colorful output might be missing. Ansible Tower/AWX offers the colorful stdout in the consoles. We could turn Jenkins too post the similar output when you install AnsiColor plugin. This would turn Jenkins to bring the most familiar playbook color codes. (Green – OK,  Orange for – Changed, Red for Std Error ).

 

By default, we would get output like the following snap.

Ansible -Plain Jenkins console Output

 

Installing ANSI Color Plugin:

1. Login to Jenkins with admin privileges.

 

2. Navigate to Manage Jenkins.

Manage Jenkins – Install AnsiColor Plugin

 

3. Click on “Manage Plugins”.

Manage Plugins – Jenkins

 

4. Search for “AnsiColor” and select the plugin. Click on “Install without Restart”.

Select AnsiColor Plugin – Ansible – Jenkins

 

Configure ANSI Color Plugin in Job:

5. Navigate to Jenkins job which is integrated with Ansible playbook plugin.

Configure Job with Ansicolor plugin – Jenkins

 

6. Navigate to Build environment and check “Color ANSI Color Output”.

Enable ANSI color for Job – Jenkins

 

7. Click on Build and click on the “Advanced ” tab from “Invoke Ansible Playbook” plugin.

Invoke Ansible Playbook – Plugin

 

8. Select colorized stdout. Save the job.

Check – Colorized stdout – Jenkins – Ansible

 

Validate our work: 

9. It’s time for testing.  Execute “Build” and check for console output.

ANSIColor – Ansible stdout – Jenkins

 

We have successfully installed and configured the ANSI Color plugin on Jenkins. We have got the beautiful colorized Ansible playbook output similar to AWX/ Ansible Tower.

Exit mobile version