Ansible without inventory?

3,881 views
Skip to first unread message

Matthew Bradley

unread,
Oct 16, 2013, 11:47:39 AM10/16/13
to ansible...@googlegroups.com
How do I run Ansible without inventory? I want my playbook to provision a new Digital Ocean droplet and then write its details to a local inventory file. However every time I run my playbook with an empty hosts file it complains, stating "ERROR: provided hosts list is empty"

Am I trying to do something that isn't possible with Ansible?

Thanks,

Matt

Brian Coca

unread,
Oct 16, 2013, 3:43:52 PM10/16/13
to ansible...@googlegroups.com
I would suggest you read:
http://www.ansibleworks.com/docs/guide_aws.html

if you want to avoid writing the initial localhost you can always pass  -i 'localhost,'  to the ansible command (trailing comma is intentional and needed).

Michael DeHaan

unread,
Oct 16, 2013, 3:50:02 PM10/16/13
to ansible...@googlegroups.com
Yeah the trailing comma is a hack, we should not suggest it in most cases.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Sankalp Khare

unread,
Sep 23, 2014, 7:19:40 PM9/23/14
to ansible...@googlegroups.com
Be that as it may, i've found this tip invaluable in quickly applying chosen roles to a few servers / test servers.

Reply all
Reply to author
Forward
0 new messages