No more colors in console output with AnsiColorBuildWrapper after Jenkins update

Viewed 276

Since we have updated to Jenkins version 2.235.1 the colors are not displayed correctly in the console output when using AnsiColorBuildWrapper. This makes it more difficult to get a correct overview of the Ansible output.

The Snipped in our Jenkins-Workflow

wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
                println(("\033[31m  ************************** ${role} wird ausgerollt *************************** \033[0m"))
         }
         configFileProvider([configFile(fileId: '1609a7e4-2674-4cef-9945-db9492f2dcd6', variable: 'vaultPassWord')]) {
             wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {               
                 ansiblePlaybook colorized: true, credentialsId: 'app-serveraccess-user',
                 extras: "--extra-vars='env=${currentStage}' --extra-vars='workspace=${workspace}' --extra-vars='app=${app}' -l ${hostname.toLowerCase()} --vault-password-file ${env.vaultPassWord} ${debug_ansible}", installation: 'Ansible',
                 inventory: '/vol1/ansible/hosts', playbook: "/etc/ansible/playbooks/${role}/${role}_config.yml",
                 sude: true, sudoUser: null                          
             }//wrap 
         }//configFileProvider 

The result in the Console Output:

[159] $ sshpass ******** /usr/bin/ansible-playbook /etc/ansible/playbooks/app/app_config.yml -i /vol1/ansible/hosts -u devadmin -k --extra-vars=env=oat --extra-vars=workspace=/vol1/jenkins/jobs/SERVER-CONFIG-WF/pipeline/159 --extra-vars=app=app -l server-app-r0001.com --vault-password-file /vol1/jenkins/jobs/SERVER-CONFIG-WF/pipeline/159@tmp/config1179695197260634236tmp --diff
17:02:25  [0;35m[DEPRECATION WARNING]: DEFAULT_SUDO_EXE option, In favor of become which is a [0m
17:02:25  [0;35mgeneric framework . This feature will be removed in version 2.8. Deprecation [0m
17:02:25  [0;35mwarnings can be disabled by setting deprecation_warnings=False in ansible.cfg.[0m
17:02:25  [0;35m[DEPRECATION WARNING]: DEFAULT_SUDO_USER option, In favor of become which is a [0m
17:02:25  [0;35mgeneric framework . This feature will be removed in version 2.8. Deprecation [0m
17:02:25  [0;35mwarnings can be disabled by setting deprecation_warnings=False in ansible.cfg.[0m
17:02:25  [1;35m [WARNING]: Found both group and host with same name: localhost[0m

Instead of colors you now see the control strings python uses to create them on the console

All plugins are up to date

What can we do to solve this problem?

0 Answers
Related