Skip to content

cloudsigma/ansible-cloudsigma

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

ansible-cloudsigma

Ansible Dynamic Inventory Sources for CloudSigma.

Installation

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.

Usage

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

$ ./ansiblecs.py --refreshdb

You can then verify the entry by running:

$ ./ansiblecs.py --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 ansiblecs.py -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:

[defaults]
hostfile = /path/to/ansiblecs.py

This allows you to simply run:

$ ansible -u cloudsigma ansible.local -m ping

About

Ansible Dynamic Inventory Sources for CloudSigma

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages