I had a difficult time finding this information anywhere. I’m sure it exist, but here’s what’s going on.
Assuming you have ansible-playbook -i ec2.py someplaybook.yml working, (test it with ./ec2.py –list) then you may want to address some of your instances by tags.
Here’s the skinny, let’s say create an instance and give it a key pair tag name / webserver-us-east-1a, ansible is looking for “tag_Name_webserver-us-east-1a” not just “webserver-us-east-1a” in the hosts section of your playbook. Here’s an example below:
# webserver deploy
– hosts: “tag_Name_webserver-us-east-1a”