From 26d07e9f7e0e90dc33f6a43c8df0ccea8a4e2633 Mon Sep 17 00:00:00 2001 From: Ethan Turkeltaub Date: Wed, 13 Nov 2024 13:04:33 -0500 Subject: [PATCH] Add Eaton 5P550R configuration --- deploy/ansible/group_vars/networking.yml | 2 +- .../roles/common/files/nut/apc/upsmon.conf | 2 +- deploy/terraform/vms.tf | 28 ++++++++++++++----- hosts/controller/configuration.nix | 2 +- modules/profiles/power/eaton-5p550r.nix | 25 +++++++++++++++++ 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 modules/profiles/power/eaton-5p550r.nix diff --git a/deploy/ansible/group_vars/networking.yml b/deploy/ansible/group_vars/networking.yml index 71e2188..065f6e0 100644 --- a/deploy/ansible/group_vars/networking.yml +++ b/deploy/ansible/group_vars/networking.yml @@ -1,3 +1,3 @@ --- -nut_server_user: apc +nut_server_user: eaton nut_server_host: controller diff --git a/deploy/ansible/roles/common/files/nut/apc/upsmon.conf b/deploy/ansible/roles/common/files/nut/apc/upsmon.conf index 74c0f2e..3f47648 100644 --- a/deploy/ansible/roles/common/files/nut/apc/upsmon.conf +++ b/deploy/ansible/roles/common/files/nut/apc/upsmon.conf @@ -1,4 +1,4 @@ -MONITOR apc@controller:3493 1 follower "132010" slave +MONITOR eaton@controller:3493 1 follower "132010" slave RUN_AS_USER root diff --git a/deploy/terraform/vms.tf b/deploy/terraform/vms.tf index 06a3163..b7ba7a7 100644 --- a/deploy/terraform/vms.tf +++ b/deploy/terraform/vms.tf @@ -47,7 +47,8 @@ resource "proxmox_virtual_environment_vm" "omnibus" { } vga { - enabled = true + memory = 16 + type = "std" } hostpci { @@ -81,6 +82,14 @@ resource "proxmox_virtual_environment_vm" "omnibus" { rombar = true xvga = false } + + hostpci { + device = "hostpci4" + id = "0000:06:00" + pcie = false + rombar = true + xvga = false + } } resource "proxmox_virtual_environment_vm" "htpc" { @@ -135,7 +144,8 @@ resource "proxmox_virtual_environment_vm" "htpc" { } vga { - enabled = true + memory = 16 + type = "std" } # Quadro P4000 @@ -207,7 +217,8 @@ resource "proxmox_virtual_environment_vm" "builder" { } vga { - enabled = true + memory = 16 + type = "std" } } @@ -268,7 +279,8 @@ resource "proxmox_virtual_environment_vm" "matrix" { } vga { - enabled = true + memory = 16 + type = "std" } hostpci { @@ -341,7 +353,8 @@ resource "proxmox_virtual_environment_vm" "router" { } vga { - enabled = true + memory = 16 + type = "std" } operating_system { @@ -428,11 +441,12 @@ resource "proxmox_virtual_environment_vm" "controller" { } vga { - enabled = true + memory = 16 + type = "std" } usb { - host = "051d:0002" + host = "0463:ffff" usb3 = true } diff --git a/hosts/controller/configuration.nix b/hosts/controller/configuration.nix index 13649e5..9bd58b4 100644 --- a/hosts/controller/configuration.nix +++ b/hosts/controller/configuration.nix @@ -9,7 +9,7 @@ profiles.networking.unifi profiles.telemetry.prometheus-smokeping-exporter profiles.telemetry.prometheus-unpoller-exporter.satan - profiles.power.apc-back-ups-xs-1500 + profiles.power.eaton-5p550r profiles.telemetry.prometheus-nut-exporter ] ++ [ ./disk-config.nix ./hardware-configuration.nix ]; diff --git a/modules/profiles/power/eaton-5p550r.nix b/modules/profiles/power/eaton-5p550r.nix new file mode 100644 index 0000000..5da6ad3 --- /dev/null +++ b/modules/profiles/power/eaton-5p550r.nix @@ -0,0 +1,25 @@ +{ config, ... }: { + imports = [ ./common.nix ]; + + power.ups = { + ups.eaton = { + driver = "usbhid-ups"; + description = "Eaton 5P550R"; + port = "auto"; + directives = [ + "vendorid = 0463" + "productid = ffff" + "override.battery.charge.low = 10" + "override.battery.runtime.low = 180" + ]; + }; + + upsmon.monitor.eaton = { + user = "leader"; + powerValue = 1; + type = "master"; + passwordFile = config.sops.secrets.upsmon_password.path; + system = "eaton@0.0.0.0:3493"; + }; + }; +}