incubator-libcloud mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <p...@querna.org>
Subject [libcloud] need feedback on deployment API in trunk!
Date Mon, 01 Mar 2010 01:15:13 GMT
Hello Everyone,

I've taken a stab at a basic deployment API, and its in libcloud trunk now.

An example of using it:

from libcloud.providers import get_driver
from libcloud.deployment import MultiStepDeployment, ScriptDeployment,
SSHKeyDeployment

driver = get_driver(Provider.RACKSPACE)('libcloud', 'you secret here')
loc = driver.list_locations()
sizes = driver.list_sizes()
images = driver.list_images()

key = open(os.path.expanduser("~/.ssh/my_rsa.pub")).read()

sd = SSHKeyDeployment(key)
script = ScriptDeployment("apt-get install -y puppet")
msd = MultiStepDeployment([sd, script])

node = driver.deploy_node(name="lc-test.k1k.me", location=loc[0],
image=images[0],
                    size=sizes[0], deploy=msd)

So, basically there is a new deploy_node() method on the base driver
class.  If a driver supports either giving us the nodes password, or
setting one, it logs in using Paramiko, and can do basic setup of the
node.  Supporting SSH Keys for places like amazon shouldn't be too
hard to extend in here quickly either!

Thoughts on the API?  Any major flaws or suggestions on how to make it
easier and more robust?

Thanks,

Paul

Mime
View raw message