Ansible shell command run by gitlab-runner is missing its color, can we fix that?

I’m running Ansible playbooks via gitlab-ci schedules. Unfortunately, the output when viewing the job is missing the colors Ansible sets when run in a normal terminal.

Is there a way to tell GitLab-CI to use the colors Ansible sets?

Specifically, I really would like the failed tasks to be colored red. That makes troubleshooting a lot easier…

I believe this is the relevant code in Ansible:


Have you tried setting the ANSIBLE_FORCE_COLOR=true variable ?

1 Like

No. Is that an environment variable?

Yup. See

Awesome! It worked. Thanks! :slight_smile: