k3s: debian vm and manifest
This commit is contained in:
75
tofu/drone-runner.tf
Normal file
75
tofu/drone-runner.tf
Normal file
@@ -0,0 +1,75 @@
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user