Created
May 24, 2011 08:13
-
-
Save ezmobius/988313 to your computer and use it in GitHub Desktop.
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
# use fog to bootstrap a Rackspace cloud server | |
# since it does not have user-data like ec2 | |
@compute = Fog::Compute.new(...) | |
server = @compute.servers.create(....) | |
server.wait_for { ready? } | |
server.private_key = IO.read("~/.ssh/foo") | |
server.public_key = IO.read("~/.ssh/foo.pub") | |
server.username = 'root' | |
server.setup :password => server.password | |
server.ssh ["echo '#{user_data}' > /root/bootstrap.sh", | |
"chmod +x /root/bootstrap.sh", | |
"/root/bootstrap.sh &"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment