Setting Up Rundeck 5 for Job Scheduling and Runbook Automation
Introduction
Rundeck 5, with its advanced features for automation and job scheduling, is an excellent tool for managing complex tasks efficiently on ServerStadium’s infrastructure (VM Pricing, Dedicated Servers).
Prerequisites
- A ServerStadium VM or dedicated server (VM Pricing, Dedicated Servers).
- Basic knowledge of Linux server administration.
Step 1: Select and Prepare Your ServerStadium Server
- Choose a Server: Opt for a ServerStadium server suitable for your workload.
- Server Setup:
sudo apt update
sudo apt upgrade
Step 2: Install Java
Rundeck 5 requires Java:
- Install Java:
sudo apt-get install openjdk-11-jre-headless
Step 3: Install Rundeck 5
- Add Rundeck Repository:
Use the script provided by PackageCloud to add the Rundeck repository:
curl -s https://packagecloud.io/install/repositories/pagerduty/rundeck/script.deb.sh?any=true | sudo bash
- Install Rundeck 5:
Now install the specific version of Rundeck:
sudo apt-get install rundeck=5.0.0.20231216-1
Step 4: Configure Rundeck
- Configure Rundeck:
Edit the Rundeck configuration files as needed.
sudo nano /etc/rundeck/rundeck-config.properties
- Start Rundeck Service:
sudo systemctl start rundeckd
sudo systemctl enable rundeckd
Step 5: Accessing Rundeck
- Access Rundeck Web Interface:
Navigate to
http://your_server_ip:4440
in a browser. The default login is admin/admin.
Step 6: Create and Schedule Jobs
- Create a Simple Job:
Example – Create a job to check disk space:
- Go to the Rundeck dashboard.
- Navigate to ‘Jobs’ and click on ‘Create a New Job’.
- Name the job (e.g., “Check Disk Space”).
- In the ‘Workflow’ section, add a step.
- Choose ‘Command’ as the step type.
- Enter the command:
df -h
. - Save the job.
- Schedule the Job:
- In the job settings, go to the ‘Schedule’ tab.
- Choose a schedule, like “Run every day at midnight”.
- Save the schedule settings.
Step 7: Manage Runbooks and Workflows
- Automate a Cleanup Workflow:
Example – Create a workflow to clean temporary files:
- Create a new job named “Cleanup Temp Files”.
- Add a step with the command:
rm -rf /tmp/*
. - Optionally, add more steps for additional cleanup tasks.
- Save the job.
- Documenting a Procedure:
- In the job description or notes, document the purpose and procedure of the job.
- Provide clear instructions or notes on what the job does and any important considerations.
Conclusion
Rundeck on ServerStadium provides a comprehensive solution for job scheduling and runbook automation, streamlining IT operations and enhancing efficiency. For additional support or resources, visit our knowledge base or contact our support team.