lxc with drone-runner on proxmox via opentofu and ansible

This commit is contained in:
2026-02-23 23:55:29 +01:00
commit b29c73c404
10 changed files with 254 additions and 0 deletions

77
tofu/main.tf Normal file
View File

@@ -0,0 +1,77 @@
provider "proxmox" {
endpoint = var.proxmox_endpoint
username = "root@pam"
password = var.proxmox_password
insecure = true
ssh {
agent = true
username = "root"
}
}
resource "proxmox_virtual_environment_download_file" "debian_13_lxc_template" {
content_type = "vztmpl"
datastore_id = "local"
node_name = var.node_name
url = "http://download.proxmox.com/images/system/debian-13-standard_13.1-2_amd64.tar.zst"
}
resource "proxmox_virtual_environment_container" "drone_runner" {
node_name = var.node_name
vm_id = var.drone_runner_id
description = "Drone CI Runner with Docker"
unprivileged = false
started = true
features {
nesting = true
keyctl = true
}
operating_system {
template_file_id = proxmox_virtual_environment_download_file.debian_13_lxc_template.id
type = "debian"
}
initialization {
hostname = "drone-runner"
ip_config {
ipv4 {
address = var.drone_runner_ip
gateway = var.gateway
}
}
user_account {
keys = [trimspace(file(var.ssh_public_key_path))]
password = var.drone_runner_password
}
}
network_interface {
name = "eth0"
bridge = "vmbr0"
}
disk {
datastore_id = "local-lvm"
size = 16
}
cpu {
cores = 2
}
memory {
dedicated = 2048
swap = 512
}
startup {
order = "1"
}
}