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.
Installing ANSI Color Plugin:
1. Login to Jenkins with admin privileges.
2. Navigate to Manage Jenkins.
3. Click on “Manage Plugins”.
4. Search for “AnsiColor” and select the plugin. Click on “Install without Restart”.
Configure ANSI Color Plugin in Job:
5. Navigate to Jenkins job which is integrated with Ansible playbook plugin.
6. Navigate to Build environment and check “Color ANSI Color Output”.
7. Click on Build and click on the “Advanced ” tab from “Invoke Ansible Playbook” plugin.
8. Select colorized stdout. Save the job.
Validate our work:
9. It’s time for testing. Execute “Build” and check for console output.
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.
Leave a Reply