Ansible Dynamic Inventory Sources for CloudSigma
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Ansible Dynamic Inventory Sources for CloudSigma.


This script relies on the pycloudsigma. Install it by running:

$ pip install -r requirements.txt

Next, you need to configure your credentials and data center location per the installation instructions.


With pycloudsigma installed, you now need to build the database. To do this, run:

$ ./ --refreshdb

You can then verify the entry by running:

$ ./ --list

This should return a list of all running nodes, along with their IPs.

Finally, let's test this with ansible by running a ping against the server ansible.local:

$ ansible -i -u cloudsigma ansible.local -m ping
ansible.local | success >> {
"changed": false,
"ping": "pong"

Success! If that worked out, let's make this your default Ansible back-end. To do this, edit /etc/ansible/ansible.cfg (or create it if it doesn't exist). What you need to do is to change 'hostfile' such that it points to your script. A minimal ansible.cfg would look like this:

hostfile = /path/to/

This allows you to simply run:

$ ansible -u cloudsigma ansible.local -m ping