init
This commit is contained in:
37
terraform/stacks/proxmox/lxc/main.tf
Normal file
37
terraform/stacks/proxmox/lxc/main.tf
Normal file
@@ -0,0 +1,37 @@
|
||||
module "lxc_packer_main" {
|
||||
source = "../../../modules/proxmox/lxc"
|
||||
|
||||
vm_id = var.lxc_packer_main_vm_id
|
||||
hostname = var.lxc_packer_main_hostname
|
||||
target_node = var.target_node
|
||||
|
||||
template_file_id = var.lxc_template_file_id
|
||||
os_type = var.lxc_os_type
|
||||
|
||||
unprivileged = var.lxc_unprivileged
|
||||
nesting = var.lxc_nesting
|
||||
|
||||
cores = var.lxc_cores
|
||||
cpu_units = var.lxc_cpu_units
|
||||
memory = var.lxc_memory
|
||||
swap = var.lxc_swap
|
||||
|
||||
rootfs_storage = var.lxc_rootfs_storage
|
||||
rootfs_size_gib = var.lxc_rootfs_size_gib
|
||||
|
||||
bridge = var.bridge
|
||||
netif_name = var.lxc_netif_name
|
||||
firewall = var.lxc_firewall
|
||||
|
||||
ipv4_address = var.lxc_ipv4_address
|
||||
ipv4_gateway = var.lxc_ipv4_gateway
|
||||
|
||||
dns_domain = var.lxc_dns_domain
|
||||
dns_servers = var.lxc_dns_servers
|
||||
|
||||
started = var.lxc_started
|
||||
start_on_boot = var.lxc_start_on_boot
|
||||
|
||||
password = var.lxc_root_password
|
||||
ssh_public_keys = var.lxc_ssh_public_keys
|
||||
}
|
||||
10
terraform/stacks/proxmox/lxc/providers.tf
Executable file
10
terraform/stacks/proxmox/lxc/providers.tf
Executable file
@@ -0,0 +1,10 @@
|
||||
provider "proxmox" {
|
||||
endpoint = var.pm_api_url
|
||||
api_token = var.pm_api_token
|
||||
insecure = true
|
||||
|
||||
ssh {
|
||||
username = var.pm_user
|
||||
password = var.pm_password
|
||||
}
|
||||
}
|
||||
137
terraform/stacks/proxmox/lxc/variables.tf
Normal file
137
terraform/stacks/proxmox/lxc/variables.tf
Normal file
@@ -0,0 +1,137 @@
|
||||
# --- Proxmox provider creds ---
|
||||
variable "pm_api_url" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "pm_api_token" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "pm_user" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "pm_password" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
# --- Target infra ---
|
||||
variable "target_node" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "bridge" {
|
||||
type = string
|
||||
default = "vmbr0"
|
||||
}
|
||||
|
||||
# --- LXC конкретный контейнер ---
|
||||
variable "lxc_packer_main_vm_id" {
|
||||
type = number
|
||||
}
|
||||
|
||||
variable "lxc_packer_main_hostname" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "lxc_template_file_id" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "lxc_os_type" {
|
||||
type = string
|
||||
default = "debian"
|
||||
}
|
||||
|
||||
variable "lxc_unprivileged" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "lxc_nesting" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "lxc_cores" {
|
||||
type = number
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "lxc_cpu_units" {
|
||||
type = number
|
||||
default = 1024
|
||||
}
|
||||
|
||||
variable "lxc_memory" {
|
||||
type = number
|
||||
default = 512
|
||||
}
|
||||
|
||||
variable "lxc_swap" {
|
||||
type = number
|
||||
default = 512
|
||||
}
|
||||
|
||||
variable "lxc_rootfs_storage" {
|
||||
type = string
|
||||
default = "local-lvm"
|
||||
}
|
||||
|
||||
variable "lxc_rootfs_size_gib" {
|
||||
type = number
|
||||
default = 8
|
||||
}
|
||||
|
||||
variable "lxc_netif_name" {
|
||||
type = string
|
||||
default = "eth0"
|
||||
}
|
||||
|
||||
variable "lxc_firewall" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "lxc_ipv4_address" {
|
||||
type = string
|
||||
default = "dhcp"
|
||||
}
|
||||
|
||||
variable "lxc_ipv4_gateway" {
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "lxc_dns_domain" {
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "lxc_dns_servers" {
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "lxc_started" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "lxc_start_on_boot" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "lxc_root_password" {
|
||||
type = string
|
||||
sensitive = true
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "lxc_ssh_public_keys" {
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
10
terraform/stacks/proxmox/lxc/versions.tf
Normal file
10
terraform/stacks/proxmox/lxc/versions.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
terraform {
|
||||
required_version = ">= 1.6"
|
||||
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "bpg/proxmox"
|
||||
version = "0.86.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user