Anisbie ad-hoc inventory on command line

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

Thanks

This gave me a clue

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.yml