⚙️ Rundeck Automation Platform on AlmaLinux: Enterprise Job Scheduling Made Easy
Welcome to enterprise automation without complexity! 🎉 Ready to orchestrate your operations with a powerful web interface? Rundeck is the open-source automation platform that makes job scheduling and workflow orchestration visual and collaborative! It’s the platform that turns scripts into self-service operations! Think of it as your operations command center with enterprise features for free! 🚀✨
🤔 Why is Rundeck Important?
Rundeck transforms operations from scripts to self-service! 🚀 Here’s why it’s amazing:
- ⚙️ Job Scheduling - Visual cron replacement!
- 🔄 Workflow Orchestration - Chain tasks together!
- 👥 Self-Service Operations - Delegate safely!
- 📊 Execution History - Track everything!
- 🔌 REST API - Integrate with anything!
- 🛡️ Access Control - Fine-grained permissions!
It’s like having enterprise automation without the price tag! 💰
🎯 What You Need
Before building your automation platform, ensure you have:
- ✅ AlmaLinux 9 server
- ✅ Root or sudo access
- ✅ At least 4GB RAM (8GB recommended)
- ✅ 2 CPU cores minimum
- ✅ 20GB free disk space
- ✅ Java 11 or newer
- ✅ Love for automation! ⚙️
📝 Step 1: System Preparation - Building the Foundation!
Let’s prepare AlmaLinux 9 for Rundeck! 🏗️
# Update system
sudo dnf update -y
# Install Java 11 (required for Rundeck)
sudo dnf install -y java-11-openjdk java-11-openjdk-devel
# Verify Java installation
java -version
# Should show: openjdk version "11.x.x"
# Set JAVA_HOME environment variable
echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk' >> ~/.bashrc
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Install required packages
sudo dnf install -y wget curl git unzip
# Install database (MariaDB)
sudo dnf install -y mariadb-server mariadb
# Start and enable MariaDB
sudo systemctl start mariadb
sudo systemctl enable mariadb
# Secure MariaDB installation
sudo mysql_secure_installation
# Follow prompts to set root password and secure installation
Configure firewall for Rundeck:
# Open required ports
sudo firewall-cmd --permanent --add-port=4440/tcp # Rundeck HTTP
sudo firewall-cmd --permanent --add-port=4443/tcp # Rundeck HTTPS
sudo firewall-cmd --reload
# Verify ports
sudo firewall-cmd --list-ports
# Should show: 4440/tcp 4443/tcp
Perfect! System is ready! 🎯
🔧 Step 2: Installing Rundeck - The Professional Way!
Let’s install Rundeck using the official RPM! 🚀
Install Rundeck from Repository:
# Add Rundeck repository
sudo rpm --import https://packages.rundeck.com/pagerduty/rundeck/gpgkey
# Create repository file
sudo tee /etc/yum.repos.d/rundeck.repo << 'EOF'
[rundeck]
name=Rundeck
baseurl=https://packages.rundeck.com/pagerduty/rundeck/rpm_any/rpm_any/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.rundeck.com/pagerduty/rundeck/gpgkey
EOF
# Install Rundeck
sudo dnf install -y rundeck
# Check installation
rpm -qa | grep rundeck
# Should show: rundeck-x.x.x
Configure Database:
# Create Rundeck database
sudo mysql -u root -p << 'EOF'
CREATE DATABASE rundeck;
CREATE USER 'rundeck'@'localhost' IDENTIFIED BY 'RundeckPass123!';
GRANT ALL PRIVILEGES ON rundeck.* TO 'rundeck'@'localhost';
FLUSH PRIVILEGES;
EXIT;
EOF
# Configure Rundeck to use MariaDB
sudo vi /etc/rundeck/rundeck-config.properties
# Update these lines:
# dataSource.url=jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false
# dataSource.username=rundeck
# dataSource.password=RundeckPass123!
# dataSource.driverClassName=org.mariadb.jdbc.Driver
Configure Rundeck Properties:
# Edit framework properties
sudo vi /etc/rundeck/framework.properties
# Update server URL (replace with your IP)
# framework.server.name = your-server-ip
# framework.server.hostname = your-server-ip
# framework.server.port = 4440
# framework.server.url = http://your-server-ip:4440
# Edit Rundeck configuration
sudo vi /etc/rundeck/rundeck-config.properties
# Set your server URL
# grails.serverURL=http://your-server-ip:4440
Start Rundeck:
# Start Rundeck service
sudo systemctl start rundeckd
sudo systemctl enable rundeckd
# Check status
sudo systemctl status rundeckd
# Should show: active (running)
# Watch logs for startup
sudo tail -f /var/log/rundeck/service.log
# Wait for "Grails application running at http://..."
🌟 Step 3: Accessing Rundeck - Your Operations Dashboard!
Time to access your automation platform! 🎮
First Login:
# Default credentials
# URL: http://your-server-ip:4440
# Username: admin
# Password: admin
# IMPORTANT: Change admin password immediately!
Initial Setup Steps:
- Open browser to
http://your-server-ip:4440
- Login with admin/admin
- Change password in user profile
- Create your first project! 🎉
Dashboard shows:
- 📊 Projects - Automation containers
- 💼 Jobs - Defined automations
- 📋 Nodes - Managed servers
- 📈 Activity - Execution history
- 👥 Access Control - User management
✅ Step 4: Creating Your First Project - Let’s Automate!
Time to create your automation project! 🎯
Create Project:
- Click “New Project” button
- Configure:
- Project Name:
Operations
- Label:
Operations Automation
- Description:
Production operations automation
- Project Name:
- Save
Add Nodes (Servers):
# Create nodes file
sudo mkdir -p /var/rundeck/projects/Operations
sudo vi /var/rundeck/projects/Operations/resources.xml
Add your servers:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<node name="localhost"
description="Rundeck server"
tags="rundeck,local"
hostname="localhost"
osArch="amd64"
osFamily="unix"
osName="Linux"
osVersion="9"
username="rundeck"/>
<node name="web01"
description="Web Server 1"
tags="web,production"
hostname="192.168.1.10"
osArch="amd64"
osFamily="unix"
osName="Linux"
osVersion="9"
username="ansible"
ssh-keypath="/var/lib/rundeck/.ssh/id_rsa"/>
<node name="db01"
description="Database Server"
tags="database,production"
hostname="192.168.1.20"
osArch="amd64"
osFamily="unix"
osName="Linux"
osVersion="9"
username="ansible"
ssh-keypath="/var/lib/rundeck/.ssh/id_rsa"/>
</project>
Setup SSH Keys:
# Generate SSH key for Rundeck
sudo -u rundeck ssh-keygen -t rsa -b 2048 -f /var/lib/rundeck/.ssh/id_rsa -N ""
# Copy to target servers
sudo -u rundeck ssh-copy-id [email protected]
sudo -u rundeck ssh-copy-id [email protected]
# Test connections
sudo -u rundeck ssh [email protected] "echo 'Connection successful!'"
🌟 Step 5: Creating Jobs - Automation Blueprints!
Let’s create reusable automation jobs! 🎯
Create Your First Job:
- In Project, click “Jobs” → “New Job”
- Configure Details:
- Job Name:
System Health Check
- Group:
monitoring
- Description:
Check system health metrics
- Job Name:
Add Workflow Steps:
- Click “Add a Step”
- Choose “Command”:
echo "=== System Health Check ===" echo "Hostname: $(hostname)" echo "Uptime: $(uptime)" echo "Memory Usage:" free -h echo "Disk Usage:" df -h echo "CPU Load:" top -bn1 | head -5
- Node Filter:
tags: production
- Save Step
Add Notifications:
- Click “Send Notification?”
- On Success:
- Type: Email
- Recipients:
[email protected]
- Subject:
Health Check Completed
- On Failure:
- Type: Email
- Recipients:
[email protected]
- Subject:
Health Check Failed!
Schedule the Job:
- Click “Schedule to run repeatedly?”
- Configure:
- Time:
0 */4 * * *
(every 4 hours) - Time Zone: Your timezone
- Time:
- Save Job
Run the Job:
- Click “Run Job Now” 🚀
- Select nodes if prompted
- Watch real-time output!
- Job completes successfully! ✅
🎮 Quick Examples
Example 1: Deployment Workflow
Create a multi-step deployment job:
# Create job definition file
cat << 'EOF' > deployment-job.yaml
- defaultTab: nodes
description: Deploy application to production
executionEnabled: true
group: deployments
name: Deploy Application
nodeFilterEditable: false
scheduleEnabled: true
sequence:
commands:
- description: Pull latest code
exec: cd /var/www/app && git pull origin main
- description: Install dependencies
exec: cd /var/www/app && npm install
- description: Run tests
exec: cd /var/www/app && npm test
- description: Build application
exec: cd /var/www/app && npm run build
- description: Restart service
exec: sudo systemctl restart app.service
- description: Health check
exec: curl -f http://localhost:3000/health || exit 1
keepgoing: false
strategy: node-first
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
rankOrder: ascending
successOnEmptyNodeFilter: false
threadcount: '1'
filter: 'tags: web'
nodesSelectedByDefault: true
plugins:
ExecutionLifecycle: null
scheduleEnabled: false
timeZone: America/New_York
uuid: deployment-job-001
EOF
# Import job
rd jobs load -p Operations -f deployment-job.yaml
Example 2: Self-Service Operations
Create safe delegated operations:
# Job for developers to restart services
# In Rundeck UI:
# 1. Create Job: "Restart Application"
# 2. Add option:
# - Name: service_name
# - Label: Service to Restart
# - Values: app,api,worker
# 3. Add step:
# Command: sudo systemctl restart ${option.service_name}
# 4. Set Access Control:
# - Allow: developer group
# - Deny: modify job
Example 3: Orchestrated Workflow
Create complex workflow with conditionals:
// Workflow with error handling
workflow {
step("1", "Check disk space") {
command {
exec = "df -h / | awk 'NR==2 {print \$5}' | sed 's/%//'"
}
}
step("2", "Clean if needed") {
if("\${data.1.result} > 80") {
command {
exec = "sudo find /var/log -type f -name '*.log' -mtime +30 -delete"
}
}
}
step("3", "Backup database") {
command {
exec = "mysqldump -u backup myapp > /backup/myapp-\$(date +%Y%m%d).sql"
}
errorhandler {
command {
exec = "echo 'Backup failed!' | mail -s 'Backup Alert' [email protected]"
}
}
}
}
🚨 Fix Common Problems
Problem 1: Cannot Access Web UI
Symptom: Connection refused on port 4440 😰
Fix:
# Check if Rundeck is running
sudo systemctl status rundeckd
# Check if port is listening
sudo netstat -tlnp | grep 4440
# Check logs for errors
sudo tail -n 100 /var/log/rundeck/service.log
# Verify Java is installed
java -version
# Restart service
sudo systemctl restart rundeckd
# Check firewall
sudo firewall-cmd --list-all
Problem 2: SSH Connection Fails
Symptom: Cannot execute on remote nodes 🔌
Fix:
# Test SSH as rundeck user
sudo -u rundeck ssh user@target-host
# Check SSH key permissions
sudo ls -la /var/lib/rundeck/.ssh/
# Should be 600 for private key
# Add host to known_hosts
sudo -u rundeck ssh-keyscan -H target-host >> /var/lib/rundeck/.ssh/known_hosts
# Verify node configuration
# Check /var/rundeck/projects/[project]/resources.xml
Problem 3: Database Connection Error
Symptom: Rundeck won’t start, database errors 🔴
Fix:
# Check MariaDB is running
sudo systemctl status mariadb
# Test database connection
mysql -u rundeck -p rundeck
# Verify configuration
grep dataSource /etc/rundeck/rundeck-config.properties
# Check JDBC driver
ls -la /var/lib/rundeck/lib/ | grep mariadb
# Reset database if needed
mysql -u root -p
DROP DATABASE rundeck;
CREATE DATABASE rundeck;
GRANT ALL ON rundeck.* TO 'rundeck'@'localhost';
📋 Simple Commands Summary
Task | Command | Purpose |
---|---|---|
Start Rundeck | sudo systemctl start rundeckd | Start service |
Stop Rundeck | sudo systemctl stop rundeckd | Stop service |
Restart | sudo systemctl restart rundeckd | Restart service |
View logs | sudo tail -f /var/log/rundeck/service.log | Monitor logs |
Check status | sudo systemctl status rundeckd | Service status |
List jobs | rd jobs list -p ProjectName | Show jobs |
Run job | rd run -j JobName -p ProjectName | Execute job |
Export jobs | rd jobs list -p ProjectName -f jobs.yaml | Backup jobs |
Import jobs | rd jobs load -p ProjectName -f jobs.yaml | Restore jobs |
💡 Tips for Success
🚀 Performance Optimization
Make Rundeck super fast:
# Increase JVM memory
sudo vi /etc/sysconfig/rundeckd
# Modify: RDECK_JVM_SETTINGS="-Xmx4096m -Xms1024m"
# Enable execution cleanup
sudo vi /etc/rundeck/rundeck-config.properties
# Add:
# rundeck.execution.logs.fileStoragePlugin=db
# rundeck.execution.logs.cleanup.enabled=true
# rundeck.execution.logs.cleanup.retention.days=30
# Optimize database
mysql -u root -p rundeck
OPTIMIZE TABLE execution;
OPTIMIZE TABLE base_report;
# Restart for changes
sudo systemctl restart rundeckd
🔒 Security Best Practices
Keep Rundeck secure:
- Enable HTTPS - Configure SSL certificates! 🔐
- LDAP/AD Integration - Central authentication! 👥
- ACL Policies - Fine-grained permissions! 🛡️
- API Tokens - Secure automation! 🔑
- Audit Logging - Track everything! 📝
# Enable HTTPS
sudo vi /etc/rundeck/ssl/ssl.properties
# Configure SSL settings
# Create ACL policy
cat << 'EOF' > /etc/rundeck/developer.aclpolicy
description: Developer access policy
context:
project: 'Operations'
for:
resource:
- allow: [read]
job:
- allow: [read,run]
by:
group: developer
EOF
📊 Monitoring and Backup
Keep Rundeck healthy:
# Backup script
cat << 'EOF' > /usr/local/bin/backup-rundeck.sh
#!/bin/bash
BACKUP_DIR="/backup/rundeck"
DATE=$(date +%Y%m%d)
# Create backup directory
mkdir -p $BACKUP_DIR
# Backup database
mysqldump -u rundeck -p rundeck > $BACKUP_DIR/rundeck-db-$DATE.sql
# Backup configuration
tar czf $BACKUP_DIR/rundeck-config-$DATE.tar.gz /etc/rundeck/
# Backup projects
tar czf $BACKUP_DIR/rundeck-projects-$DATE.tar.gz /var/rundeck/projects/
# Export all jobs
for project in $(rd projects list); do
rd jobs list -p $project -f $BACKUP_DIR/jobs-$project-$DATE.yaml
done
# Cleanup old backups (keep 30 days)
find $BACKUP_DIR -type f -mtime +30 -delete
EOF
chmod +x /usr/local/bin/backup-rundeck.sh
# Add to cron: 0 2 * * * /usr/local/bin/backup-rundeck.sh
🏆 What You Learned
You’re now a Rundeck automation expert! 🎓 You’ve successfully:
- ✅ Installed Rundeck on AlmaLinux 9
- ✅ Configured database and properties
- ✅ Created projects and nodes
- ✅ Built automation jobs
- ✅ Scheduled workflows
- ✅ Set up self-service operations
- ✅ Mastered job orchestration
Your automation platform is enterprise-ready! ⚙️
🎯 Why This Matters
Rundeck transforms operations automation! With your platform, you can:
- 🚀 Automate everything - From simple to complex!
- 👥 Delegate safely - Self-service operations!
- 📅 Schedule reliably - Better than cron!
- 📊 Track completely - Full audit trail!
- 💰 Save money - Enterprise features free!
You’re not just running scripts - you’re orchestrating enterprise operations at scale! Every job is tracked, every execution is logged! 🎭
Keep automating, keep orchestrating, and remember - with Rundeck, operations automation is visual and powerful! ⭐
May your jobs run smoothly and your workflows never fail! 🚀⚙️🙌