Skip to content

Instantly share code, notes, and snippets.

@rruu
Created August 4, 2018 19:44
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 rruu/44dd2502189822b2e7d236776481a939 to your computer and use it in GitHub Desktop.
Save rruu/44dd2502189822b2e7d236776481a939 to your computer and use it in GitHub Desktop.
# Configure the OpenStack Provider
provider "openstack" {
tenant_name = "MyProject"
tenant_id = "xxxxxxxxxx"
user_name = "xxxxxxxxxx"
password = "xxxxxxxxxx"
auth_url = "https://infra.mail.ru:35357/v3/"
}
# app01
resource "openstack_compute_instance_v2" "app01" {
region = "RegionOne"
name = "app01"
image_id = "fce7b6f8-d395-4f93-9aac-1db55e14d766"
flavor_id = "25ae869c-be29-4840-8e12-99e046d2dbd4"
key_pair = "key2"
security_groups = ["all"]
block_device {
uuid = "da8fe38a-6236-4d60-a7b4-928c817137dc"
source_type = "image"
volume_size = 10
boot_index = 0
destination_type = "volume"
delete_on_termination = true
}
network {
name = "int-net1"
}
network {
name = "private"
}
}
resource "openstack_networking_floatingip_v2" "fip_1" {
pool = "ext-net"
}
resource "openstack_compute_floatingip_associate_v2" "fip_1" {
floating_ip = "${openstack_networking_floatingip_v2.fip_1.address}"
instance_id = "${openstack_compute_instance_v2.app01.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment