I actually just submitted a pull request to document the configuration to allow this earlier today.
It looks like it was merged as well. Here is the commit containing the docs: https://github.com/sivel/ansible/commit/c319df78f87d92b1ba8a309d8318436a2454db08 In short, in ansible.cfg under [defaults] set force_color = 1 On Tuesday, September 16, 2014, Jason Harris <[email protected]> wrote: > Hi All, > > I am trying to capture ansible output with a python subprocess command. If > I capture: > > childProcess = subprocess.Popen("ansible-playbook ...", > shell=True, subprocess.PIPE, subprocess.PIPE, cwd=dir) > res = childProcess.communicate() > > Then res[0] will be the stdout of my ansible command, and res[1] will be > the stderr of my ansible command, but both will be uncoloured... > > Is there an easy way to force ansible to always issue colour output > independent of the term type it is detecting? > > Thanks, > Jason > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <javascript:_e(%7B%7D,'cvml','ansible-project%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/089760c2-dbdb-433d-8382-8a2b53cdc7de%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/089760c2-dbdb-433d-8382-8a2b53cdc7de%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz [email protected] http://sivel.net/ -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v8%3DweB0oF0NwPZZaG385Yr3OALarAwyzeAhLjFe9suZhQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
