From 20855b6882a735beb489760e95a34861b97ba9a4 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 24 Nov 2023 17:49:15 +0100 Subject: [PATCH] updated ssh configs --- .../modules/common_variables/variables.tf | 24 ++++++++++++++++++- openstack-tf/modules/geoserver/geoserver.tf | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/openstack-tf/modules/common_variables/variables.tf b/openstack-tf/modules/common_variables/variables.tf index 54cc3bc..7ed8c05 100644 --- a/openstack-tf/modules/common_variables/variables.tf +++ b/openstack-tf/modules/common_variables/variables.tf @@ -179,7 +179,29 @@ variable "smartexecutor_addresses" { } -#Added by Francesco - It must contain the file 'ssh-key-ref-outputs.tf' (also added in the .gitignore) +# Added by Francesco +# Create in the path 'modules/ssh-key-ref' the file 'ssh-key-ref-outputs.tf' +# with the following outputs: + +# output "ssh_key_file" { +# value = "~/.ssh/{YOUR_PRIVATE_KEYNAME}" +# sensitive = true +# } + +# output "ssh_key_name" { +# value = "{YOUR_KEYNAME}" +# sensitive = false +# } + +# Then you can use above outputs in your 'file.tf' (if it contains the soft link to variables.tf) as: +# module.ssh_settings.ssh_key_file +# module.ssh_settings.ssh_key_name + +# e.g. +# +# resource "openstack_compute_instance_v2" "geoserver" { +# key_pair = module.ssh_settings.ssh_key_name + module "ssh_settings" { source = "../../modules/ssh-key-ref" } diff --git a/openstack-tf/modules/geoserver/geoserver.tf b/openstack-tf/modules/geoserver/geoserver.tf index e909f37..45dff34 100644 --- a/openstack-tf/modules/geoserver/geoserver.tf +++ b/openstack-tf/modules/geoserver/geoserver.tf @@ -10,7 +10,7 @@ resource "openstack_compute_instance_v2" "geoserver" { name = var.geoserver_basic.name availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu flavor_name = var.geoserver_basic.flavor - key_pair = module.ssh_settings.ssh_key_file_name + key_pair = module.ssh_settings.ssh_key_name security_groups = [var.security_group_list.default, var.security_group_list.http_and_https_from_the_load_balancers] block_device { uuid = var.ubuntu_1804.uuid