From 747950287bd909acdd3b163406cc056a6d147f21 Mon Sep 17 00:00:00 2001 From: Marco Procaccini Date: Tue, 9 Jul 2024 16:55:28 +0200 Subject: [PATCH] network defined in the resource instance --- openstack-tf/d4s-production/harbor/main.tf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openstack-tf/d4s-production/harbor/main.tf b/openstack-tf/d4s-production/harbor/main.tf index 7b728cb..8ad61a1 100644 --- a/openstack-tf/d4s-production/harbor/main.tf +++ b/openstack-tf/d4s-production/harbor/main.tf @@ -112,7 +112,7 @@ resource "openstack_compute_instance_v2" "harbor_server" { # availability_zone_hints = module.common_variables.availability_zone_no_gpu_name flavor_name = var.harbor_data.flavor key_pair = module.ssh_settings.ssh_key_name - security_groups = [data.terraform_remote_state.infrastructure_setup.outputs.default_security_group.name, data.terraform_remote_state.infrastructure_setup.outputs.access_postgresql_security_group.name, openstack_networking_secgroup_v2.harbor_access_list.name] + security_groups = [data.terraform_remote_state.infrastructure_setup.outputs.default_security_group.name, data.terraform_remote_state.infrastructure_setup.outputs.access_postgresql_security_group.name] block_device { uuid = module.common_variables.ubuntu_2204.uuid source_type = "image" @@ -122,6 +122,10 @@ resource "openstack_compute_instance_v2" "harbor_server" { delete_on_termination = false } + network { + name = data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name + } + user_data = file("${module.common_variables.ubuntu2204_data_file}") # Do not replace the instance when the ssh key changes lifecycle { @@ -168,7 +172,7 @@ resource "openstack_compute_interface_attach_v2" "postgresql_network_to_harbor" port_id = openstack_networking_port_v2.harbor_port_on_the_postgresql_net.id } - +/** locals { harbor_recordset_name = "harbor.${data.terraform_remote_state.privnet_dns_router.outputs.dns_zone.zone_name}" } @@ -189,3 +193,4 @@ output "harbor_public_ip_address" { output "harbor_hostname" { value = openstack_dns_recordset_v2.harbor_recordset.name } +*/