# Capture the output of a playbook and optionally insert it into mongodb

**URL:** <https://forum.ansible.com/t/capture-the-output-of-a-playbook-and-optionally-insert-it-into-mongodb/13789>\
**Category:** Ansible Project\
**Created:** [October 28, 2013, 2:15pm UTC](https://forum.ansible.com/t/capture-the-output-of-a-playbook-and-optionally-insert-it-into-mongodb/13789 "2013-10-28T14:15:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpatanaik](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@cpatanaik](https://forum.ansible.com/u/cpatanaik)\
**Post date:** [October 28, 2013, 2:15pm UTC](https://forum.ansible.com/t/capture-the-output-of-a-playbook-and-optionally-insert-it-into-mongodb/13789/1 "2013-10-28T14:15:22Z")

</div>

Hi,

So I was using the ec2 module of ansible. I was able to sucessfully create a server and with -v option, ansible showed some details to stdout.

I would like to know whether there is a way to get the output of the playbook(as JSON).

command = “ansible-playbook -v -i inventory test.yml”  
test.yml

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 28, 2013, 5:08pm UTC](https://forum.ansible.com/t/capture-the-output-of-a-playbook-and-optionally-insert-it-into-mongodb/13789/2 "2013-10-28T17:08:33Z")

</div>

No, currently there is no way to get a pure JSON output via the CLI commands, short of executing playbooks via the API directly. If you have any interest in implementing that as a feature we would of course consider merging it in, however there has not been much of a call for something like that to date.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [October 28, 2013, 5:15pm UTC](https://forum.ansible.com/t/capture-the-output-of-a-playbook-and-optionally-insert-it-into-mongodb/13789/3 "2013-10-28T17:15:16Z")

</div>

this could be a nice callback plugin
