updated ssh configs

This commit is contained in:
Francesco Mangiacrapa 2023-11-24 17:49:15 +01:00
parent d459f11365
commit 20855b6882
2 changed files with 24 additions and 2 deletions

View File

@ -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"
}

View File

@ -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