you must set up a security group ansible-test
on ec2
the basic requirement is for inbound ssh
and i used my ip as the allowed traffic source
remember! t2 instances must be launched in VPC, so you have to create a VPC security group if not using default
also you must specify a subnet id or network interface id
subnets can be found with: ec2-describe-subnets
key_name
is the name of the ec2 key you have set up on the ec2 console
for this example, we are using region us-east-1
and ami ami-9a562df2
(ubuntu 14)
note: the hosts file will not be modified, the new instance ip is only stored in memory while executing tasks in the playbook
sudo pip install boto
ansible-playbook -i hosts demo_setup.yml