๐ Uyuni Systems Management on AlmaLinux: Open Source Infrastructure Control
Welcome to the evolution of systems management! ๐ Ready to control your entire infrastructure from one place? Uyuni is the open-source successor to Spacewalk, bringing modern systems management to your fingertips! Named after the stunning salt flat in Bolivia, it uses Salt for configuration and React for the interface! Think of it as mission control for all your Linux systems! ๐โจ
๐ค Why is Uyuni Important?
Uyuni transforms systems chaos into organized control! ๐ Hereโs why itโs amazing:
- ๐ฏ Complete Management - Deployment, patches, configuration, monitoring!
- ๐ง Salt Integration - Modern configuration management built-in!
- ๐ฆ Package Control - Manage updates across all systems!
- ๐ Multi-Distribution - AlmaLinux, Rocky, SUSE, Ubuntu, and more!
- ๐ Beautiful UI - React-based modern interface!
- ๐ Spacewalk Evolution - All features plus modern improvements!
Itโs like having a space station controlling your entire fleet! ๐ธ
๐ฏ What You Need
Before launching your control center, ensure you have:
- โ AlmaLinux server (8 or 9)
- โ Root or sudo access
- โ At least 4GB RAM (8GB recommended)
- โ 150GB disk space minimum
- โ PostgreSQL 13+
- โ Fully qualified domain name
- โ Excitement for systems control! ๐
๐ Step 1: System Preparation - Building Your Launch Pad!
Letโs prepare AlmaLinux for Uyuni! ๐๏ธ
# Set hostname (CRITICAL!)
sudo hostnamectl set-hostname uyuni.example.com
# Replace with your domain!
# Verify hostname
hostname -f
# Must return FQDN: uyuni.example.com
# Update hosts file
sudo nano /etc/hosts
# Add:
# YOUR_IP uyuni.example.com uyuni
# Disable SELinux temporarily
sudo setenforce 0
sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
# Update system
sudo dnf update -y
Configure storage for Uyuni:
# Uyuni needs lots of space!
# Recommended partition layout:
# / - 30GB
# /var/spacewalk - 100GB+ for packages
# /var/lib/pgsql - 50GB for database
# Create directories if not using separate partitions
sudo mkdir -p /var/spacewalk
sudo mkdir -p /var/lib/pgsql
# If using separate disk for packages (example: /dev/sdb)
sudo mkfs.xfs /dev/sdb
sudo mount /dev/sdb /var/spacewalk
echo "/dev/sdb /var/spacewalk xfs defaults 0 0" | sudo tee -a /etc/fstab
Configure firewall:
# Open required ports
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=4505-4506/tcp # Salt
sudo firewall-cmd --permanent --add-port=5222/tcp # XMPP
sudo firewall-cmd --permanent --add-port=5269/tcp # XMPP
sudo firewall-cmd --permanent --add-port=69/udp # TFTP
sudo firewall-cmd --permanent --add-service=tftp
# Reload firewall
sudo firewall-cmd --reload
Perfect! System is ready! ๐ฏ
๐ง Step 2: Installing Uyuni - Your Control Center!
Time to install Uyuni Server! ๐ธ
# Add Uyuni repositories
sudo rpm --import https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/images/RPM-GPG-KEY-uyuni
# Add repository for AlmaLinux 8
sudo dnf config-manager --add-repo \
https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/EL_8/systemsmanagement:Uyuni:Stable.repo
# Install Uyuni pattern
sudo dnf install -y patterns-uyuni_server
# This installs many packages including:
# - Salt master
# - Apache httpd
# - Tomcat
# - PostgreSQL
# - Cobbler
# - And more!
Configure PostgreSQL:
# Initialize PostgreSQL if needed
sudo postgresql-setup --initdb
# Start PostgreSQL
sudo systemctl enable --now postgresql
# Configure for Uyuni
sudo -u postgres createuser -P uyuni
# Enter password: UyuniDB123!
sudo -u postgres createdb -O uyuni uyuni
# Update PostgreSQL config
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" \
/var/lib/pgsql/data/postgresql.conf
# Update authentication
echo "host all all 127.0.0.1/32 md5" | sudo tee -a /var/lib/pgsql/data/pg_hba.conf
# Restart PostgreSQL
sudo systemctl restart postgresql
๐ Step 3: Uyuni Setup - Launching Your Platform!
Run Uyuni setup wizard! ๐
# Run setup (this takes 15-20 minutes!)
sudo /usr/lib/susemanager/bin/mgr-setup
# You'll be asked:
# 1. Admin email: [email protected]
# 2. Certificate details:
# - Organization: MyCompany
# - Organization Unit: IT
# - City: YourCity
# - State: YourState
# - Country: US
# 3. Database settings:
# - Use local database: Yes
# - Database name: uyuni
# - Database user: uyuni
# - Database password: UyuniDB123!
# 4. Admin password: Admin123!
# 5. Accept defaults for other options
# Setup will:
# - Configure database
# - Create SSL certificates
# - Set up web interface
# - Configure Salt master
# - Start all services
After setup completes:
# Check services
spacewalk-service status
# All should be running
# Access Uyuni at:
# https://uyuni.example.com
โ Step 4: Initial Configuration - Setting Up Your Universe!
Letโs configure Uyuni! ๐
Access Web Interface:
- Open browser to
https://uyuni.example.com
- Login with:
- Username:
admin
- Password:
Admin123!
- Username:
Create Organization:
- Go to Admin โ Organizations
- Create Organization:
- Name:
MyCompany
- Admin:
admin
- Email:
[email protected]
- Name:
- Save
Add Software Channels:
# Use spacewalk-common-channels to add AlmaLinux
sudo spacewalk-common-channels \
-u admin -p Admin123! \
-a x86_64 \
-v almalinux8
# Or add manually in Web UI:
# 1. Go to Software โ Manage โ Channels
# 2. Create Channel:
# - Name: AlmaLinux 8 Base
# - Label: almalinux8-base
# - Architecture: x86_64
# 3. Add Repository:
# - URL: https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/
Sync Repositories:
# Sync repositories
sudo spacewalk-repo-sync \
--channel almalinux8-base \
--type yum
# Or use Web UI:
# Software โ Manage โ Repositories โ Sync Now
๐ Step 5: Client Registration - Adding Systems to Your Fleet!
Letโs add AlmaLinux clients! ๐ฅ๏ธ
Prepare Bootstrap Repository:
# Create bootstrap repo for AlmaLinux 8
sudo mgr-create-bootstrap-repo \
--create almalinux8-x86_64
# This creates client tools repository
Register Client System:
On the AlmaLinux client machine:
# Install Salt minion
sudo dnf install -y salt-minion
# Configure Salt minion
sudo nano /etc/salt/minion
# Add:
# master: uyuni.example.com
# Start Salt minion
sudo systemctl enable --now salt-minion
# Register with Uyuni
sudo curl -Sks https://uyuni.example.com/pub/bootstrap/bootstrap.sh | \
sudo bash
# Or use traditional registration:
# Install client tools
sudo dnf install -y rhn-client-tools rhn-check rhn-setup
# Register system
sudo rhnreg_ks \
--serverUrl=https://uyuni.example.com/XMLRPC \
--username=admin \
--password=Admin123! \
--force
Accept System in Uyuni:
- Go to Systems โ Overview
- Click on new system
- Accept Salt key if using Salt
- Assign to groups and channels
Your systems are now managed! ๐
๐ฎ Quick Examples
Example 1: Deploy Patches to All Systems
- Go to Patches โ Relevant
- Select patches to deploy
- Click โApply Patchesโ
- Select systems:
- Choose target systems
- Or use system groups
- Schedule:
- Now or specific time
- Confirm
Patches deploy automatically! ๐ง
Example 2: Configuration with Salt States
Create Salt state for Apache:
# In Uyuni: Configuration โ Salt โ State Catalog
# Create new state: apache.sls
apache_install:
pkg.installed:
- name: httpd
apache_service:
service.running:
- name: httpd
- enable: True
- require:
- pkg: apache_install
apache_config:
file.managed:
- name: /etc/httpd/conf.d/custom.conf
- contents: |
ServerName {{ grains['fqdn'] }}
DocumentRoot /var/www/html
Apply to systems:
- Go to Systems โ Select system
- States โ Apply States
- Select
apache
- Apply
Example 3: System Groups and Automation
# Create system group via API
spacecmd group_create web-servers \
"Web Server Systems"
# Add systems to group
spacecmd group_addsystems web-servers \
web01.example.com web02.example.com
# Schedule recurring actions
spacecmd schedule_recurring \
--name "Weekly Updates" \
--group web-servers \
--action update \
--when "0 2 * * 0" # Sunday 2 AM
๐จ Fix Common Problems
Problem 1: Setup Fails
Symptom: mgr-setup errors out ๐ฐ
Fix:
# Check hostname
hostname -f
# Must be FQDN!
# Check PostgreSQL
sudo systemctl status postgresql
psql -U uyuni -d uyuni -h localhost
# Should connect
# Check disk space
df -h
# Need lots of space!
# Clean and retry
sudo /usr/lib/susemanager/bin/mgr-setup --clear-db
sudo /usr/lib/susemanager/bin/mgr-setup
Problem 2: Clients Canโt Register
Symptom: Registration fails on client ๐ซ
Fix:
# On server, check services
spacewalk-service status
# Check Salt master
sudo systemctl status salt-master
# On client, test connectivity
ping uyuni.example.com
telnet uyuni.example.com 443
# Check certificate
curl -k https://uyuni.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT
# Download and install cert
# Restart client registration
sudo rm -f /etc/sysconfig/rhn/systemid
sudo rhnreg_ks --force
Problem 3: Repository Sync Fails
Symptom: Channels wonโt sync ๐ฆ
Fix:
# Check disk space
df -h /var/spacewalk
# Need sufficient space!
# Check sync logs
tail -f /var/log/rhn/reposync.log
# Test repository URL
curl -I https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/
# Manual sync with debug
sudo spacewalk-repo-sync \
--channel almalinux8-base \
--type yum \
-vvv
# Clear cache and retry
sudo rm -rf /var/cache/rhn/repodata/almalinux8-base
๐ Simple Commands Summary
Task | Command | Purpose |
---|---|---|
Check status | spacewalk-service status | Service health |
Sync channel | spacewalk-repo-sync | Update repositories |
List systems | spacecmd system_list | Show managed systems |
Apply patches | spacecmd system_applyerrata | Deploy updates |
Run command | spacecmd system_runscript | Remote execution |
Create group | spacecmd group_create | System groups |
Schedule task | spacecmd schedule_create | Automation |
View events | spacecmd event_list | System events |
Backup | smdba backup-hot | Database backup |
System report | spacewalk-report | Generate reports |
๐ก Tips for Success
๐ Performance Optimization
Make Uyuni super fast:
# Tune PostgreSQL
echo "shared_buffers = 2GB" | sudo tee -a /var/lib/pgsql/data/postgresql.conf
echo "effective_cache_size = 6GB" | sudo tee -a /var/lib/pgsql/data/postgresql.conf
sudo systemctl restart postgresql
# Increase Tomcat memory
echo 'JAVA_OPTS="-Xms2G -Xmx4G"' | sudo tee -a /etc/tomcat/tomcat.conf
sudo systemctl restart tomcat
# Optimize Apache
echo "MaxRequestWorkers 250" | sudo tee -a /etc/httpd/conf/httpd.conf
sudo systemctl restart httpd
# Clean old data regularly
spacewalk-data-fsck --remove
๐ Security Best Practices
Keep Uyuni secure:
- Use SSL always - Never HTTP! ๐
- Strong passwords - Enforce complexity! ๐ช
- Regular updates - Keep Uyuni current! ๐
- Audit actions - Track all changes! ๐
- Backup regularly - Daily backups! ๐พ
# Backup Uyuni
smdba backup-hot --enable --backup-dir=/backup
# Enable audit logging
echo "audit_log_enabled = 1" | sudo tee -a /etc/rhn/rhn.conf
# Update Uyuni
sudo zypper update
๐ Scaling Uyuni
For large deployments:
# Add Uyuni Proxy
# On proxy server:
sudo zypper install patterns-uyuni_proxy
# Configure proxy
configure-proxy.sh \
--parent uyuni.example.com \
--cert /root/ssl-cert.crt
# Use Salt SSH for agentless
salt-ssh '*' cmd.run 'uptime'
# Monitor performance
sar -u 1 60 # CPU usage
iostat -x 1 # Disk I/O
๐ What You Learned
Youโre now a Uyuni systems management expert! ๐ Youโve successfully:
- โ Installed Uyuni on AlmaLinux
- โ Configured the management platform
- โ Set up software channels
- โ Registered client systems
- โ Deployed patches and updates
- โ Configured with Salt states
- โ Mastered infrastructure control
Your systems management platform is ready! ๐
๐ฏ Why This Matters
Uyuni revolutionizes systems management! With your control center, you can:
- ๐ Manage everything - One platform for all systems!
- ๐ฆ Control updates - Deploy patches precisely!
- ๐ง Configure instantly - Salt states everywhere!
- ๐ Monitor completely - Full visibility!
- ๐ Scale infinitely - Thousands of systems managed!
Youโre not just managing servers - youโre commanding an entire infrastructure fleet! Every system is controlled, every update is managed! ๐ธ
Keep managing, keep scaling, and remember - with Uyuni, systems management reaches for the stars! โญ
May your systems be stable and your patches deploy smoothly! ๐๐๐