Created
January 3, 2012 14:26
-
-
Save mahemoff/1555084 to your computer and use it in GitHub Desktop.
Ruby Linode API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://github.com/rick/linode | |
### CREATE STACKSCRIPT | |
require 'linode' | |
s = Linode::Stackscript.new :api_key => 'linode-key-which-you-can-request-from-your-account' | |
s.create :label => 'amazingbox', :distributionIDList => '64', :script => '#!/bin/bash\nls -latr' | |
# '64' happens to be the distro for Ubuntu 10.04 LTS. | |
# Find distribution IDs with Linode.new.avail.distributions. | |
### UPDATE STACKSCRIPT | |
s.update :stackScriptID => (s.list.select { |s| s.label=='amazingbox' }.first.stackscriptid), :script => '#!/bin/bash ; echo "this build is even better" ; ls -lasr' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment