Skip to content

Instantly share code, notes, and snippets.

@rstarmer
Created January 5, 2016 08:26
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 rstarmer/271c8a959035158af24d to your computer and use it in GitHub Desktop.
Save rstarmer/271c8a959035158af24d to your computer and use it in GitHub Desktop.
Simple terraform for an OpenStack VM (public network direct attached)
#provider "openstack" {
# user_name = "admin"
# tenant_name = "admin"
# password = "pwd"
# auth_url = "http://myauthurl:5000/v2.0"
#}
resource "openstack_compute_instance_v2" "ruby-hw" {
name = "ruby-hw.opsits.com"
image_id = "7f85f7b3-eb20-4bef-8bad-bb3583a9a2fd"
flavor_id = "3"
key_pair = "rhs"
provisioner "local-exec" {
command = "echo ${openstack_compute_instance_v2.ruby-hw.access_ip_v4} ansible_connection=ssh ansible_ssh_user=centos >> inventory"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment