Skip to content

Instantly share code, notes, and snippets.

@t0mk
Last active December 22, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t0mk/6535239 to your computer and use it in GitHub Desktop.
Save t0mk/6535239 to your computer and use it in GitHub Desktop.
Vagrantfile for vagrant-openstack provider
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
# to spawn a vm in Openstack (tested in Folsom)
# - source openrc.sh and fill your password
# - $ vagrant plugin install vagrant-openstack
# - $ export VAGRANT_DEFAULT_PROVIDER=openstack
# - edit this Vagrant file
# $ vagrant up
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :openstack do |os|
os.url = ENV['OS_AUTH_URL'] + '/tokens'
os.tenant = ENV['OS_TENANT_NAME']
os.user = ENV['OS_USERNAME']
os.password = ENV['OS_PASSWORD']
# pick from your OpenStack resources:
# $ nova flavor-list
os.flavor = "1"
# $ nova keypair-list
os.keypair = "pair_tomk"
# $ glance index
os.image = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
# $ nova floating-ip-list
os.floating_ip = "xx.xx.x.x"
# instance name
os.name = "testinstance"
# Openstack injects pubkey for root, so it's the safest bet to use
# root account
os.ssh_username = "root"
# this must be the same keypair as you have imported in openstack
os.ssh_private_key = "/home/tomk/keys/pair_tomk.pem"
os.public_key_path = "/home/tomk/keys/pair_tomk.pub"
end
end
@t0mk
Copy link
Author

t0mk commented Sep 12, 2013

hm, the vagrant-openstack plugin doesn't seem to have provisioning working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment