use locals to deduplicate ssh key expressions
This commit is contained in:
@@ -27,8 +27,8 @@ resource "hcloud_server" "control_planes" {
|
||||
|
||||
connection {
|
||||
user = "root"
|
||||
private_key = var.private_key == null ? null : file(var.private_key)
|
||||
agent_identity = var.private_key == null ? file(var.public_key) : null
|
||||
private_key = local.ssh_private_key
|
||||
agent_identity = local.ssh_identity
|
||||
host = self.ipv4_address
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,8 @@ resource "hcloud_server" "control_planes" {
|
||||
|
||||
connection {
|
||||
user = "root"
|
||||
private_key = var.private_key == null ? null : file(var.private_key)
|
||||
agent_identity = var.private_key == null ? file(var.public_key) : null
|
||||
private_key = local.ssh_private_key
|
||||
agent_identity = local.ssh_identity
|
||||
host = self.ipv4_address
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user