Initial port of KNELServerBuild to FetchApply framework

- Created base FetchApply directory structure with classes, initializers, modules, roles, and variables
- Ported SetupNewSystem.sh functionality to modular FetchApply structure
- Created server classes: physical, virtual, librenms, database, webserver, dev-workstation
- Implemented initializers for system-setup, packages, ssh-keys, and user-configuration
- Created modules for oam, system-config, ssh-hardening, and librenms-agent
- Defined security and monitoring roles
- Copied configuration templates from KNELServerBuild
- Updated README with comprehensive FetchApply usage instructions

💘 Generated with Crush

Assisted-by: GLM-4.6 via Crush <crush@charm.land>
This commit is contained in:
2026-01-21 11:05:17 -05:00
parent c82ab1b7db
commit 09d93e37cd
45 changed files with 928 additions and 2 deletions

31
modules/librenms-agent/apply Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# KNEL LibreNMS Agent Module
# Deploys and configures LibreNMS monitoring agent
set -euo pipefail
echo "Running LibreNMS agent module..."
# Check if this is a LibreNMS server
if [[ $LIBRENMS_CHECK -eq 1 ]]; then
echo "This is a LibreNMS server, skipping agent setup"
exit 0
fi
# Deploy LibreNMS agent configuration
if [[ -f ./configs/librenms-agent.conf ]]; then
# Create agent directory if needed
mkdir -p /etc/librenms-agent
# Copy agent configuration
cp ./configs/librenms-agent.conf /etc/librenms-agent/
# Start the agent service if available
if systemctl list-unit-files | grep -q librenms-agent; then
systemctl enable librenms-agent
systemctl restart librenms-agent
fi
fi
echo "LibreNMS agent module completed"