Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
22707124b4 |
@@ -6,15 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.5.3] - 2025-01-12
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- add remote node configuration
|
|
||||||
|
|
||||||
### Docs
|
|
||||||
- further docs
|
|
||||||
- add some docs
|
|
||||||
|
|
||||||
## [0.5.2] - 2025-01-11
|
## [0.5.2] - 2025-01-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
# clank node
|
|
||||||
|
|
||||||
Setup up a virtual machine easily, and get an internal hostname for named usage
|
|
@@ -1,4 +0,0 @@
|
|||||||
@${name}-node ${replace(name, "_", "-")}.nodes.i.kjuulh.io
|
|
||||||
handle ${name}-node {
|
|
||||||
reverse-proxy ${ip}:80
|
|
||||||
}
|
|
31
node.tf
31
node.tf
@@ -3,11 +3,6 @@ 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
|
||||||
@@ -16,11 +11,6 @@ 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 {
|
||||||
@@ -40,32 +30,13 @@ resource "null_resource" "cloud_init_deb12_node" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "null_resource" "node_caddy_template" {
|
|
||||||
connection {
|
|
||||||
type = "ssh"
|
|
||||||
user = "root"
|
|
||||||
private_key = var.ssh_private
|
|
||||||
host = var.proxy_ip
|
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "file" {
|
|
||||||
source = local_file.node_caddy.filename
|
|
||||||
destination = "${var.proxy_location}/${var.name}.yml"
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
||||||
|
10
variables.tf
10
variables.tf
@@ -8,16 +8,6 @@ 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_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"
|
||||||
|
Reference in New Issue
Block a user