compute-deploy is an Apache Libcloud wrapper used to deploy & bootstrap a cloud compute server quickly with a pre-defined bootstrap script plugin (see Plugins below). Visit the compute-deploy GitHub project for full documentation and developer information.
Requirements
- Python 2.7
- Apache Libcloud -
pip install apache-libcloud
- simplejson -
pip install simplejson
- paramiko -
pip install paramiko
Support
Currently, this version supports the following providers:
Usage
--size [SERVER_SIZE (in Megabytes)]
--name [SERVER_NAME]
--flavor [SERVER_OS]
--region [PROVIDER_REGION]
--bootstrap [BOOTSTRAP_FILE.sh]
--bootstrapargs [COMMA_SEPARATED_ARG_STRING]
--customfile [CUSTOMFILE_PATH]
Examples
Deploy a 512MB server running CentOS 5.10 at Rackspace Chicago and bootstrap the server with salt-bootstrap
./compute-deploy.py --size=512 --name=saltbox1 --flavor='CentOS 5.10' --region=ord --bootstrap='salt-bootstrap/bootstrap-salt.sh'
Deploy a 512MB server running CentOS 6.5 at Rackspace Chicago and bootstrap the server with puppet-bootstrap with the puppetmaster IP being 192.168.1.1 and the puppet environment being production
./compute-deploy.py --size=512 --name=puppetclient1 --flavor='CentOS 6.5' --region=ord --bootstrap='puppet-bootstrap/puppet-bootstrap.py' --bootstrapargs='192.168.1.1,production'
Deploy a 512MB server running CentOS 6.5 at Rackspace Chicago and bootstrap the server with puppet-bootstrap with the puppetmaster IP being 192.168.1.1 and the puppet environment being production and create / mount 1GB swap disk
./compute-deploy.py --size=512 --name=puppetclient1 --flavor='CentOS 6.5' --region=ord --bootstrap='puppet-bootstrap/puppet-bootstrap.py' --bootstrapargs='192.168.1.1,production,swap.sh' --customfile='swap.sh'
Bootstrap Plugins
A bootstrap plugin is any shell script you want the server to initialize with. To use a bootstrap plugin, download or create a shell file within the compute-deploy directory and call it with the --boostrap
flag.
Available Bootstrap Plugins
Using a bootstrap plugin submodule
- cd to the
compute-deploy
dir - add the submodule (ex:
git submodule add git@github.com:saltstack/salt-bootstrap.git
) - run:
git submodule init
- run:
git submodule update
- use the shell file provided by the plugin (ex:
--bootstrap='salt-bootstrap/bootstrap-salt.sh'
)
Troubleshooting
RuntimeError: No CA Certificates were found
This is probably the most common error you may run into when first trying out the program. This is apache-libcloud complaining that it can't find a valid certificate bundle. See https://libcloud.readthedocs.org/en/latest/other/ssl-certificate-validation.html for more information. The easiest workaround I found was as follows:
- run this gist: https://gist.github.com/1stvamp/2158128 (this downloads and installs the ca-bundle.crt under
/usr/share/curl
) - set the
SSL_CERT_FILE
parameter before execute as follows:
SSL_CERT_FILE=/usr/share/curl/ca-bundle.crt python2.7 ./compute-deploy.py --size=1024 ...