-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
54 lines (49 loc) · 1.32 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# see https://github.com/hashicorp/terraform
terraform {
required_version = "1.7.5"
required_providers {
# see https://registry.terraform.io/providers/bpg/proxmox
# see https://github.com/bpg/terraform-provider-proxmox
proxmox = {
source = "bpg/proxmox"
version = "0.51.1"
}
}
}
provider "proxmox" {
tmp_dir = "tmp"
ssh {
node {
name = var.proxmox_pve_node_name
address = var.proxmox_pve_node_address
}
}
}
variable "proxmox_pve_node_name" {
type = string
default = "pve"
}
variable "proxmox_pve_node_address" {
type = string
}
# see https://github.com/siderolabs/talos/releases
# see https://www.talos.dev/v1.6/introduction/support-matrix/
variable "talos_version" {
type = string
# renovate: datasource=github-releases depName=siderolabs/talos
default = "1.6.7"
validation {
condition = can(regex("^\\d+(\\.\\d+)+", var.talos_version))
error_message = "Must be a version number."
}
}
# see https://registry.terraform.io/providers/bpg/proxmox/0.51.1/docs/resources/virtual_environment_file
resource "proxmox_virtual_environment_file" "talos" {
datastore_id = "local"
node_name = "pve"
content_type = "iso"
source_file {
path = "tmp/talos/talos-${var.talos_version}.qcow2"
file_name = "talos-${var.talos_version}.img"
}
}