telmate to bpg provider switch
This commit is contained in:
1 parent
e4feb7ed7d
commit
954b488565
4 files changed
+20
-16
No files matched your search
+1
-1
Submodule opentofu updated: db481e796d...aabd3838f7.
+11
-12
@@ -1,8 +1,8 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
proxmox = {
|
proxmox = {
|
||||||
source = "telmate/proxmox"
|
source = "bpg/proxmox"
|
||||||
version = "3.0.2-rc04"
|
version = "0.112.0"
|
||||||
}
|
}
|
||||||
local = {
|
local = {
|
||||||
source = "hashicorp/local"
|
source = "hashicorp/local"
|
||||||
@@ -65,18 +65,17 @@ data "external" "infisical" {
|
|||||||
# nest_custom_fields = false
|
# nest_custom_fields = false
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
# One provider alias per hypervisor. The API token is "user@realm!tokenid=secret".
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
alias = "proxmox"
|
alias = "proxmox"
|
||||||
pm_api_url = var.hypervisors["proxmox"].api_url
|
endpoint = trimsuffix(var.hypervisors["proxmox"].api_url, "/api2/json")
|
||||||
pm_api_token_id = data.external.infisical.result["token_id"]
|
api_token = "${data.external.infisical.result["token_id"]}=${data.external.infisical.result["hv2_token_secret"]}"
|
||||||
pm_api_token_secret = data.external.infisical.result["hv2_token_secret"]
|
insecure = true
|
||||||
pm_tls_insecure = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
alias = "goose"
|
alias = "goose"
|
||||||
pm_api_url = var.hypervisors["goose"].api_url
|
endpoint = trimsuffix(var.hypervisors["goose"].api_url, "/api2/json")
|
||||||
pm_api_token_id = data.external.infisical.result["token_id"]
|
api_token = "${data.external.infisical.result["token_id"]}=${data.external.infisical.result["goose_token_secret"]}"
|
||||||
pm_api_token_secret = data.external.infisical.result["goose_token_secret"]
|
insecure = true
|
||||||
pm_tls_insecure = true
|
|
||||||
}
|
}
|
||||||
+4
-2
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
hypervisors = {
|
hypervisors = {
|
||||||
proxmox = {
|
proxmox = {
|
||||||
api_url = "https://192.168.7.240:8006/api2/json"
|
api_url = "https://192.168.7.240:8006/"
|
||||||
node_name = "pve"
|
node_name = "pve"
|
||||||
storage = "local-lvm"
|
storage = "local-lvm"
|
||||||
}
|
}
|
||||||
goose = {
|
goose = {
|
||||||
api_url = "https://192.168.7.241:8006/api2/json"
|
api_url = "https://192.168.7.241:8006/"
|
||||||
node_name = "goose"
|
node_name = "goose"
|
||||||
storage = "local-lvm"
|
storage = "local-lvm"
|
||||||
}
|
}
|
||||||
@@ -175,6 +175,7 @@ nodes = {
|
|||||||
disk_size = "32G"
|
disk_size = "32G"
|
||||||
nic_name = "eth0"
|
nic_name = "eth0"
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
|
vlan = 1
|
||||||
ip = "192.168.0.200/24"
|
ip = "192.168.0.200/24"
|
||||||
nameserver = "192.168.0.2"
|
nameserver = "192.168.0.2"
|
||||||
gw = "192.168.0.1"
|
gw = "192.168.0.1"
|
||||||
@@ -191,6 +192,7 @@ nodes = {
|
|||||||
disk_size = "32G"
|
disk_size = "32G"
|
||||||
nic_name = "eth0"
|
nic_name = "eth0"
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
|
vlan = 1
|
||||||
ip = "192.168.0.202/24"
|
ip = "192.168.0.202/24"
|
||||||
nameserver = "192.168.0.2"
|
nameserver = "192.168.0.2"
|
||||||
gw = "192.168.0.1"
|
gw = "192.168.0.1"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
variable "hypervisors" {
|
variable "hypervisors" {
|
||||||
description = "Per-hypervisor configuration. Keys must match provider aliases in providers.tf (e.g. hv2, hv3)."
|
description = "Per-hypervisor configuration. Keys must match provider aliases in providers.tf (e.g. hv2, hv3)."
|
||||||
type = map(object({
|
type = map(object({
|
||||||
api_url = string
|
api_url = string # e.g. https://192.168.1.10:8006/
|
||||||
node_name = string
|
node_name = string
|
||||||
storage = string
|
storage = string
|
||||||
}))
|
}))
|
||||||
@@ -106,14 +106,17 @@ variable "nodes" {
|
|||||||
hostname = string
|
hostname = string
|
||||||
vmid = number
|
vmid = number
|
||||||
template = string
|
template = string
|
||||||
|
os_type = optional(string, "debian")
|
||||||
unprivileged = bool
|
unprivileged = bool
|
||||||
onboot = bool
|
onboot = bool
|
||||||
tags = string
|
tags = string
|
||||||
|
cores = optional(number, 1)
|
||||||
memory = number
|
memory = number
|
||||||
swap = number
|
swap = number
|
||||||
disk_size = string
|
disk_size = string
|
||||||
nic_name = string
|
nic_name = string
|
||||||
bridge = string
|
bridge = string
|
||||||
|
vlan = optional(number)
|
||||||
ip = string
|
ip = string
|
||||||
nameserver = optional(string)
|
nameserver = optional(string)
|
||||||
gw = string
|
gw = string
|
||||||
|
|||||||
Reference in new issue
Block a user