# Pulling out the output of a playbook called with in another playbook

**URL:** <https://forum.ansible.com/t/pulling-out-the-output-of-a-playbook-called-with-in-another-playbook/17373>\
**Category:** Ansible Project\
**Created:** [January 26, 2015, 10:23am UTC](https://forum.ansible.com/t/pulling-out-the-output-of-a-playbook-called-with-in-another-playbook/17373 "2015-01-26T10:23:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fazal-e-Rehman\_Khan](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fazal-e-Rehman\_Khan](https://forum.ansible.com/u/Fazal-e-Rehman_Khan)\
**Post date:** [January 26, 2015, 10:23am UTC](https://forum.ansible.com/t/pulling-out-the-output-of-a-playbook-called-with-in-another-playbook/17373/1 "2015-01-26T10:23:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [January 26, 2015, 5:12pm UTC](https://forum.ansible.com/t/pulling-out-the-output-of-a-playbook-called-with-in-another-playbook/17373/2 "2015-01-26T17:12:01Z")

</div>

I would use register. Take a look at it here: [http://docs.ansible.com/playbooks\_conditionals.html#register-variables](http://docs.ansible.com/playbooks_conditionals.html#register-variables)
