How to add remote nodes to Rundeck

If you already have Rundeck running but can't add a remote node, Jack Wallen offers the solution.

How to add remote data center nodes to Rundeck If you already have Rundeck running but are unsure how to add a remote node, Jack Wallen offers the solution.

Rundeck is an incredibly powerful administration tool that enables the administrator to manage multiple data center nodes from a single point of entry. Imagine that you have many servers that you want to control from a single, web-based, user-interface. With Rundeck, that is not only possible, but it's simple to do.

There is a slight caveat: Adding nodes. When you add nodes you must jump through a few hoops, but that shouldn't challenge most IT pros.

I'm will walk you through the process of setting up a remote node that can be controlled by Rundeck. I'll demonstrate adding a Linux node to Rundeck using password authentication. I assume you already have Rundeck up and running (How to install Rundeck local and remote services controller on Ubuntu 18.04).

SEE: Disaster recovery and business continuity plan (Tech Pro Research)

Once you have Rundeck ready, it's time to add a node.

Setting up authentication

Before you add your node, you need to set up authentication. We'll set up password authentication that will use the authentication credentials for our remote Linux server. To set this up, log into your Rundeck server and click on the gear icon in the upper right corner. From the pop-up menu, select Key Storage. In the resulting window (Figure A), click the Add or upload key button.

Figure A

Figure A

The Rundeck Key Storage window.


In the pop-up window (Figure B), select Password from the Key Type dropdown, and then type the password in the Enter text area. In the Name section type the username to be used on the remote server. With that information in place, click Save.

Figure B

Figure B

Creating a new password key.


That's all for the password set up.

Creating a project

Before you can add a node, you must first create a project. To do this, click Projects | New project. Give the project a name, label, and description, and then scroll down to the SSH section (Figure C).

Figure C

Figure C

Configuring SSH for the project.


From the SSH Authentication dropdown select password. From the SSH Password Storage Path, click the Select button, select the key you created earlier (Figure B), and then click Choose Selected Key (Figure D).

Figure D

Figure D

Selecting our password key for SSH authentication.


Do the same thing for the SCP section you just did for SSH, scroll down, and click Create. Your project is ready.

Adding a node

Once you save the Project, you will be immediately taken to the Node creation page. I prefer to add nodes from the terminal window, so Secure Shell into your Rundeck server and gain sudo access with the command:

sudo -s

Change into the newly created project directory with the command:

cd /var/rundeck/projects/PROJECTNAME/etc/

where PROJECTNAME is the name of the project you just created.

Create a new configuration file with the command:

nano resources.xml

The contents of the file will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project>
<node name="NAME"
  osFamily="unix"
  username="USERNAME"
  hostname="REMOTE_IP"
  ssh-authentication="password"
  sudo-command-enabled="true"
  sudo-password-storage-path="keys/USERNAME"
  />
</project>

where:

  • NAME is the name of the remote node.
  • USERNAME is the username on the remote node.
  • REMOTE_IP is the IP address of the remote node.

Save and close that file.

Restart Rundeck with the command:

sudo systemctl restart rundeckd

It will take a few minutes for Rundeck to restart. When the service is back up and running, you have to log back into the Rundeck web interface. Once you've done that, your node should be registered. You can check this by going to the project page and clicking Nodes. From the Nodes dropdown, select Show all nodes. You should see localhost (the Rundeck server) and your newly added node listed (Figure E).

Figure E

Figure E

Our newly added node.


Congratulations, you now have a remote node added to Rundeck that you can manage from the web-based interface. In our next Rundeck piece, I'll walk you through the process of running commands on your remote nodes.

Also see

rundeckhero.jpg
Image: Jack Wallen

By Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.