Skip to content

v1.3.0: Phase 3 Complete - Infrastructure Automation

Choose a tag to compare

@adrianwedd adrianwedd released this 16 Nov 11:17
· 44 commits to main since this release

Release v1.3.0 - Phase 3 Complete: Infrastructure Automation

Release Date: November 16, 2025

This release completes Phase 3 of the homelab-scripts roadmap, delivering two major infrastructure automation tools for proactive monitoring and streamlined server provisioning.


🆕 What's New

smart-disk-check.sh - Disk Health Monitoring

Proactive S.M.A.R.T. monitoring and alerting system for detecting disk failures before data loss.

Key Features:

  • Auto-discovery via smartctl --scan
  • Health attribute monitoring (critical pre-fail attributes: 5, 187, 188, 197, 198)
  • Temperature alerts with configurable thresholds (default: warn 50°C, critical 60°C)
  • Test scheduling (short/long/conveyance S.M.A.R.T. tests)
  • Reallocated and pending sector detection
  • JSON output for monitoring system integration
  • Exit codes: 0 (healthy), 1 (warnings), 2 (critical)

Quick Start:

# Quick health check
./smart-disk-check.sh

# Custom thresholds
./smart-disk-check.sh --devices /dev/sda,/dev/nvme0n1 --warn-temp 45 --crit-temp 55

# Run long test with JSON output
./smart-disk-check.sh --test long --json

Cron Integration:

0 6 * * * /path/to/smart-disk-check.sh --json || mail -s 'Disk Alert' admin@example.com

new-vm-setup.sh - Automated VM Bootstrapping

Streamlined initial configuration for fresh Linux VMs with comprehensive validation.

Key Features:

  • OS detection (Ubuntu, Debian, RHEL, CentOS, Fedora, Rocky, AlmaLinux)
  • Package manager auto-detection (apt-get, dnf, yum)
  • RFC-1123 hostname validation and configuration
  • POSIX-compliant user creation with sudo/wheel group mapping
  • SSH public key deployment with secure permissions
  • Idempotent package installation
  • Optional dotfiles cloning from Git
  • Configurable login shell
  • Optional passwordless sudo with security warnings
  • Comprehensive input validation
  • JSON output support

Quick Start:

# Dry-run preview
./new-vm-setup.sh \
  --hostname "web-server-01" \
  --user "deploy" \
  --ssh-key-path "$HOME/.ssh/id_ed25519.pub" \
  --packages "curl,git,vim,htop" \
  --dry-run

# Full web server setup
./new-vm-setup.sh \
  --hostname "nginx-server" \
  --user "webadmin" \
  --ssh-key-path "$HOME/.ssh/id_ed25519.pub" \
  --packages "nginx,certbot,ufw,fail2ban" \
  --dotfiles "https://github.com/yourusername/dotfiles.git"

📊 Statistics

  • Scripts added: 2 (smart-disk-check.sh, new-vm-setup.sh)
  • Lines of code: 1,000+
  • CI test cases: 100+
  • Example scripts: 2 comprehensive usage examples
  • Documentation: Full README sections, release notes

🔒 Security & Quality

Both scripts follow repository security standards:

  • Secure logging (umask 077, directory mode 700, file mode 600)
  • Comprehensive input validation
  • No plaintext passwords (SSH keys only)
  • Sudo transparency with explicit warnings
  • Cross-platform compatibility
  • Full CI coverage with smoke tests

📚 Documentation


⬆️ Upgrade Notes

From v1.2.x

No breaking changes. New scripts are additive:

  • Add smart-disk-check.sh to your monitoring cron jobs
  • Use new-vm-setup.sh for new VM provisioning workflows

Installation

# Update repository
git pull origin main

# Make scripts executable
chmod +x smart-disk-check.sh new-vm-setup.sh

# Install dependencies
# For smart-disk-check.sh
brew install smartmontools  # macOS
apt install smartmontools    # Debian/Ubuntu

# For JSON output (optional)
brew install jq  # macOS
apt install jq   # Debian/Ubuntu

🗺️ Roadmap Status

✅ Phase 3 Complete (v1.3.0)

  • ✅ smart-disk-check.sh - S.M.A.R.T. monitoring
  • ✅ new-vm-setup.sh - VM bootstrapping

🔜 Phase 4 (Planned)

  • ZFS snapshot management
  • SSH key audit and rotation
  • fail2ban reporting

🙏 Contributors

  • Adrian Wedd (@adrianwedd)
  • Claude (AI pair programmer)

🔗 Links


Happy automating! 🚀