Skip to content

Commit

Permalink
add the private/public key file
Browse files Browse the repository at this point in the history
  • Loading branch information
liyihuang committed Jul 5, 2024
1 parent fd0d0e1 commit a18fd69
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libvirt-host.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

0 comments on commit a18fd69

Please sign in to comment.