Anisbie ad-hoc inventory on command line

21 views
Skip to first unread message

zil...@gmail.com

unread,
Aug 19, 2021, 10:47:08 PM8/19/21
to Ansible Project
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


zil...@gmail.com

unread,
Aug 19, 2021, 11:04:21 PM8/19/21
to Ansible Project
This gave me a clue


So it's just this, without the ""

$ ansible-playbook -i 10.x.x.x, -e var_host=10.x.x.x my-playbook.yml
Reply all
Reply to author
Forward
0 new messages