# Anisbie ad-hoc inventory on command line

**URL:** <https://forum.ansible.com/t/anisbie-ad-hoc-inventory-on-command-line/35648>\
**Category:** Ansible Project\
**Created:** [August 20, 2021, 2:47am UTC](https://forum.ansible.com/t/anisbie-ad-hoc-inventory-on-command-line/35648 "2021-08-20T02:47:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [August 20, 2021, 2:47am UTC](https://forum.ansible.com/t/anisbie-ad-hoc-inventory-on-command-line/35648/1 "2021-08-20T02:47:08Z")

</div>

Is this the correct syntax for creating an ad-hoc, or on-the-fly inventory file from passed-in IP addresses? See the comma ( , ) before the end-quote of the inventory list?I I’m aware of inventory files and do use them. But I’m trying to write a script where the user enters an IP address to configure.

$ ansible-playbook -i “10.x.x.x,” -e var\_host=10.x.x.x [my-playbook.com](http://my-playbook.com)

Thanks

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [August 20, 2021, 3:04am UTC](https://forum.ansible.com/t/anisbie-ad-hoc-inventory-on-command-line/35648/2 "2021-08-20T03:04:21Z")

</div>

This gave me a clue

[https://gist.github.com/alces/f7e3de25d98a19550a4e4f97cabc2cf4](https://gist.github.com/alces/f7e3de25d98a19550a4e4f97cabc2cf4)

So it’s just this, without the “”

$ ansible-playbook -i 10.x.x.x, -e var\_host=10.x.x.x [my-playbook.](http://my-playbook.com/)yml
