first commit
This commit is contained in:
25
main.tf
Normal file
25
main.tf
Normal file
@@ -0,0 +1,25 @@
|
||||
resource "proxmox_lxc" "lxc" {
|
||||
count = length(var.lxc)
|
||||
ostemplate = "${var.images_lxc}"
|
||||
password = "${var.lxc_auth.pass}"
|
||||
target_node = var.lxc[count.index].nodes
|
||||
unprivileged = var.lxc[count.index].unprivileged
|
||||
ssh_public_keys = <<-EOT
|
||||
${var.lxc_auth.ssh_keys}
|
||||
EOT
|
||||
hostname = var.lxc[count.index].name
|
||||
memory = var.lxc[count.index].mem
|
||||
cores = var.lxc[count.index].cpus
|
||||
nameserver = var.lxc[count.index].dns
|
||||
|
||||
rootfs {
|
||||
storage = var.lxc[count.index].pool
|
||||
size = var.lxc[count.index].disks
|
||||
}
|
||||
network {
|
||||
name = var.lxc[count.index].name
|
||||
bridge = var.lxc[count.index].eth
|
||||
ip = var.lxc[count.index].ip
|
||||
ip6 = "auto"
|
||||
}
|
||||
}
|
||||
0
outputs.tf
Normal file
0
outputs.tf
Normal file
7
providers.tf
Normal file
7
providers.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
provider "proxmox" {
|
||||
pm_tls_insecure = true
|
||||
pm_api_url = ""
|
||||
pm_api_token_secret = ""
|
||||
pm_api_token_id = ""
|
||||
pm_otp = ""
|
||||
}
|
||||
3
pve.auto.tfvars
Normal file
3
pve.auto.tfvars
Normal file
@@ -0,0 +1,3 @@
|
||||
pve_api_url = ""
|
||||
pve_api_token_id = ""
|
||||
pve_api_token_secret = ""
|
||||
18
terraform.tfvars
Normal file
18
terraform.tfvars
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
lxc_auth = {
|
||||
ssh_keys = ""
|
||||
pass = ""
|
||||
}
|
||||
lxc = [
|
||||
{
|
||||
nodes = ""
|
||||
name = ""
|
||||
cpus =
|
||||
mem =
|
||||
pool = ""
|
||||
disks = ""
|
||||
eth = ""
|
||||
ip = ""
|
||||
unprivileged = true
|
||||
}
|
||||
]
|
||||
26
variables.tf
Normal file
26
variables.tf
Normal file
@@ -0,0 +1,26 @@
|
||||
variable "images_lxc" {
|
||||
type = string
|
||||
default = "local:vztmpl/almalinux-9-default_20240911_amd64.tar.xz"
|
||||
}
|
||||
variable "lxc_auth" {
|
||||
type = object({
|
||||
ssh_keys = string,
|
||||
pass = string
|
||||
})
|
||||
}
|
||||
variable "lxc" {
|
||||
description = "Parametrs lxc"
|
||||
type = list(object({
|
||||
nodes = string,
|
||||
name = string,
|
||||
cpus = number,
|
||||
mem = number,
|
||||
pool = string,
|
||||
disks = string,
|
||||
eth = string,
|
||||
ip = string,
|
||||
unprivileged = bool
|
||||
dns = number
|
||||
})
|
||||
)
|
||||
}
|
||||
8
versions.tf
Normal file
8
versions.tf
Normal file
@@ -0,0 +1,8 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "telmate/proxmox"
|
||||
version = "3.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user