Fixing the heredoc issues and removing the old immich server
This commit is contained in:
parent
ad0f3e6089
commit
90c61d7c00
36
infra/static-vultr/build.sh
Normal file
36
infra/static-vultr/build.sh
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
opt=$1
|
||||||
|
plan=tfplan
|
||||||
|
|
||||||
|
build_plan() {
|
||||||
|
echo Generating plan
|
||||||
|
set -x
|
||||||
|
terraform plan -var-file variables.tfvars -input=false -out $plan
|
||||||
|
}
|
||||||
|
|
||||||
|
deploy_plan() {
|
||||||
|
terraform apply $plan
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
terraform init
|
||||||
|
}
|
||||||
|
|
||||||
|
help_prompt() {
|
||||||
|
cat <<- EOF
|
||||||
|
Options: plan deploy help
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Default to building a plan
|
||||||
|
source ./secrets.sh
|
||||||
|
case $opt in
|
||||||
|
plan) build_plan;;
|
||||||
|
deploy) deploy_plan;;
|
||||||
|
init) init;;
|
||||||
|
*) help_prompt;;
|
||||||
|
esac
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
# Here we define the resources for our temporary immich server
|
|
||||||
|
|
||||||
resource vultr_instance immich {
|
|
||||||
plan = var.host.plan
|
|
||||||
region = var.host.region
|
|
||||||
os_id = var.host.os
|
|
||||||
enable_ipv6 = true
|
|
||||||
|
|
||||||
# Enable backups for now since we're getting off of s3 as well at some point
|
|
||||||
backups = "enabled"
|
|
||||||
backups_schedule {
|
|
||||||
type = "weekly"
|
|
||||||
dow = var.host.backups.day
|
|
||||||
hour = var.host.backups.hour
|
|
||||||
}
|
|
||||||
|
|
||||||
ssh_key_ids = [ vultr_ssh_key.immich.id ]
|
|
||||||
firewall_group_id = vultr_firewall_group.host.id
|
|
||||||
label = "Immich Server"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -14,10 +14,3 @@ output vultr_key_id {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
output immich_key {
|
|
||||||
sensitive = true
|
|
||||||
# value = tls_private_key.host.private_key_openssh
|
|
||||||
value = vultr_instance.immich.default_password
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,18 +5,6 @@ resource tls_private_key host {
|
|||||||
|
|
||||||
resource vultr_ssh_key host {
|
resource vultr_ssh_key host {
|
||||||
name = "static_ssh_key"
|
name = "static_ssh_key"
|
||||||
ssh_key = tls_private_key.host.public_key_openssh
|
ssh_key = chomp(tls_private_key.host.public_key_openssh)
|
||||||
}
|
}
|
||||||
|
|
||||||
####################
|
|
||||||
# Immich keys #
|
|
||||||
####################
|
|
||||||
resource tls_private_key immich {
|
|
||||||
algorithm = "RSA"
|
|
||||||
rsa_bits = 4096
|
|
||||||
}
|
|
||||||
|
|
||||||
resource vultr_ssh_key immich {
|
|
||||||
name = "static_ssh_key"
|
|
||||||
ssh_key = tls_private_key.immich.public_key_openssh
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user