talos-extensions/power/nut-client
Andrey Smirnov 9a57c65d10
feat: bump dependencies
Update pkgs.

```
| Package | Update | Change |
|---|---|---|
| [containerd/stargz-snapshotter](https://togithub.com/containerd/stargz-snapshotter) | minor | `v0.14.3` -> `v0.15.1` |
| [https://github.com/qemu/qemu.git](https://togithub.com/qemu/qemu) | patch | `8.1.1` -> `8.1.2` |
| [https://gitlab.gnome.org/GNOME/glib.git](https://gitlab.gnome.org/GNOME/glib) | patch | `2.78.0` -> `2.78.1` |
| [networkupstools/nut](https://togithub.com/networkupstools/nut) | patch | `2.8.0` -> `v2.8.1` |
| [tailscale/tailscale](https://togithub.com/tailscale/tailscale) | minor | `1.50.0` -> `1.54.0` |
```

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
2023-11-21 17:40:45 +04:00
..
files feat: add nut-client 2022-09-08 10:36:06 +05:30
patches feat: bump dependencies 2023-11-21 17:40:45 +04:00
manifest.yaml chore: use machined for shutdown calls 2023-07-19 17:18:55 +05:30
nut-client.yaml chore: use machined for shutdown calls 2023-07-19 17:18:55 +05:30
pkg.yaml feat: bump dependencies 2023-11-21 17:40:45 +04:00
README.md docs: update documentation on installing extensions 2023-09-29 22:49:23 +04:00
vars.yaml feat: add nut-client 2022-09-08 10:36:06 +05:30

nut-client extension

Installation

See Installing Extensions.

Usage

Configure the extension via .machine.files. You must replace upsmonHost and upsmonPasswd to match configuration on your nut server. See upsd.users man page for details.

On Talos SHUTDOWNCMD must be /sbin/poweroff

machine:
  files:
    - path: /var/etc/nut/upsmon.conf
      permissions: 0o600
      op: create
      content: |-
        MONITOR ${upsmonHost} 1 remote ${upsmonPasswd} slave
        SHUTDOWNCMD "/sbin/poweroff"        

Testing

Confirm extension service is running

$ talosctl service ext-nut-client
NODE     192.168.1.1
ID       ext-nut-client
STATE    Running
HEALTH   ?
EVENTS   [Running]: Started task ext-nut-client (PID 2263) for container ext-nut-client (59m59s ago)
         [Preparing]: Creating service runner (59m59s ago)
         [Preparing]: Running pre state (59m59s ago)
         [Waiting]: Waiting for service "cri" to be "up" (59m59s ago)
         [Waiting]: Waiting for service "cri" to be "up", network (1h0m0s ago)
         [Waiting]: Waiting for service "cri" to be registered, network (1h0m1s ago)
         [Waiting]: Waiting for service "containerd" to be "up", service "cri" to be registered, network (1h0m2s ago)
         [Waiting]: Waiting for service "containerd" to be "up", service "cri" to be "up", network (1h0m3s ago)

CAUTION this will power off all connected systems.

Trigger a 'Full System Shutdown' on the nut-server

# upsmon -c fsd

all connected upsmon clients should perform a full shutdown and power off.