Skip to content

Commit

Permalink
Duct tape the package installations
Browse files Browse the repository at this point in the history
Sleep 60... eugh.
  • Loading branch information
WillNilges committed May 16, 2024
1 parent 42875bb commit 879d389
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions infra/tf/k3s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module "k3s" {
depends_on_ = [
proxmox_vm_qemu.meshdbmgr,
proxmox_vm_qemu.meshdbnode,
null_resource.mgr_packages,
null_resource.worker_packages,
]
k3s_version = "latest"
cluster_domain = "cluster.local"
Expand Down
54 changes: 54 additions & 0 deletions infra/tf/packages.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Both the mgrs and workers install the same pagkages for now

locals {
packages = "open-iscsi"
command = "sleep 60; sudo apt -o DPkg::Lock::Timeout=180 update && sudo apt -o DPkg::Lock::Timeout=180 install -y ${local.packages}"
}

resource "null_resource" "mgr_packages" {
for_each = {
for ip in var.meshdb_mgr_ips : ip => ip
}

depends_on = [
proxmox_vm_qemu.meshdbmgr,
]

connection {
type = "ssh"
user = "${var.meshdb_local_user}"
private_key = file("${path.module}/meshdb${var.meshdb_env_name}")
host = each.value
}

# set hostname
provisioner "remote-exec" {
inline = [
local.command,
]
}
}

resource "null_resource" "worker_packages" {
for_each = {
for ip in var.meshdb_ips : ip => ip
}

depends_on = [
proxmox_vm_qemu.meshdbnode,
]

connection {
type = "ssh"
user = "${var.meshdb_local_user}"
private_key = file("${path.module}/meshdb${var.meshdb_env_name}")
host = each.value
}

# set hostname
provisioner "remote-exec" {
inline = [
local.command,
]
}
}

0 comments on commit 879d389

Please sign in to comment.