terraform-homelab/provider.tf

125 lines
2.1 KiB
Terraform
Raw Normal View History

2024-10-26 22:29:05 +10:00
terraform {
2024-11-02 12:28:46 +10:00
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = "3.0.1-rc4"
}
2024-10-26 22:29:05 +10:00
2024-11-02 12:28:46 +10:00
bitwarden = {
source = "maxlaverse/bitwarden"
version = "~> 0.1.0"
}
}
backend "pg" {
conn_str = "postgres://${var.tfusername}:${var.tfpassword}@${var.tfurl}"
}
encryption {
key_provider "pbkdf2" "mykey" {
passphrase = var.passphrase
key_length = 32
salt_length = 16
hash_function = "sha256"
}
method "aes_gcm" "secure_method" {
keys = key_provider.pbkdf2.mykey
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
state {
method = method.aes_gcm.secure_method
enforced = true
}
}
}
variable "teams" {
type = string
sensitive = true
}
variable "ci_user" {
type = string
sensitive = true
}
variable "ci_password" {
type = string
sensitive = true
}
variable "lxc_template" {
type = string
2024-10-26 22:29:05 +10:00
}
variable "proxmox_api_url" {
2024-11-02 12:28:46 +10:00
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
variable "proxmox_api_token_id" {
2024-11-02 12:28:46 +10:00
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
variable "proxmox_api_token_secret" {
2024-11-02 12:28:46 +10:00
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "ssh_key" {
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "passphrase" {
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "tfusername" {
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "tfpassword" {
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "tfurl" {
type = string
sensitive = true
}
variable "client_id" {
description = "Client ID for Bitwarden"
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
2024-11-02 12:28:46 +10:00
}
2024-10-26 22:29:05 +10:00
2024-11-02 12:28:46 +10:00
variable "client_secret" {
description = "Client Secret for Bitwarden"
type = string
sensitive = true
2024-10-26 22:29:05 +10:00
}
2024-11-02 12:28:46 +10:00
variable "master_password" {
description = "Client Master Password for Bitwarden"
type = string
sensitive = true
}
provider "proxmox" {
pm_api_url = var.proxmox_api_url
pm_api_token_id = var.proxmox_api_token_id
pm_api_token_secret = var.proxmox_api_token_secret
pm_timeout = 3600
pm_parallel = 2 # Fix VM HDD lock timeout
# Optional: Skip TLS Verification
# pm_tls_insecure = true
}