forked from clan/clan-infra
fix sops encryption
This commit is contained in:
parent
b5a991b631
commit
2bedc30e94
@ -1,7 +1,7 @@
|
||||
keys:
|
||||
- &joerg age17n64ahe3wesh8l8lj0zylf4nljdmqn28hvqns2g7hgm9mdkhlsvsjuvkxz
|
||||
creation_rules:
|
||||
- path_regex: targets/.*/terraform.tfstate.sops$
|
||||
- path_regex: targets/.*/terraform.tfstate$
|
||||
key_groups:
|
||||
- age:
|
||||
- *joerg
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
rm -f .terraform.lock.hcl
|
||||
TFSTATE=$(mktemp)
|
||||
if [[ -f "terraform.tfstate.sops" ]]; then
|
||||
sops -d terraform.tfstate.sops > "$TFSTATE"
|
||||
fi
|
||||
toplevel=$(git rev-parse --show-toplevel)
|
||||
backupdir=$toplevel/.git/terraform/$(basename "$(dirname "$0")")
|
||||
cleanup() {
|
||||
sops -e "$TFSTATE" > terraform.tfstate.sops && rm -f "$TFSTATE"
|
||||
}
|
||||
trap "cleanup" EXIT
|
||||
terraform init -backup="$backupdir" -state-out="$TFSTATE"
|
||||
terraform apply -backup="$backupdir" -state-out="$TFSTATE"
|
20
targets/admins/terraform.tfstate
Normal file
20
targets/admins/terraform.tfstate
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"data": "ENC[AES256_GCM,data:C69HvY7rkUg4iVFI+J8aHWHes6sIHmScXBMxsZBlCEzUeVCx5KNvtVlCX47o6Kf7Mbj6Gsj1iSepiGoChAISd9LQhoUpI5ZJC/TBvBRjSIr945vdH/gtO1pQdM9/iCcmZNN3RK0flbsFURqlBcfxt44zv7rEvlpNIKVG+tBLiRM+ajJxTuZdxCqkw6c1Uvbaw9cNjSfYYTMj1fu+TapjNJGLDFxq9niIKv1tXAZA1nNjiNsxOm7Tq8VHqhqze4LC+AQHQciuVQGdVA4X32iK07NQKqe5Z/s4g6pJrVaHVy7mffAuZ1oPthw1aEj49V4aiCWq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ixv9+6G6pNsO1tBrLWQr72ZxvBbFnKC9P0jtBx2sucqkzmc3AQTiGpDjlMfPr4wSeMleG1F6wWHoaR2E41x1739+y4HUF6nUrSkCl4f78qUZjJwLqHcrUvhBLDUvzv4G9/U2GWKc5d9m2F91NQvBU3PS2eyzTWMwQCOa87v7S5kRFsSJDfqkTKFKMe6qp/oDajMfWkxC1RQZXNMkhXrMPy7ewqisNaFjIeVwt6CqLoAAbEbm1dDUJTzpA20H20K44qwvkXcrrN+Jd557XT0NrrtrvRpF/of2Ww/HC+etJt8ojqeCgsS6es3qleyLwYUsjJa23WJxyUrBM7w=,iv:Vri/cfI1/U73XZiqY+AsPEbOh1HTxCiusy736NvsnH0=,tag:1VYcrPmunR45EeK3l4pMQg==,type:str]",
|
||||
"sops": {
|
||||
"kms": null,
|
||||
"gcp_kms": null,
|
||||
"azure_kv": null,
|
||||
"hc_vault": null,
|
||||
"age": [
|
||||
{
|
||||
"recipient": "age17n64ahe3wesh8l8lj0zylf4nljdmqn28hvqns2g7hgm9mdkhlsvsjuvkxz",
|
||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsQ1VZejVPbnJnS1dHVW1y\nWWRKMHR3NjB1azVkRCttMytrcmgwaEZxWW5ZCm5MeGN0bFRYajlXSTVMM2haQytC\neUhXbEhwTkVjbGNxYVNHKzZ0NTFPQ0EKLS0tIDlFQzNMbXBUSUMyZ2dtSHJHWGNJ\nbUE4OEhpZDRnWEZqVGVNdEVHekQ5QzQKH7LQ/Ih6GHdqHSt0EtpYbrG+CYwyFIHF\nZ/bcRSvrBYlLs4bh5MxJbxYyUNRGGQjESDuT/bZL8HkicWYjQONu7w==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||
}
|
||||
],
|
||||
"lastmodified": "2023-07-04T15:50:45Z",
|
||||
"mac": "ENC[AES256_GCM,data:ROEpiYvLNqMpMj4Q5Kuxp1jJ1YsdTd19VdQSI09Jhcx5qNr5cbBYcWTO/548/x6lMTCELMy1nXciYjiDTt1lwR3eisXt0B5nZUaZ9cSu/EtXHC2esrsox0R+WRpOcMDYZiA6XIaNMNd2NYL/ePM3uZTZhC3UF+aDEeKPTiTowkk=,iv:y+vQ+qsM0tV5bBQRuysvnNu0REaRrtAu7NkdkMwm8cI=,tag:OJ9t3cbTTg/tApvnnyzCLA==,type:str]",
|
||||
"pgp": null,
|
||||
"unencrypted_suffix": "_unencrypted",
|
||||
"version": "3.7.3"
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"data": "ENC[AES256_GCM,data:1Fhkht0WrTHNQZqgdm8HFHjoexlfyFP9aFVzQ9HM+bK3ycLeZfT21aRJg8RsPo7Y/5zds0iDTulKxDj4DO1UcLFGEg9dTduEpWFWGqS6aRoLkddWj6vuCt7jL9DebTusAItVs27M7W9kcG970NqCE+62XUqiYxInLm8IEthh4tnzBR0wRrHhkojoUk2GHNv8w3zpb9GJrofBeoJB7+lHinbNoISBBmepTMpOlZR096j147pgRqqueNllw2xWE8YWMxgRIYE4MoW5U+1kPMmZgcnMtHFz0Ft5JqtjLR2GEI5kc29es+AfERMaTMnjT3PEw9k66QzkVN7F/fgzkO5Y8wQL+9GP/FomZEszZ6UjCi5pRTh8UqWxTssyEEwihJQ4on4v3agl7RW+4NNXxKuP/paguZyOROii+cRrAjyp145UMeQ9EbIvYZxw5Kc6C+bnN/YMytvqQcklf1R5b/TTMczlaojmeCvIeqOMgfDmBqdpOtOF9LWlhK9ICAIw5wYa1hfhajy1Njva1ueRS3VEpRKCGDjDOrQIfPRP/KIIDeNbtUTn094ttbfEpRCj2heP3UweyYK55OSJalkXdxAtoK6SKxVFmkKVsUxAwxJh4c1g1DpuBSmIeSL5cDd1OD93oQWGUGTN9hnXR+Yub97yzr5OQVrGSDq98zpMzVIddIpQ6U8BT0jRhT4co/pYqPNXSFLd7mbW0CamouRrwHGm2B2nhREX64ZyH3wGVSN4BMF9oN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
||||
"gcp_kms": null,
|
||||
"azure_kv": null,
|
||||
"hc_vault": null,
|
||||
"age": [
|
||||
{
|
||||
"recipient": "age17n64ahe3wesh8l8lj0zylf4nljdmqn28hvqns2g7hgm9mdkhlsvsjuvkxz",
|
||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBtYmYvczZrNHEzeTVvaXRH\nbEJGb1lZL2xrMTBOdGlyc0l3RnpHWU1YZTI0CkNEYy9EVEFITFVGOE5Mc2dsZktV\nM2tacVc3RGlqeHlsL2RuMGZQYUtscmsKLS0tIHFGVWRBNGpyNkptV0FRcHpMV1Jk\nSCs4c1lFaFU3WkcrWkQzcktKRkJCdVkKneJko1lw5CkORymxfibErFRb8fJEQl2E\naPNlUCAknCrb+raWClkbXFY1MSCcxrkFV+tx69O8hLaTlGUPnmGAeQ==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||
}
|
||||
],
|
||||
"lastmodified": "2023-07-04T15:15:37Z",
|
||||
"mac": "ENC[AES256_GCM,data:VMnIZxSc8QKp8s69gCvteTKkrlXP7/AkWamtnbd6SFCbhubpKoY88gyXv9QHLKwqclkKHyz3U9GsnvnEb3OUb8RX21l8bVPwB98OiLcBgd54KlizVVmz8fUDjjQf41PzuSs5LI0QoVKypfphtLjRViptBDPmCDYWk4Q1jEjARgs=,iv:BUgslpHCBnSnBSWUC62U0b0hqIC6l8RPKOeExXHhMgM=,tag:px/qDIZuycqn5NnDJa73ZA==,type:str]",
|
||||
"pgp": null,
|
||||
"unencrypted_suffix": "_unencrypted",
|
||||
"version": "3.7.3"
|
||||
}
|
||||
}
|
13
targets/admins/tf.sh
Executable file
13
targets/admins/tf.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
rm -f .terraform.lock.hcl
|
||||
if grep -q .sops terraform.tfstate; then
|
||||
sops -i -d terraform.tfstate || true
|
||||
fi
|
||||
cleanup() {
|
||||
sops -i -e terraform.tfstate
|
||||
}
|
||||
trap "cleanup" EXIT
|
||||
terraform init
|
||||
terraform "$@"
|
@ -1 +0,0 @@
|
||||
../admins/apply.sh
|
@ -2,7 +2,7 @@
|
||||
nixosVars = builtins.fromJSON (builtins.readFile ./nixos-vars.json);
|
||||
in {
|
||||
imports = [
|
||||
self.nixosModules.nixos-wiki
|
||||
self.nixosModules.web01
|
||||
self.nixosModules.hcloud
|
||||
];
|
||||
users.users.root.openssh.authorizedKeys.keys = nixosVars.ssh_keys;
|
||||
|
1
targets/web01/nixos-vars.json
Normal file
1
targets/web01/nixos-vars.json
Normal file
@ -0,0 +1 @@
|
||||
{"ipv6_address":"2a01:4f9:c010:ab77::1","ssh_keys":["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIb3uuMqE/xSJ7WL/XpJ6QOj4aSmh0Ga+GtmJl3CDvljGuIeGCKh7YAoqZAi051k5j6ZWowDrcWYHIOU+h0eZCesgCf+CvunlXeUz6XShVMjyZo87f2JPs2Hpb+u/ieLx4wGQvo/Zw89pOly/vqpaX9ZwyIR+U81IAVrHIhqmrTitp+2FwggtaY4FtD6WIyf1hPtrrDecX8iDhnHHuGhATr8etMLwdwQ2kIBx5BBgCoiuW7wXnLUBBVYeO3II957XP/yU82c+DjSVJtejODmRAM/3rk+B7pdF5ShRVVFyB6JJR+Qd1g8iSH+2QXLUy3NM2LN5u5p2oTjUOzoEPWZo7lykZzmIWd/5hjTW9YiHC+A8xsCxQqs87D9HK9hLA6udZ6CGkq4hG/6wFwNjSMnv30IcHZzx6IBihNGbrisrJhLxEiKWpMKYgeemhIirefXA6UxVfiwHg3gJ8BlEBsj0tl/HVARifR2y336YINEn8AsHGhwrPTBFOnBTmfA/VnP1NlWHzXCfVimP6YVvdoGCCnAwvFuJ+ZuxmZ3UzBb2TenZZOzwzV0sUzZk0D1CaSBFJUU3oZNOkDIM6z5lIZgzsyKwb38S8Vs3HYE+Dqpkfsl4yeU5ldc6DwrlVwuSIa4vVus4eWD3gDGFrx98yaqOx17pc4CC9KXk/2TjtJY5xmQ==","ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbBp2dH2X3dcU1zh+xW3ZsdYROKpJd3n13ssOP092qE joerg@turingmachine"]}
|
@ -5,6 +5,7 @@ terraform {
|
||||
module "web01" {
|
||||
source = "../../terraform/web01"
|
||||
domain = "clan.lol"
|
||||
netlify_dns_zone = "clan.lol"
|
||||
nixos_flake_attr = "web01"
|
||||
nixos_vars_file = "${path.module}/nixos-vars.json"
|
||||
tags = {
|
||||
|
20
targets/web01/terraform.tfstate
Normal file
20
targets/web01/terraform.tfstate
Normal file
File diff suppressed because one or more lines are too long
1
targets/web01/tf.sh
Symbolic link
1
targets/web01/tf.sh
Symbolic link
@ -0,0 +1 @@
|
||||
../admins/tf.sh
|
@ -3,6 +3,6 @@ resource "hcloud_ssh_key" "hcloud" {
|
||||
name = each.key
|
||||
public_key = each.value
|
||||
labels = {
|
||||
"wiki" = "true"
|
||||
"web01" = "true"
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
resource "netlify_dns_zone" "nixos" {
|
||||
resource "netlify_dns_zone" "server" {
|
||||
site_id = ""
|
||||
name = var.netlify_dns_zone
|
||||
}
|
||||
|
||||
resource "netlify_dns_record" "nixos_wiki_a" {
|
||||
zone_id = netlify_dns_zone.nixos.id
|
||||
resource "netlify_dns_record" "server_a" {
|
||||
zone_id = netlify_dns_zone.server.id
|
||||
hostname = var.domain
|
||||
type = "A"
|
||||
value = hcloud_server.nixos_wiki.ipv4_address
|
||||
value = hcloud_server.server.ipv4_address
|
||||
}
|
||||
|
||||
resource "netlify_dns_record" "nixos_wiki_aaaa" {
|
||||
zone_id = netlify_dns_zone.nixos.id
|
||||
resource "netlify_dns_record" "server_aaaa" {
|
||||
zone_id = netlify_dns_zone.server.id
|
||||
hostname = var.domain
|
||||
type = "AAAA"
|
||||
value = hcloud_server.nixos_wiki.ipv6_address
|
||||
value = hcloud_server.server.ipv6_address
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
# Record the SSH public key into Hetzner Cloud
|
||||
data "hcloud_ssh_keys" "nixos_wiki" {
|
||||
with_selector = "wiki=true"
|
||||
data "hcloud_ssh_keys" "server" {
|
||||
with_selector = "web01=true"
|
||||
}
|
||||
|
||||
resource "hcloud_server" "nixos_wiki" {
|
||||
resource "hcloud_server" "server" {
|
||||
image = "debian-10"
|
||||
keep_disk = true
|
||||
name = "nixos-wiki"
|
||||
name = "web01"
|
||||
server_type = var.server_type
|
||||
ssh_keys = data.hcloud_ssh_keys.nixos_wiki.ssh_keys.*.name
|
||||
ssh_keys = data.hcloud_ssh_keys.server.ssh_keys.*.name
|
||||
backups = false
|
||||
labels = var.tags
|
||||
|
||||
@ -26,14 +26,14 @@ module "deploy" {
|
||||
source = "github.com/numtide/nixos-anywhere//terraform/all-in-one"
|
||||
nixos_system_attr = ".#nixosConfigurations.${var.nixos_flake_attr}.config.system.build.toplevel"
|
||||
nixos_partitioner_attr = ".#nixosConfigurations.${var.nixos_flake_attr}.config.system.build.diskoNoDeps"
|
||||
target_host = hcloud_server.nixos_wiki.ipv4_address
|
||||
instance_id = hcloud_server.nixos_wiki.id
|
||||
target_host = hcloud_server.server.ipv4_address
|
||||
instance_id = hcloud_server.server.id
|
||||
debug_logging = true
|
||||
}
|
||||
|
||||
locals {
|
||||
nixos_vars = {
|
||||
ipv6_address = hcloud_server.nixos_wiki.ipv6_address
|
||||
ssh_keys = data.hcloud_ssh_keys.nixos_wiki.ssh_keys.*.public_key
|
||||
ipv6_address = hcloud_server.server.ipv6_address
|
||||
ssh_keys = data.hcloud_ssh_keys.server.ssh_keys.*.public_key
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
variable "server_type" {
|
||||
type = string
|
||||
default = "cx21"
|
||||
default = "cx31"
|
||||
description = "Hetzner cloud server type"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user