I would use register. Take a look at it here: 
http://docs.ansible.com/playbooks_conditionals.html#register-variables

On Monday, 26 January 2015 11:23:47 UTC+1, Fazal-e-Rehman Khan wrote:
>
> 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
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a2ac3010-9307-4fc2-b472-3a36d6243d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to