feat(id.tjo.space): changes
This commit is contained in:
parent
a81ea0cdd9
commit
0864eedc9e
4 changed files with 23 additions and 6 deletions
id.tjo.space
|
@ -28,3 +28,6 @@ ufw allow 22/tcp # SSH
|
|||
ufw allow 443/tcp # HTTPS
|
||||
ufw allow 636/tcp # LDAPS
|
||||
ufw enable
|
||||
|
||||
echo "=== Setup Containers"
|
||||
cp -r /id.tjo.space/containers /etc/containers/systemd/
|
||||
|
|
|
@ -63,13 +63,20 @@ outputs:
|
|||
cd {{source_directory()}}/terraform
|
||||
tofu output
|
||||
|
||||
configure:
|
||||
ssh node:
|
||||
#!/usr/bin/env sh
|
||||
pushd {{source_directory()}}/terraform > /dev/null
|
||||
IPV4=$(tofu output -json | jq -r '.ipv4[{{node}}]')
|
||||
popd > /dev/null
|
||||
ssh root@${IPV4}
|
||||
|
||||
configure node:
|
||||
#!/usr/bin/env sh
|
||||
set -eou pipefail
|
||||
|
||||
pushd {{source_directory()}}/terraform > /dev/null
|
||||
IPV4=$(tofu output -json | jq -r '.ipv4')
|
||||
IPV4=$(tofu output -json | jq -r '.ipv4[{{node}}]')
|
||||
popd > /dev/null
|
||||
|
||||
echo "= Provisioning id.tjo.space"
|
||||
cat install.sh | ssh ubuntu@${IPV4} 'sudo bash -s'
|
||||
cat install.sh | ssh root@${IPV4} 'sudo bash -s'
|
||||
|
|
|
@ -26,7 +26,7 @@ resource "hcloud_server" "main" {
|
|||
|
||||
user_data = <<-EOF
|
||||
#cloud-config
|
||||
hostname: ${each.key}
|
||||
hostname: "${each.key}"
|
||||
fqdn: id.tjo.space
|
||||
prefer_fqdn_over_hostname: true
|
||||
packages:
|
||||
|
@ -40,7 +40,7 @@ resource "hcloud_server" "main" {
|
|||
filename: /swapfile
|
||||
size: 512M
|
||||
runcmd:
|
||||
- bash <(curl -s https://raw.githubusercontent.com/tjo-space/tjo-space-infrastructure/refs/heads/main/install.sh)
|
||||
- "curl -sL https://raw.githubusercontent.com/tjo-space/tjo-space-infrastructure/refs/heads/main/id.tjo.space/install.sh | bash"
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
7
id.tjo.space/terraform/ouputs.tf
Normal file
7
id.tjo.space/terraform/ouputs.tf
Normal file
|
@ -0,0 +1,7 @@
|
|||
output "ipv4" {
|
||||
value = { for node in var.nodes: node => hcloud_server.main[node].ipv4_address }
|
||||
}
|
||||
|
||||
output "ipv6" {
|
||||
value = { for node in var.nodes: node => hcloud_server.main[node].ipv6_address }
|
||||
}
|
Loading…
Reference in a new issue