Fixing the heredoc issues and removing the old immich server
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 5s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 18s

This commit is contained in:
shockrah 2024-12-15 22:24:35 -08:00
parent ad0f3e6089
commit 90c61d7c00
5 changed files with 37 additions and 42 deletions

View 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

View File

@ -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"
}

View File

@ -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
}

View File

@ -5,18 +5,6 @@ resource tls_private_key host {
resource vultr_ssh_key host {
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
}