I start to work on ansible inventory for RackSpace (using OpenCloud
API, so i think can be portable, but I'm not able to test on other
environment for now).
You can see the first relase at:
* https://github.com/mavimo/ansible-plugins/tree/master/inventory
#### Setup ####
Install python-novaclient python library (see README on
https://github.com/openstack/python-novaclient )
Change data in nova.ini file using:
* data from RackSpace control panel (username / api_key)
* Set entrypoint for service (RackSpace use:
https://identity.api.rackspacecloud.com/v2.0/ for US datacenter)
Set permission to nova.py to make sure it is executable. You can test
it work fine with:
./nova.py --list
NB: nova.ini must be in the same directory of nova.py.
#### Usage ####
Specify the complete path of inventory to ansible:
ansible -i /path/to/nova.py all -m ping
This inventory use metadata on server instance to ad machine to
appropriate group, eg:
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa1 meta set group=frontend
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa2 meta set group=frontend
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa3 meta set group=database
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa4 meta set group=database
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa5 meta set group=monitor
nova 11aaa11a-1a11-111a-a11a-11aaa1111aa6 meta set group=backup
and information list will be:
./nova.py --list
{
'frontend' : ['192.168.0.1', '192.168.0.2'],
'database' : ['192.168.0.3', '192.168.0.4'],
'monitor' : ['192.168.0.5'],
'backup' : ['192.168.0.6'],
}
NB: this is just a first step, some other improvement will be add, if
you have suggestion please reply to this mail or send an issue in
github.
Bye
Marco