Add a remote node in Rundeck

To add a remote node in Rundeck, we need to have SSH connectivity (usually port # 22) and to setup a SSH based key based authentication between Rundeck server & client. Please click here and follow the guide to setup key based authentication as a first step.

After setting up key based auth, test the SSH connectivity. Copy the file id_rsa from your home directory to the below path

# cp/home/<USERNAME>/.ssh/id_rsa  /var/lib/rundeck/.ssh/id_rsa

Third step is to add node details in the resources.xml file

Path – /var/rundeck/projects/VEC-Storage/etc/resources.xml and add entries as shown below. By default, Rundeck server information which is a first node definition would be there already. (open with your favorite {nano} editor)

<?xml version=”1.0″ encoding=”UTF-8″?>

<project>
<node name=”SAS” description=”Rundeck server node” tags=”RDS” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” osVersion=”4.9.0-2-amd64″ username=”rundeck”/>
<node name=”Name” description=”Windows Jump2″ tags=”JMP” hostname=”<name/IP>” osFamily=”windows” username=”user” ssh-keypath=”/var/lib/rundeck/.ssh/id_rsa”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>

<node name=”Name” description=”Windows Jump1″ tags=”JMP1″ hostname=”<name/IP>” osFamily=”windows” username=”user” ssh-keypath=”/var/lib/rundeck/.ssh/id_rsa”/>

<node name=”Name” description=”SYMCLI SRV” tags=”SYM” hostname=”<name/IP>” osArch=”amd64″ osFamily=”unix” osName=”Linux” username=”user”/>
</project>

There are multiple nodes definitions of both OS types (both *nix & Windows) added to Rundeck. Tags come in handy while defining the node attributes which helps in grouping similar type of clients. As an example shown above, tags=’SYM’ represent that the client is a EMC VMAX Mgmt. Host running with SYMCLI & Unisphere for VMAX services.

To run a command across all nodes, simply type in the tag name and run the command from Rundeck >Menu Bar > Commands. PFB Screenshots for reference.

2017-12-12 21_29_03-Commands - VEC-Storage

Output of above command from all the nodes are as under.

2017-12-12 21_53_06-192.168.60.63_4440_project_VEC-Storage_execution_downloadOutput_11924_view=inlin

Troubleshooting: In case of SSH connectivity issue, edit the sudoers file (visudo) and remove the comment of below line. But before making changes, consult your administrator whether this incline with standard policies.

Defaults !requiretty

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s