How to run local play with remote inventory?

24 views
Skip to first unread message

Daniel Q. Miranda

unread,
Aug 25, 2016, 1:54:10 PM8/25/16
to Ansible Project
Greetings,

I'm using Ansible 2.1.1.0 to manage EC2 hosts, with the ec2.py inventory script.

I want to run a play locally that uses the EC2 inventory to generate configuration, but I'm having some trouble. If I use:

hosts: 127.0.0.1
connection: local

I have to manually override the inventory, or the play won't run due to having no hosts selected, but then I lose the EC2 inventory data.

Is there a good way to do this?


Regards,
Daniel

Brian Coca

unread,
Feb 9, 2017, 10:45:37 PM2/9/17
to Ansible Project
- hosts: all
connection: local

^ the play will loop over the ec2 hosts but all actions will be on the
controller, unless you have overrides in inventory.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages