Files
calchat-pipeline/tofu/drone-runner.tf

76 lines
1.5 KiB
HCL

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"
}
}
output "drone_runner_id" {
description = "VMID of the Drone Runner LXC"
value = proxmox_virtual_environment_container.drone_runner.vm_id
}
output "drone_runner_ip" {
description = "IP address of the Drone Runner LXC"
value = var.drone_runner_ip
}