Skip to content

Commit 9c18944

Browse files
committed
minor
1 parent e24f4bc commit 9c18944

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
locals {
2-
public_key_filename = "${var.generate_ssh_key == "true" ? var.public_key_file : ""}"
32
private_key_filename = "${format("%s.%s", var.name, "key")}"
43
}
54

@@ -10,12 +9,14 @@ resource "openstack_compute_keypair_v2" "this" {
109

1110
resource "openstack_compute_keypair_v2" "this_provided" {
1211
count = "${1 - var.generate_ssh_key}"
12+
1313
name = "${var.name}"
1414
public_key = "${file("${var.public_key_file}")}"
1515
}
1616

1717
resource "local_file" "private_key_pem" {
1818
count = "${1 - var.generate_ssh_key}"
19+
1920
depends_on = ["openstack_compute_keypair_v2.this_provided"]
2021
content = "${openstack_compute_keypair_v2.this_provided.private_key}"
2122
filename = "${local.private_key_filename}"

0 commit comments

Comments
 (0)