Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the users and define only ssh keys for Hetzner provider #36

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tf/core/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ terraform {
provider "hcloud" {
token = var.hcloud_token
}

# Manage ssh authorized keys so Hetzner can use them to provision our resources (e.g.: new VPS)
resource "hcloud_ssh_key" "ssh_keys" {
for_each = {
tf-benoit-000619776016 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIZtWY7t8HVnaz6bluYsrAlzZC3MZtb8g0nO5L5fCQKR [email protected]"
tf-florian-000018054987 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJlPneIaRT/mqu13N83ctEftub4O6zAfi6qgzZKerU5o [email protected]"
}

name = each.key
public_key = each.value
}
2 changes: 1 addition & 1 deletion tf/core/srv_webforge.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "hcloud_server" "webforge" {
"env" : "prod"
"source" : "tf-tahoe-lafs-core"
}
ssh_keys = [for k, v in local.ssh_keys : "tf-${v.name}"]
ssh_keys = [for k in hcloud_ssh_key.ssh_keys : k.name]
user_data = <<EOF
#cloud-config

Expand Down
48 changes: 0 additions & 48 deletions tf/core/users.tf

This file was deleted.