Showing posts with label Rundeck. Show all posts
Showing posts with label Rundeck. Show all posts

Tuesday, August 29, 2023

Install Rundeck on Linux

 Rundeck


We will download and install Rundeck 3.2.8 on Ubuntu 20.04

Run the following commands


apt-get install openjdk-8-jdk-headless

Download Rundeck ".deb" file from https://docs.rundeck.com/downloads.html using wget command

wget https://dl.bintray.com/rundeck/rundeck-deb/rundeck_3.2.8.20200608-1_all.deb

root@yashwanthsn-VirtualBox:/home/rundeck# ls -ltr
total 199164
-rw-r--r-- 1 root root 203942802 Jun 9 01:25 rundeck_3.2.8.20200608-1_all.deb


Use dpkg to install Rundeck

dpkg -i rundeck_3.2.8.20200608-1_all.deb

Once the installation is complete, try accessing http://localhost:4440 this may not work, check the /etc/hostname
There are two hostnames devops and yashwanthsn-VirtualBox so replace localhost and use the URLs as below

http://devops:4440
or
http://yashwanthsn-VirtualBox:4440

Login using admin user and password is admin. Admin user will have admin and user roles.

We will have another user called user with password user. It has access to run commands and jobs but unable modify job definitions

Once logged in, it takes you too -> http://localhost:4440/menu/home page

You can start/stop/restart services and check the status using following commands

service rundeckd start | stop | restart | status
or
/etc/init.d/rundeckd start | stop | restart | status


Rundeck installation would have created a group called rundeck
rundeck@yashwanthsn-VirtualBox:~$ pwd
/var/lib/rundeck


rundeck@yashwanthsn-VirtualBox:~$ ls -ltr
total 36
drwxr-x--- 2 rundeck rundeck 4096 Jun 9 01:21 work
drwxr-s--x 2 rundeck adm 4096 Jun 9 01:21 logs
drwxr-xr-x 4 rundeck rundeck 4096 Jun 22 20:59 cli
drwxr-x--- 2 rundeck rundeck 4096 Jun 22 20:59 bootstrap
drwxrwxr-x 4 rundeck rundeck 4096 Jun 22 21:12 repository
drwxr-x--- 2 rundeck rundeck 4096 Jun 22 21:13 data
drwxrwxr-x 2 rundeck rundeck 4096 Jun 22 21:13 projects
drwxr-x--- 3 rundeck rundeck 4096 Jun 22 21:23 var
drwxr-x--- 3 rundeck rundeck 4096 Jun 22 21:43 libext

Rundeck Add Nodes

 



Add the following lines into Project configuration file (Project settings -> Edit Configuration -> Edit Configuration File (on the top right corner))

resources.source.1.config.file=/var/rundeck/projects/Login-Server/resources.xml
resources.source.1.config.generateFileAutomatically=true
resources.source.1.config.includeServerNode=true
resources.source.1.type=file

Create resources.xml file

Go to directory -> /var/rundeck/projects/<Job-Name>, in my case it is /var/rundeck/projects/Login-Server

touch resources.xml
vi resources.xml

Add the following lines

<?xml version="1.0" encoding="UTF-8"?>

<project>
  <node name="login-server"  tags="loginserver" hostname="144.xx.xx.xx" osFamily="unix" osName="Linux" username="ynagaraj"/>
</project>

Restart the Rundeck

service rundeckd restart
or
/etc/init.d/rundeckd restart (stop|start|status)

Login to Rundeck -> http://localhost:4440

Click on Project settings -> Edit Nodes and you will see that newly added node appears on the list