How to run a command in Rundeck

Rundeck is very handy to run commands to your remote nodes.

Image: Jack Wallen

With Rundeck installed and your nodes added, it's time to take the next step with the management console-- running a command. It is important to understand how this task works because it will help you with two things:

  • When you go to set up a job.
  • To take care of one-off tasks on nodes.

Although one of the most powerful aspects of Rundeck is the ability to create complex jobs (that can be run with the click of a button) it's also very handy to run commands to your remote nodes. So if you need to do a quick check or even an update on a server, you only have to log into Rundeck, where you can then send the command to your nodes. I'm going to show you exactly how to do that.

SEE: Hardware decommissioning policy (Tech Pro Research)

I will assume you already have Rundeck up and running and have configured the necessary remote nodes SEE: How to add remote nodes to Rundeck. The good news is that you already have the hard part taken care of (getting Rundeck installed and adding nodes). Running commands is actually quite simple.

Let's make this happen.

Running a command

Log into your Rundeck console and click on a project that has an associated node you want to work with. Once in the project screen, click on COMMANDS in the left navigation (Figure A).

Figure A

Figure A: A project named TECHREPUBLIC, configured and ready to go.

In the Commands window (Figure B), you must first select a node on which to run the command. You can do this by typing the name of the node and hitting Search.

Figure B

Figure B: The Rundeck Commands window.

If you're not sure of the node name, click the Nodes dropdown and select Show all nodes. Once you see the name of the node you want to work with, type it in the Nodes text area and click Search. This will select the node in question. Next, type the command you want to send to the node in the Command text area. Once you have the command exactly how you like it (Figure C), hit the Run on X Node button (where X is the number of nodes you've selected).

Figure C

Figure C: Running sudo apt-get update && sudo apt-get upgrade on a single remote node.

You will see the output of the command as it runs. When it finishes, you can then save that command as a job by clicking the Save as a Job button (Figure D - we'll discuss creating jobs in another post).

Figure D

Figure D: Our command in the process of running.

Easy peasy

That's all there is to running a job on a remote node, with the help of Rundeck. If you're looking for one of the best-centralized server managers, you cannot go wrong with this tool. Run commands on single nodes, multiple nodes, or all of your nodes--with just a few quick clicks. It doesn't get much easier (and more efficient) than that.

Also see