# Can INVENTORY pass json strings directly?

**URL:** <https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124>\
**Category:** Ansible Developer\
**Created:** [July 23, 2018, 9:03am UTC](https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124 "2018-07-23T09:03:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neil\_Wang](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Neil\_Wang](https://forum.ansible.com/u/Neil_Wang)\
**Post date:** [July 23, 2018, 9:03am UTC](https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124/1 "2018-07-23T09:03:57Z")

</div>

Usually we run ansible-playbook ，“ansible-playbook -i host.py fig.yaml”

Do we want this to be done?

eg:  
ansible-playbook -i {“all”: {“hosts”: [“192.168.1.153”],“vars”: {“username”: “aaaa”,“password”: “bbbb”,“hostname”: “192.168.1153”}}} fig.yaml

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 23, 2018, 2:10am UTC](https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124/2 "2018-07-23T02:10:12Z")

</div>

No 'existing' inventory plugin handles this, but you can create one that does.

---

<div class="post-metadata">

**Author:** ![Neil\_Wang](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Neil\_Wang](https://forum.ansible.com/u/Neil_Wang)\
**Post date:** [July 25, 2018, 8:25am UTC](https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124/3 "2018-07-25T08:25:04Z")

</div>

Please help give an example，thx

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 25, 2018, 1:24pm UTC](https://forum.ansible.com/t/can-inventory-pass-json-strings-directly/28124/4 "2018-07-25T13:24:33Z")

</div>

You can find all the current inventory plugins here: [https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/inventory](https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/inventory)
