diff --git a/WORKING.md b/WORKING.md index a6639a3..81f42bd 100644 --- a/WORKING.md +++ b/WORKING.md @@ -7,5 +7,9 @@ A commit is blocked while any task below remains unchecked. (all done — session complete) -- [x] Validate tsys-siem access (SSHOK + SUDOOK confirmed) -- [x] Update bootstrap-all.sh: no remaining password-auth targets [#403] +- [x] PM housekeeping: 9 tracker corrections, #407 closed, 8 tickets assigned, priorities set, parent-child links +- [x] Create 6 category milestones (Cat1-6) with due dates +- [x] Map all 42 tech tickets to milestones +- [x] Close #419 (guest-agent bare-metal skip — already fixed) +- [x] Close #392 (etcd tuning — already in install-cp.sh) +- [x] Prep PDU identification + rename scripts for Friday onsite [#374] diff --git a/dcinfra/powerman/identify-outlets.sh b/dcinfra/powerman/identify-outlets.sh new file mode 100644 index 0000000..9cf3b2b --- /dev/null +++ b/dcinfra/powerman/identify-outlets.sh @@ -0,0 +1,41 @@ +#!/usr/bin/bash +# powerman/identify-outlets.sh — flash each PDU outlet sequentially for physical tracing +# +# Run this from the workstation. It flashes each outlet one at a time so you +# can walk the rack and see which device's LED blinks. Write down the mapping, +# then run rename-outlets.sh with that mapping. +# +# Usage: +# bash dcinfra/powerman/identify-outlets.sh +# +# On Friday: run this, walk the rack, note which outlet → which device. +set -uo pipefail +PROX_HOST="${PROX_HOST:-pfv-tsys1}" +REMOTE_SH="$(cd "$(dirname "$0")/../.." && pwd)/tests/remote.sh" + +echo "PDU Outlet Identification — Flash Sequence" +echo "============================================" +echo "Each outlet will flash for 5 seconds. Walk the rack and note the device." +echo "Press Enter to start..." +read -r + +for i in $(seq 1 10); do + echo "--- Outlet $i: FLASHING (5s) ---" + PROX_HOST="$PROX_HOST" bash "$REMOTE_SH" prox "powerman -f outlet-$i" /dev/null + sleep 5 + PROX_HOST="$PROX_HOST" bash "$REMOTE_SH" prox "powerman -u outlet-$i" /dev/null + echo " Outlet $i → ? (write it down)" + echo "" + [ "$i" -lt 10 ] && { echo "Press Enter for next outlet..."; read -r; } +done + +echo "============================================" +echo "Done. Now create your mapping file and run:" +echo " bash dcinfra/powerman/rename-outlets.sh" +echo "" +echo "Format: outlet-number:new-name (one per line)" +echo "Example:" +echo " 1:pfv-tsys1" +echo " 2:pfv-tsys3" +echo " ..." +echo "============================================" diff --git a/dcinfra/powerman/rename-outlets.sh b/dcinfra/powerman/rename-outlets.sh new file mode 100644 index 0000000..bf3d639 --- /dev/null +++ b/dcinfra/powerman/rename-outlets.sh @@ -0,0 +1,52 @@ +#!/usr/bin/bash +# powerman/rename-outlets.sh — rename PDU outlets in powerman.conf +# +# Takes a mapping file (outlet-number:new-name, one per line) and rewrites +# the node entries in /etc/powerman/powerman.conf on pfv-tsys1, then +# restarts powermand. +# +# Usage: +# bash dcinfra/powerman/rename-outlets.sh +# +# Example mapping file: +# 1:pfv-tsys1 +# 2:pfv-tsys3 +# 3:pfv-tsys4 +# ... +set -euo pipefail + +PROX_HOST="${PROX_HOST:-pfv-tsys1}" +REMOTE_SH="$(cd "$(dirname "$0")/../.." && pwd)/tests/remote.sh" +MAP_FILE="${1:-}" + +if [ -z "$MAP_FILE" ] || [ ! -f "$MAP_FILE" ]; then + echo "Usage: $0 " + echo " Format: outlet-number:new-name (one per line)" + echo " Run identify-outlets.sh first to get the mapping." + exit 1 +fi + +# Build the new node lines +NODE_LINES="" +while IFS=: read -r num name; do + [ -z "$num" ] && continue + NODE_LINES+="node \"$name\" \"cyclades-pm10\" \"$num\""$'\n' +done < "$MAP_FILE" + +# Send to tsys1: backup conf, write new node section, restart powermand +PROX_HOST="$PROX_HOST" bash "$REMOTE_SH" prox-file - < /tmp/powerman.conf.new +cat >> /tmp/powerman.conf.new <<'NODES' +$(echo -n "$NODE_LINES") +NODES +mv /tmp/powerman.conf.new /etc/powerman/powerman.conf +systemctl restart powerman +sleep 1 +powerman -l +REMOTE_SCRIPT + +echo "PDU outlets renamed. Verify with: PROX_HOST=$PROX_HOST bash $REMOTE_SH prox 'powerman -q'"