Skip to content

Commit 9c40a7b

Browse files
authored
Merge pull request #36 from tahoe-lafs/29.no-users-just-hcloud-keys
Drop the users and define only ssh keys for Hetzner provider
2 parents bd9564d + 093fcfb commit 9c40a7b

File tree

3 files changed

+12
-49
lines changed

3 files changed

+12
-49
lines changed

tf/core/providers.tf

+11
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ terraform {
1212
provider "hcloud" {
1313
token = var.hcloud_token
1414
}
15+
16+
# Manage ssh authorized keys so Hetzner can use them to provision our resources (e.g.: new VPS)
17+
resource "hcloud_ssh_key" "ssh_keys" {
18+
for_each = {
19+
tf-benoit-000619776016 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIZtWY7t8HVnaz6bluYsrAlzZC3MZtb8g0nO5L5fCQKR benoit@leastauthority.com"
20+
tf-florian-000018054987 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJlPneIaRT/mqu13N83ctEftub4O6zAfi6qgzZKerU5o florian@leastauthority.com"
21+
}
22+
23+
name = each.key
24+
public_key = each.value
25+
}

tf/core/srv_webforge.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource "hcloud_server" "webforge" {
1313
"env" : "prod"
1414
"source" : "tf-tahoe-lafs-core"
1515
}
16-
ssh_keys = [for k, v in local.ssh_keys : "tf-${v.name}"]
16+
ssh_keys = [for k in hcloud_ssh_key.ssh_keys : k.name]
1717
user_data = <<EOF
1818
#cloud-config
1919

tf/core/users.tf

-48
This file was deleted.

0 commit comments

Comments
 (0)