Fix some deps and a problem with the ssh key.

This commit is contained in:
Andrea Dell'Amico 2023-11-06 11:01:14 +01:00
parent 7db6897429
commit f4cbc8b293
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
8 changed files with 13 additions and 11 deletions

View File

@ -1,4 +1,4 @@
resource "openstack_compute_keypair_v2" "initial_ssh_key" {
name = var.ssh_key_file.name
public_key = "${file("${var.ssh_key_file.file}.pub")}"
}
# resource "openstack_compute_keypair_v2" "initial_ssh_key" {
# name = var.ssh_key_file.name
# public_key = "${file("${var.ssh_key_file.file}.pub")}"
# }

View File

@ -3,7 +3,7 @@ resource "openstack_compute_instance_v2" "ssh_jump_proxy" {
name = var.ssh_jump_proxy.name
availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu
flavor_name = var.ssh_jump_proxy.flavor
key_pair = openstack_compute_keypair_v2.initial_ssh_key.name
key_pair = var.ssh_key_file.name
security_groups = [openstack_networking_secgroup_v2.default.name,openstack_networking_secgroup_v2.access_to_the_jump_proxy.name]
block_device {
uuid = var.ubuntu_2204.uuid

View File

@ -2,7 +2,7 @@ resource "openstack_compute_instance_v2" "internal_ca" {
name = var.internal_ca_data.name
availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu
flavor_name = var.internal_ca_data.flavor
key_pair = openstack_compute_keypair_v2.initial_ssh_key.name
key_pair = var.ssh_key_file.name
security_groups = [openstack_networking_secgroup_v2.default.name]
block_device {
uuid = var.ubuntu_2204.uuid

View File

@ -8,7 +8,7 @@ resource "openstack_compute_instance_v2" "prometheus_server" {
name = var.prometheus_server_data.name
availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu
flavor_name = var.prometheus_server_data.flavor
key_pair = openstack_compute_keypair_v2.initial_ssh_key.name
key_pair = var.ssh_key_file.name
security_groups = [openstack_networking_secgroup_v2.default.name,openstack_networking_secgroup_v2.restricted_web.name,openstack_networking_secgroup_v2.prometheus_access_from_grafana.name]
block_device {
uuid = var.ubuntu_2204.uuid

View File

@ -57,7 +57,7 @@ resource "openstack_compute_instance_v2" "shared_postgresql_server" {
name = var.shared_postgresql_server_data.name
availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu
flavor_name = var.shared_postgresql_server_data.flavor
key_pair = openstack_compute_keypair_v2.initial_ssh_key.name
key_pair = var.ssh_key_file.name
security_groups = [openstack_networking_secgroup_v2.default.name,openstack_networking_secgroup_v2.shared_postgresql_access.name]
block_device {
uuid = var.ubuntu_2204.uuid
@ -83,4 +83,5 @@ resource "openstack_compute_volume_attach_v2" "shared_postgresql_data_attach_vol
instance_id = openstack_compute_instance_v2.shared_postgresql_server.id
volume_id = openstack_blockstorage_volume_v3.shared_postgresql_data_vol.id
device = var.shared_postgresql_server_data.vol_data_device
depends_on = [openstack_compute_instance_v2.shared_postgresql_server]
}

View File

@ -111,7 +111,7 @@ resource "openstack_compute_instance_v2" "main_haproxy_l7" {
name = format("%s-%02d", var.haproxy_l7_data.name, count.index+1)
availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu
flavor_name = var.haproxy_l7_data.flavor
key_pair = openstack_compute_keypair_v2.initial_ssh_key.name
key_pair = var.ssh_key_file.name
security_groups = [openstack_networking_secgroup_v2.default.name,openstack_networking_secgroup_v2.main_lb_to_haproxy_l7.name]
block_device {
uuid = var.ubuntu_2204.uuid

View File

@ -8,4 +8,5 @@ resource "openstack_compute_volume_attach_v2" "shared_postgresql_backup_attach_v
instance_id = openstack_compute_instance_v2.shared_postgresql_server.id
volume_id = openstack_blockstorage_volume_v3.shared_postgresql_backup_vol.id
device = var.shared_postgresql_server_data.vol_backup_device
depends_on = [openstack_compute_instance_v2.shared_postgresql_server]
}

View File

@ -91,7 +91,7 @@ variable "octavia_information" {
# The following aren't available when the module runs so we have to get them with the command
# openstack --os-cloud d4s-pre port list -f value | grep octavia-lb-vrrp
# This means that the execution will fail
octavia_vrrp_ip_1 = "10.1.41.232"
octavia_vrrp_ip_2 = "10.1.42.229"
octavia_vrrp_ip_1 = "10.1.42.83/32"
octavia_vrrp_ip_2 = "10.1.44.249/32"
}
}