bridge: explicitly declare ssh private key for hcloud

This commit is contained in:
Iain Learmonth 2022-05-14 14:43:30 +01:00
parent 850ee09ce7
commit 264d5a870e

View file

@ -7,7 +7,8 @@ class BridgeHcloudAutomation(BridgeAutomation):
provider = "hcloud" provider = "hcloud"
template_parameters = [ template_parameters = [
"hcloud_token" "hcloud_token",
"ssh_private_key_path"
] ]
template = """ template = """
@ -28,6 +29,10 @@ class BridgeHcloudAutomation(BridgeAutomation):
token = "{{ hcloud_token }}" token = "{{ hcloud_token }}"
} }
locals {
ssh_private_key = file("{{ ssh_private_key_path }}")
}
data "hcloud_datacenters" "ds" { data "hcloud_datacenters" "ds" {
} }
@ -59,12 +64,13 @@ class BridgeHcloudAutomation(BridgeAutomation):
module "bridge_{{ bridge.id }}" { module "bridge_{{ bridge.id }}" {
source = "sr2c/tor-bridge/hcloud" source = "sr2c/tor-bridge/hcloud"
version = "0.0.2" version = "0.0.3"
datacenter = one(random_shuffle.datacenter_{{ bridge.id }}.result) datacenter = one(random_shuffle.datacenter_{{ bridge.id }}.result)
context = module.label_{{ bridgeconf.group.id }}.context context = module.label_{{ bridgeconf.group.id }}.context
name = "br" name = "br"
attributes = ["{{ bridge.id }}"] attributes = ["{{ bridge.id }}"]
ssh_key_name = "bc" ssh_key_name = "bc"
ssh_private_key = local.ssh_private_key
contact_info = "hi" contact_info = "hi"
distribution_method = "{{ bridge.conf.method }}" distribution_method = "{{ bridge.conf.method }}"
} }