Created
August 7, 2018 18:21
-
-
Save rruu/bd8f2f1a42c27db7f150cc5e262ee282 to your computer and use it in GitHub Desktop.
This file contains 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
# 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}" | |
} | |
## app02 | |
#resource "openstack_compute_instance_v2" "app02" { | |
# region = "RegionOne" | |
# name = "app02" | |
# 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_2" { | |
# pool = "ext-net" | |
# } | |
# | |
# resource "openstack_compute_floatingip_associate_v2" "fip_2" { | |
# floating_ip = "${openstack_networking_floatingip_v2.fip_2.address}" | |
# instance_id = "${openstack_compute_instance_v2.app02.id}" | |
#} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment