2025-03-05 21:43:20 +00:00
|
|
|
default:
|
|
|
|
@just --list
|
|
|
|
|
2025-03-07 11:13:53 +00:00
|
|
|
secrets-encrypt:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
age --encrypt \
|
|
|
|
-r age1cl3d4wtrrqrgldmrzpu53q2mk60r7hrhrymsrwss8s57z4mdv9fst4a55h \
|
|
|
|
-r age1a4t9l73au9fqfk0x5kw6v06ewwpl0lurw73f3m60c5ly58r3hp5q6shdfr \
|
|
|
|
secrets.env > secrets.env.encrypted
|
|
|
|
|
|
|
|
secrets-decrypt:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
age --decrypt \
|
|
|
|
-i ${HOME}/.config/sops/age/keys.txt \
|
|
|
|
secrets.env.encrypted > secrets.env
|
|
|
|
|
2025-03-05 21:43:20 +00:00
|
|
|
apply:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
cd {{source_directory()}}/terraform
|
|
|
|
tofu init
|
|
|
|
tofu apply
|
|
|
|
|
|
|
|
destroy:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
cd {{source_directory()}}/terraform
|
|
|
|
tofu destroy
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
cd {{source_directory()}}/terraform
|
|
|
|
tofu output
|
|
|
|
|
2025-03-07 11:13:53 +00:00
|
|
|
provision node:
|
2025-03-06 19:31:24 +00:00
|
|
|
#!/usr/bin/env sh
|
2025-03-07 11:13:53 +00:00
|
|
|
set -eou pipefail
|
|
|
|
|
2025-03-06 19:31:24 +00:00
|
|
|
pushd {{source_directory()}}/terraform > /dev/null
|
2025-03-07 11:13:53 +00:00
|
|
|
IPV4=$(tofu output -json | jq -r '.ipv4.value["{{node}}"]')
|
2025-03-06 19:31:24 +00:00
|
|
|
popd > /dev/null
|
2025-03-07 11:13:53 +00:00
|
|
|
|
|
|
|
echo "= Provision node: {{node}} (${IPV4})"
|
|
|
|
cat provision.sh | ssh -o StrictHostKeyChecking=no root@${IPV4} 'sudo bash -s'
|
2025-03-06 19:31:24 +00:00
|
|
|
|
|
|
|
configure node:
|
2025-03-05 21:43:20 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
|
|
pushd {{source_directory()}}/terraform > /dev/null
|
2025-03-07 11:13:53 +00:00
|
|
|
IPV4=$(tofu output -json | jq -r '.ipv4.value["{{node}}"]')
|
2025-03-05 21:43:20 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
2025-03-07 11:13:53 +00:00
|
|
|
echo "= Configuring node: {{node}} (${IPV4})"
|
|
|
|
cat configure.sh | ssh -o StrictHostKeyChecking=no root@${IPV4} 'sudo bash -s'
|