Quantcast
Viewing all articles
Browse latest Browse all 369

Jenkins Console – Xterm Terminal – Colorized Ansible playbook Output

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.

Image may be NSFW.
Clik here to view.
Ansible -Plain Jenkins console Output
Ansible -Plain Jenkins console Output

 

Installing ANSI Color Plugin:

1. Login to Jenkins with admin privileges.

 

2. Navigate to Manage Jenkins.

Image may be NSFW.
Clik here to view.
Manage Jenkins - Install AnsiColor Plugin
Manage Jenkins – Install AnsiColor Plugin

 

3. Click on “Manage Plugins”.

Image may be NSFW.
Clik here to view.
Manage Plugins - Jenkins
Manage Plugins – Jenkins

 

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

Image may be NSFW.
Clik here to view.
Select AnsiColor Plugin - Ansible - Jenkins
Select AnsiColor Plugin – Ansible – Jenkins

 

Configure ANSI Color Plugin in Job:

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

Image may be NSFW.
Clik here to view.
Configure Job with Ansicolor plugin - Jenkins
Configure Job with Ansicolor plugin – Jenkins

 

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

Image may be NSFW.
Clik here to view.
Enable ANSI color for Job - Jenkins
Enable ANSI color for Job – Jenkins

 

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

Image may be NSFW.
Clik here to view.
Invoke Ansible Playbook - Plugin
Invoke Ansible Playbook – Plugin

 

8. Select colorized stdout. Save the job.

Image may be NSFW.
Clik here to view.
Check - Colorized stdout - Jenkins - Ansible
Check – Colorized stdout – Jenkins – Ansible

 

Validate our work: 

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

Image may be NSFW.
Clik here to view.
ANSIColor - Ansible stdout - Jenkins
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.

The post Jenkins Console – Xterm Terminal – Colorized Ansible playbook Output appeared first on UnixArena.


Viewing all articles
Browse latest Browse all 369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>