Skip to content

razorcorp/terraform-proxmox-lxc-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Proxmox LXC Module

Terraform module for provisioning LXC infrastructure on Proxmox

Usage example

Set the Proxmox server endpoint on the terminal

export PM_API_URL="https://proxmox.local:8006/api2/json"

main.tf

module "container" {
  source = "git::ssh://git@github.com:razorcorp/terraform-proxmox-lxc-module.git"

  proxmox_host = "orion.razorcorp.dev"
  datacenter   = "dc1"
  image        = "local:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz"
  hostname     = "sandbox"
  public_key   = "ssh-rsa AAAAB3N...."

  resources = {
    cpu    = 1
    memory = 4096
    swap   = 1024
  }

  disk = {
    size_gb = 50
    storage = "local-zfs"
  }

  networking = {
    bridge  = "vmbr0"
    ip_addr = "10.0.0.5"
    cidr    = 24
    gateway = "10.0.0.1"
  }

  tags = [
    "test"
  ]
}

Module Variables

Requirements

Name Version
Terraform >= 0.13
Telmate/proxmox >= 3.0.1-rc4

Providers

Name Version
Telmate/proxmox >= 3.0.1-rc4

Inputs

Name Required Description Type Default
datacenter Yes Proxmox datacenter name string N/A
image No OS temlate path for root fs extraction string local:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz
hostname Yes Container hostname string N/A
resources No Container resource configuration
object({
cpu = number
memory = number
swap = number
})
{
cpu = 1
memory = 1024
swap = 512
}
public_key Yes SSH public key include in the container string N/A
disk Yes Root disk options
object({
size_gb = number
storage = string
})
N/A
networking Yes Container network configuration
object({
bridge = string
ip_addr = string
cidr = number
gateway = string
})
N/A
nameservers No List of upstream DNS servers to use list(string) ["1.1.1.1", "8.8.8.8"]
options No Container option flags
object({
onboot = bool
start = bool
unprivileged = bool
nesting = bool
})
{
onboot = true
start = true
unprivileged = false
nesting = false
}
tags No List of tag to tag the container list(string) []

About

Terraform module for provisioning LXC infrastructure on Proxmox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages