Introduction
Rundeck is an automation and job orchestration tool that allows administrators to execute commands and scripts on remote servers through a centralized web interface. It can be used to automate routine administrative tasks, execute scripts, schedule jobs, and manage operations across multiple hosts.
In this post, we will explain how to configure a remote rundeck user and create a simple job using the Rundeck interface. This guide does not cover the installation of Rundeck. It assumes that Rundeck is already installed, configured, and running on port 8000.
Prerequisites
Before proceeding, make sure you have:
- A working Rundeck installation running on port
8000. - SSH access from the Rundeck server to the remote host.
- Root or sudo privileges on the remote host.
- A
rundeckuser configured on the remote host. - An SSH key pair available on the Rundeck server.
- The required permissions to configure the
rundeckuser in the sudoers file. - A basic understanding of Linux commands and SSH.
Implementation
In this post, we will explain how to add simple Rundeck jobs. We are not going to cover how to install Rundeck on the host. This post assumes that Rundeck is installed and running on port 8000.
Configure the Rundeck user on the remote host:
useradd rundeck passwd rundeck chage -I -1 -m 0 -M 99999 -E -1 rundeck Copy the key rundeck from rundeck server to client hosts.
ssh-copy-id -i ~/.ssh/id_rsa.pub rundeck@$ip
Add the Rundeck user to the sudoers file(visudo).
Defaults:rundeck requiretty rundeck ALL=(ALL) NOPASSWD: ALL
Let’s create a new project from the Rundeck interface.
Select the project and, under Job Actions, select New Job.
Add the requested information.
Job Name =
Description =
The following is the key information that we should decide based on our requirements.
Options:
Scenario1:
In case we are executing the jobs for a particular case, we can use option values that will be restricted to particular values. Add the information below for the option values.
Option Name: < your-option-name>
Default Value:<your values> Leave it blank in case we don’t want to give any name.
Input Type: Plain Text(preferably)
Allowed Values: List
Restrictions:None
Required:Yes
Multi-valued:<ur selection> Depends on the application/script use case.
Note down the Usage values in case you are going to use these values if you will be using these option values in the script/application.
Workflow:
Next comes the interesting part/creative part of Rundeck. There will be multiple options which you can select.
Command – Execute a remote command: This option is to execute a remote command, i.e., on a remote host
Script – Execute an inline script
Script file or URL – Execute a local script file or a script from a URL
There are multiple options that you can use depending on your requirements, like scheduling, sending notifications, etc.
Click on Create. That’s it 🙂 You had create a first job on Rundeck
Conclusion
Rundeck provides a simple and centralized way to execute commands and scripts on remote servers. By configuring SSH access for the rundeck user and creating projects and jobs through the web interface, routine administrative tasks can be automated efficiently.
The job workflow can be further enhanced by adding options, schedules, notifications, scripts, and other workflow steps based on the application’s requirements. This makes Rundeck useful for simplifying repetitive server administration and operational tasks.
FAQs
1. What is Rundeck used for?
Rundeck is used to automate and execute commands, scripts, and administrative tasks on remote servers through a centralized interface.
2. Do I need to install Rundeck on the remote server?
No. Rundeck needs to be installed on the Rundeck server. The remote server only needs SSH access and a properly configured rundeck user.
3. Why is the rundeck user required on the remote host?
The rundeck user allows Rundeck to connect to the remote host through SSH and execute the required commands or scripts.
Talk to our experts:
Looking for the right technology solution for your business?. Our experts can help with web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team here.