How to create a job on Rundeck

Rundeck makes it easy to create scheduled, multi-step jobs to execute on your data center nodes.

How to create a job on Rundeck Dashboards

Rundeck is an incredibly powerful tool for administrators. Instead of having to log into each and every machine in your data center, you can log into the Rundeck Dashboard and run commands on your servers (individually or by groups).

But Rundeck has an even better way of doing things. Instead of running those individual commands, you can create jobs to run on those servers. A job can contain any number of steps (from commands, scripts, job references, Ansible playbooks, data node steps, and more), which can:

  • Be assigned to specific nodes
  • Be given a maximum number of threads
  • Send alerts
  • Be scheduled
  • and much, much more

I want to walk you through the process of creating a job on Rundeck. I'll demonstrate how to create a job that will schedule the process of updating and upgrading Ubuntu Servers.

SEE: Executive's guide to the software defined data center (TechRepublic download)

What you need

I will assume you already have Rundeck up and running and nodes connected which, for the purpose of this example, will be Ubuntu Servers (See: How to install Rundeck local and remote services controller on Ubuntu 18.04).

With those bits in place, let's configure.

Creating the job

First, log into your Rundeck server. Once authenticated, click on the project (in the sidebar) you want associated with the job. In the Job Actions dropdown (Figure A), click New Job.

Figure A

Figure A: Creating a new Job for the TECHREPUBLIC project.

Give the job a name and a description (Figure B).

Figure B

Figure B: Naming and describing our job.

Next, we need to select the nodes for the job (SEE: How to Add Remote Nodes to Rundeck). This will, of course, assume you already have servers associated with a node. Scroll down to the Nodes section and check Dispatch to Nodes (Figure C). Click the Node Filter dropdown and select the node you want to associate with the job, followed by Search. All nodes matching that filter should immediately populate the Matched Nodes field.


Figure C: Created with GIMP

Since we're crafting a fairly standard job, scroll down to the Workflow section and click the Add a step button. From the list of possible steps, click the Command entry (Figure D).

Figure D

Figure D: Adding a step to our job.

For our first step, we're going to add the command sudo apt-get update. Enter that in the Command section (Figure E), and then type Update Apt for the label.

Figure E

Figure E: Adding sudo apt-get update as a step in our job.

Click the Save button and the step is ready. Repeat this process, adding sudo apt-get upgrade -y as the next step.

Next, we want to schedule the job. Scroll down until you see Schedule to run repeatedly. Click Yes and then select the time and frequency for the scheduled job (Figure F).

Figure F

Figure F: Scheduling our job.

Make sure to:

  • Set your Time Zone
  • Click Yes for Enable Scheduling
  • Click Yes for Enable Execution

Scroll down to the bottom of the job creation page and click Save.

Congratulations, your first job has been created. With this in place, the Ubuntu servers associated with the job will all be updated and upgraded at the specified time and frequency. No more having to log into those machines individually to take care of the task.

All in the details

Make sure to look into the details of your jobs. There are quite a number of options and features available, which can transform a fairly basic job into the realms of the highly complex. With the help of Rundeck, your admin job just became more efficient.

Also see

Image: Jack Wallen