Compare commits

...

20 Commits
v0.5.1 ... main

Author SHA1 Message Date
a8ceee4044 chore(release): v0.5.10 (#19)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.10

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #19
2025-01-13 20:18:30 +01:00
9087b75d5b
fix: make sure to not brick my reverse proxy
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-13 20:01:15 +01:00
8d7aea6894
chore(release): v0.5.9
All checks were successful
continuous-integration/drone/tag Build is passing
2025-01-13 20:01:15 +01:00
b793003532
chore: fall back on timestamp if file not exists
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:25:55 +01:00
cd84d66fc8 chore(release): v0.5.8 (#17)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.8

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #17
2025-01-12 14:23:22 +01:00
b7a50ec2de
fix: should've been equal
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:22:37 +01:00
2010b4328d chore(release): v0.5.7 (#16)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.7

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #16
2025-01-12 14:20:59 +01:00
e34b5f7b7b
feat: add trigger
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:20:19 +01:00
71963be181 chore(release): v0.5.6 (#15)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.6

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #15
2025-01-12 14:11:36 +01:00
50eeb579ce
feat: remove range from ip
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:11:00 +01:00
d228a92932 chore(release): v0.5.5 (#14)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.5

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #14
2025-01-12 14:05:25 +01:00
56eea90eff
chore: add caddy extension
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:04:50 +01:00
57199a21e8 chore(release): v0.5.4 (#13)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.4

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #13
2025-01-12 14:03:08 +01:00
57fd18ba04
fix: add port for proxy
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 14:02:33 +01:00
539f1ebb35 chore(release): v0.5.3 (#12)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore(release): 0.5.3

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #12
2025-01-12 13:57:52 +01:00
696fa83ef0
docs: further docs
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-12 13:52:07 +01:00
e2f49c997c
docs: add some docs
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-12 13:44:22 +01:00
6fc69da087
feat: add remote node configuration
Some checks failed
continuous-integration/drone/push Build is failing
2025-01-12 13:38:45 +01:00
0f414cee73
chore(release): v0.5.2 (#11)
All checks were successful
continuous-integration/drone/tag Build is passing
chore(release): 0.5.2

Co-authored-by: cuddle-please <bot@cuddle.sh>
Reviewed-on: #11
2025-01-12 13:38:45 +01:00
1f65d3c75e
feat: add ability to set disk size
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-11 22:05:44 +01:00
5 changed files with 106 additions and 2 deletions

View File

@ -6,6 +6,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [0.5.10] - 2025-01-13
### Fixed
- make sure to not brick my reverse proxy
## [0.5.8] - 2025-01-12
### Fixed
- should've been equal
## [0.5.7] - 2025-01-12
### Added
- add trigger
## [0.5.6] - 2025-01-12
### Added
- remove range from ip
## [0.5.5] - 2025-01-12
### Other
- add caddy extension
## [0.5.4] - 2025-01-12
### Fixed
- add port for proxy
## [0.5.3] - 2025-01-12
### Added
- add remote node configuration
### Docs
- further docs
- add some docs
## [0.5.2] - 2025-01-11
### Added
- add ability to set disk size
## [0.5.1] - 2025-01-11 ## [0.5.1] - 2025-01-11
### Added ### Added

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# clank node
Setup up a virtual machine easily, and get an internal hostname for named usage

4
files/node.caddy Normal file
View File

@ -0,0 +1,4 @@
@${name}-node ${replace(name, "_", "-")}.nodes.i.kjuulh.io
handle @${name}-node {
reverse_proxy ${split("/", ip)[0]}:80
}

38
node.tf
View File

@ -3,6 +3,11 @@ locals {
hostname = var.name hostname = var.name
domain = var.domain domain = var.domain
}) })
node_config = templatefile("${path.module}/files/node.caddy", {
name = var.name
ip = var.ip_address
})
} }
# Create a local copy of the file, to transfer to Proxmox # Create a local copy of the file, to transfer to Proxmox
@ -11,6 +16,11 @@ resource "local_file" "cloud_init_deb12_node" {
filename = "${path.module}/files/user_data_cloud_init_deb12_${var.name}.cfg" filename = "${path.module}/files/user_data_cloud_init_deb12_${var.name}.cfg"
} }
resource "local_file" "node_caddy" {
content = local.node_config
filename = "${path.module}/files/${var.name}.caddy"
}
# Transfer the file to the Proxmox Host # Transfer the file to the Proxmox Host
resource "null_resource" "cloud_init_deb12_node" { resource "null_resource" "cloud_init_deb12_node" {
connection { connection {
@ -30,13 +40,37 @@ resource "null_resource" "cloud_init_deb12_node" {
] ]
} }
resource "null_resource" "node_caddy_template" {
triggers = {
file_content = fileexists(local_file.node_caddy.filename) ? filemd5(local_file.node_caddy.filename) : timestamp()
}
connection {
type = "ssh"
user = "root"
private_key = var.ssh_private
host = var.proxy_ip
port = var.proxy_port
}
provisioner "file" {
source = local_file.node_caddy.filename
destination = "${var.proxy_location}/${var.name}.caddy"
}
depends_on = [
local_file.node_caddy
]
}
# Create the VM # Create the VM
resource "proxmox_vm_qemu" "node" { resource "proxmox_vm_qemu" "node" {
## Wait for the cloud-config file to exist ## Wait for the cloud-config file to exist
depends_on = [ depends_on = [
null_resource.cloud_init_deb12_node null_resource.cloud_init_deb12_node,
null_resource.node_caddy_template
] ]
name = var.name name = var.name
@ -84,7 +118,7 @@ resource "proxmox_vm_qemu" "node" {
disk { disk {
storage = "local" storage = "local"
# The size of the disk should be at least as big as the disk in the template. If it's smaller, the disk will be recreated # The size of the disk should be at least as big as the disk in the template. If it's smaller, the disk will be recreated
size = "10G" size = var.disk_size
} }
} }
} }

View File

@ -8,6 +8,21 @@ variable "proxmox_ip" {
default = "10.0.11.0" default = "10.0.11.0"
} }
variable "proxy_ip" {
description = "which ip to use for the caddy file"
default = "10.0.9.0"
}
variable "proxy_port" {
description = "which port to use for the caddy file"
default = 222
}
variable "proxy_location" {
description = "which where to place the files upstream"
default = "/root/wireguard/nodes"
}
variable "proxmox_node" { variable "proxmox_node" {
description = "which node is the vm associated" description = "which node is the vm associated"
default = "clank-smolboks-0" default = "clank-smolboks-0"
@ -57,3 +72,7 @@ variable "cpu" {
variable "memory" { variable "memory" {
default = 512 default = 512
} }
variable "disk_size" {
default = "10G"
}