Dear All,
Is there any way of pulling out the output of an ansible-playbook called by “command” module in another playbook?
I’m doing it as a workaround against dynamic inventory. The first playbook actually runs a script that generates a “var” file which is used by the second playbook.
I’m trying: “debug: output.stdout_lines”, but it gives output with lot of unwanted information and all in yellow color.
changed: [127.0.0.1 → 127.0.0.1] => (item=TASK: [run_test | Compiling Results] **************************************** )
changed: [127.0.0.1 → 127.0.0.1] => (item=changed: [192.168.1.28])
changed: [127.0.0.1 → 127.0.0.1] => (item=changed: [192.168.1.21])
changed: [127.0.0.1 → 127.0.0.1]
changed: [127.0.0.1 → 127.0.0.1] => (item=TASK: [run_test | Fetching Results] ***************************************** )
changed: [127.0.0.1 → 127.0.0.1] => (item=changed: [192.168.1.28])
changed: [127.0.0.1 → 127.0.0.1] => (item=changed: [192.168.1.21])
changed: [127.0.0.1 → 127.0.0.1] => (item=TASK: [command python cat_stats.py] ***************************** )
changed: [127.0.0.1 → 127.0.0.1] => (item=changed: [127.0.0.1])
changed: [127.0.0.1 → 127.0.0.1]
changed: [127.0.0.1 → 127.0.0.1] => (item=PLAY RECAP ******************************************************************** )
changed: [127.0.0.1 → 127.0.0.1] => (item=127.0.0.1 : ok=5 changed=2 unreachable=0 failed=0 )
changed: [127.0.0.1 → 127.0.0.1] => (item=192.168.1.21 : ok=11 changed=10 unreachable=0 failed=0 )
changed: [127.0.0.1 → 127.0.0.1] => (item=192.168.1.28 : ok=11 changed=10 unreachable=0 failed=0 )
I don’t want to see the " [127.0.0.1 → 127.0.0.1] => ".
How can I make it look like the colorful output of first level ansible playbook?
any help or suggestion is appreciated.
Warm Regards,
Fazal