How To Add Nodes In Rundeck

How To Add Nodes In Rundeck:

In the following steps i will show you how to add nodes in rundeck server with step by step. Create a project in rundeck GUI with name as test-project.

After creating the project in rundeck GUI some configuration files will be created in /var/rundeck/projects/your-project-name. Here it is /var/rundeck/projects/test-project

 

add node in rundeck server

cd /var/rundeck/projects/test-project/etc/

touch resources.xml

resources.xml is used to add the nodes in rundeck server.

vi /var/rundeck/projects/test-project/etc/resources.xml

add below lines

<project>
   <node name="my-node" hostname="10.0.0.25" osArch="amd64" osFamily="unix" osName="Linux" osVersion="3.11.10-03111015-generic" username="rundeck"/>
</project>

hostname value is ip of your remote node, not the rundeck server ip. Here i have given my remote node private ip.

Save this file and restart Rundeck service.
service rundeckd restart
Now we have added remote node in rundeck. But if you run any job, the job will be fail. Since we have not shared the keys with remote node.

Copy Rundeck Public Key:

By default rundeck server has rundeck user and ssh keys. So to communicate rundeck server with nodes we have to share the public keys of rundeck server with nodes.

cat /var/lib/rundeck/.ssh/id_rsa.pub

Copy this public key. We will put this key in the remote nodes.

In The Remote Nodes:

Create rundeck user:

in the remote node create one rundeck user

adduser rundeck

create ssh directory for rundeck user

mkdir  -p /home/rundeck/.ssh

touch /home/rundeck/.ssh/authorized_keys

Give Appropriate Permissions to .ssh Files

chown rundeck:rundeck /home/rundeck/

chown rundeck:rundeck /home/rundeck/.ssh/authorized_keys

Add rundeck user to sudo user. So this user can execute any commands.

echo "rundeck ALL=(ALL) NOPASSWD: ALl" >> /etc/sudoers

(you may get error if you copy this line, manually enter this command in command line, don't copy from here, since they are not double quotes here, enter command manually)

Add The Public key Of rundeck Server, in remote nodes rundeck user authorized_keys

vi /home/rundeck/.ssh/authorized_keys

Here add the public key which you copied from rundeck server. Thats it, we have successfully added node in rundeck. Now you can run jobs in nodes.

  • add node in rundeck
  • rundeck node add
  • how to add rundeck node
  • how to add nodes in rundeck

 

Leave a Reply

Your email address will not be published. Required fields are marked *