I have a handful of existing EC2 instances with a specific tag that I would like to target and execute Ansible against. What is the best way to go about this?
I tried to use the ec2.py script for EC2 Dynamic Inventory, but ran into issues when trying to execute the script.
dchan $ chmod +x ec2.py
dchan $ ansible -i ec2.py us-east-1 -m ping
File “/ec2.py”, line 292
region ‘’’
^
IndentationError: expected an indented block
Is there something I’m doing wrong with the ec2.py script? I’m also unsure about how to incorporate the script into my playbook.
Are there any existing modules that I could utilize to solve my problem?
Thanks!