hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[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:

  1. 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'
    
  2. Prepare instances for Ansible (omitted - needs cleanup & automation)

  3. 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: , , ]


Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 35452322
Copyright (c) Hubert Feyrer