Skip to content

Commit

Permalink
Merge remote-tracking branch 'test-2/main' into test-0
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksey Gavrilov <alexey.gavrilov@flant.com>
  • Loading branch information
alexey-gavrilov-flant committed Sep 3, 2024
2 parents fa0c66c + 0152021 commit b757bcc
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions testing/cloud_layouts/Static/infra.tpl.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ data "openstack_images_image_v2" "opensuse_image" {
name = "openSUSE-Leap-15.6"
}

resource "openstack_blockstorage_volume_v3" "master" {
name = "candi-${PREFIX}-master-0"
resource "openstack_blockstorage_volume_v3" "bastion" {
name = "candi-${PREFIX}-bastion-0"
size = "30"
image_id = data.openstack_images_image_v2.astra_image.id
volume_type = var.volume_type
Expand All @@ -144,29 +144,35 @@ resource "openstack_blockstorage_volume_v3" "master" {
}
}

resource "openstack_compute_instance_v2" "master" {
name = "candi-${PREFIX}-master-0"
flavor_name = var.flavor_name_large
resource "openstack_compute_instance_v2" "bastion" {
name = "candi-${PREFIX}-bastion"
flavor_name = var.flavor_name_medium
key_pair = "candi-${PREFIX}-key"
availability_zone = var.az_zone
user_data = file("astra-instance-bootstrap.sh")

network {
port = openstack_networking_port_v2.master_internal_without_security.id
port = openstack_networking_port_v2.bastion_internal_without_security.id
}

block_device {
uuid = openstack_blockstorage_volume_v3.master.id
uuid = openstack_blockstorage_volume_v3.bastion.id
source_type = "volume"
destination_type = "volume"
boot_index = 0
delete_on_termination = true
}
}

resource "openstack_compute_floatingip_v2" "bastion" {
pool = data.openstack_networking_network_v2.external.name
}

resource "openstack_blockstorage_volume_v3" "bastion" {
name = "candi-${PREFIX}-bastion-0"
resource "openstack_compute_floatingip_associate_v2" "bastion" {
floating_ip = openstack_compute_floatingip_v2.bastion.address
instance_id = openstack_compute_instance_v2.bastion.id
}

resource "openstack_blockstorage_volume_v3" "master" {
name = "candi-${PREFIX}-master-0"
size = "30"
image_id = data.openstack_images_image_v2.astra_image.id
volume_type = var.volume_type
Expand All @@ -177,23 +183,24 @@ resource "openstack_blockstorage_volume_v3" "bastion" {
}
}

resource "openstack_compute_instance_v2" "bastion" {
name = "candi-${PREFIX}-bastion"
flavor_name = var.flavor_name_medium
resource "openstack_compute_instance_v2" "master" {
name = "candi-${PREFIX}-master-0"
flavor_name = var.flavor_name_large
key_pair = "candi-${PREFIX}-key"
availability_zone = var.az_zone
user_data = file("astra-instance-bootstrap.sh")

network {
port = openstack_networking_port_v2.bastion_internal_without_security.id
port = openstack_networking_port_v2.master_internal_without_security.id
}

block_device {
uuid = openstack_blockstorage_volume_v3.bastion.id
uuid = openstack_blockstorage_volume_v3.master.id
source_type = "volume"
destination_type = "volume"
boot_index = 0
delete_on_termination = true
}

}

resource "openstack_blockstorage_volume_v3" "system" {
Expand Down Expand Up @@ -226,7 +233,6 @@ resource "openstack_compute_instance_v2" "system" {
boot_index = 0
delete_on_termination = true
}

}

resource "openstack_blockstorage_volume_v3" "worker_0" {
Expand Down Expand Up @@ -259,7 +265,6 @@ resource "openstack_compute_instance_v2" "worker_0" {
boot_index = 0
delete_on_termination = true
}

}

resource "openstack_blockstorage_volume_v3" "worker_1" {
Expand Down Expand Up @@ -292,16 +297,6 @@ resource "openstack_compute_instance_v2" "worker_1" {
boot_index = 0
delete_on_termination = true
}

}

resource "openstack_compute_floatingip_v2" "bastion" {
pool = data.openstack_networking_network_v2.external.name
}

resource "openstack_compute_floatingip_associate_v2" "bastion" {
floating_ip = openstack_compute_floatingip_v2.bastion.address
instance_id = openstack_compute_instance_v2.bastion.id
}

output "master_ip_address_for_ssh" {
Expand Down

0 comments on commit b757bcc

Please sign in to comment.