diff --git a/libvirt-host.tf b/libvirt-host.tf index 6d8dcb5..22ef84c 100644 --- a/libvirt-host.tf +++ b/libvirt-host.tf @@ -24,6 +24,12 @@ resource "local_file" "private_key_file" { file_permission = "0600" } +resource "local_file" "public_key_file" { + filename = "${path.module}/output/${var.infra_name}_id_rsa.pub" + content = tls_private_key.private_key.public_key_openssh + file_permission = "0600" +} + resource "equinix_metal_project_ssh_key" "public_key" { name = "${var.infra_name}-pub-key" diff --git a/output.tf b/output.tf index d4e0053..791241b 100644 --- a/output.tf +++ b/output.tf @@ -24,3 +24,16 @@ output "k8s_worker_ip_mac_hostname_maps" { description = "k8s workers maps including ipv4/mac/hostname/ipv6" value = local.k8s_worker_ip_mac_hostname_map } + + +output "ssh_public_key_file_path" { + description = "public key file path for this project" + value = local_file.public_key_file.filename + +} + +output "ssh_private_key_file_path" { + description = "private key file path for this project" + value = local_file.private_key_file.filename + +} \ No newline at end of file