I'm implementing a role, which calls an external application (using shell-module). That application can color its output to make it easier on human eyes.
I'd like to enable -- or disable -- that coloring depending on whether Ansible's own coloring of output is enabled, either because its stdout is a TTY, or because force_color is set.
But how do I detect this? There is no ansible_force_color, for example...
You can use the
configlookup to access Ansible configuration: