[20130310]
|
Talking to the cloud
After some more hacking, I have a basic understanding
of how to start Amazon NetBSD EC2 instances
using Ansible, fix the instances so they can be used
as targets for further Ansible commands, and then
actually talking to my herd of happy instances.
Here's a teaser:
- Start EC2 instances, put them into ec2-webservers group.
Repeat the following command for more than one instance:
% ansible -i hosts-HF localhost -m ec2 -a 'image=ami-a754dbce instance_type=t1.micro \
key_name=eucaHF group=ec2-webservers'
- Prepare instances for Ansible (omitted - needs cleanup & automation)
- Use Ansible to ping all servers in the ec2-webservers group:
% env ANSIBLE_HOSTS=./ec2.py ansible-playbook config-ec2-basic.yml
PLAY [security_group_ec2-webservers] *********************
GATHERING FACTS *********************
ok: [ec2-23-23-15-202.compute-1.amazonaws.com]
ok: [ec2-54-235-230-206.compute-1.amazonaws.com]
TASK: [ping] *********************
ok: [ec2-23-23-15-202.compute-1.amazonaws.com]
ok: [ec2-54-235-230-206.compute-1.amazonaws.com]
PLAY RECAP *********************
ec2-23-23-15-202.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0
ec2-54-235-230-206.compute-1.amazonaws.com : ok=2 changed=0 unreachable=0 failed=0
[Tags: ansible, ec2, xen]
|
|