Rundeck is an Open source server application to automate our daily IT tasks by replacing tools like Ansible, puppet, chef. Rundeck will store the job definitions and execution history using a relational database at the backend in the form of file-based data storage. Rundeck available in pro version and it’s free to give a try.

Let us walk through the setup guide of RunDeck in a virtual machine.

Here we are using an Oracle 7 Virtual Machine with hostname “rundeck.oel7.local” which served from a DNS server.

# hostnamectl status

RunDeck based on Java so we have to install with OpenJDK Java or Oracle Java.

# yum install java-1.8.0-openjdk -y

Check the version of Installed Java Version.

# java -version
[root@rundeck ~]# java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
[root@rundeck ~]#





Once done with Java installation make sure to choose the right version of Java if your server installed with multiple versions of Java.

# alternatives --config java
[root@rundeck ~]# alternatives --config java

There is 1 program that provides 'java'.

Selection Command
-----------------------------------------------
*+ 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number: 1
[root@rundeck ~]#

We need to allow the traffic for HTTP 4440 and HTTPS 4443 ports in RunDeck server.

Check for the current status we are not enabled with above two ports.

# firewall-cmd --list-all
[root@rundeck ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources: 
services: ssh dhcpv6-client
ports: 
protocols: 
masquerade: no
forward-ports: 
source-ports: 
icmp-blocks: 
rich rules:

Add the required ports and list it.

# firewall-cmd --add-port=4440/tcp --add-port=4443/tcp
# firewall-cmd --list-all
[root@rundeck ~]# firewall-cmd --add-port=4440/tcp --add-port=4443/tcp
success
[root@rundeck ~]#

[root@rundeck ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources: 
services: ssh dhcpv6-client
ports: 4440/tcp 4443/tcp
protocols: 
masquerade: no
forward-ports: 
source-ports: 
icmp-blocks: 
rich rules: 
[root@rundeck ~]#

By default Rundeck with creates a user ID “rundeck” during the installation

To manage the remote servers from “rundeck” we can use any account which can be changed later. For time being we are about to create an SSH Key for root user and copy the key to remote servers which are managed by RunDeck.

# ssh-keygen# ssh-copy-id root@ansiclient1.oel7.local

Now let us start with installing the packages.

Install with repository package to get the RunDeck.

# rpm -Uvh http://repo.rundeck.org/latest.rpm
[root@rundeck ~]# rpm -Uvh http://repo.rundeck.org/latest.rpm
Retrieving http://repo.rundeck.org/latest.rpm
warning: /var/tmp/rpm-tmp.Y2TEvH: Header V4 RSA/SHA1 Signature, key ID e2d1065b: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:rundeck-repo-4-0 ################################# [100%]
[root@rundeck ~]#

Search for Rundeck package “yum search rundeck” and install it using “yum install rundeck -y”.

# yum search rundeck
# yum install rundeck -y
[root@rundeck ~]# yum search rundeck
rundeck-cli.noarch : A commandline tool for Rundeck.
rundeck-config.noarch : RunDeck configuration package
rundeck-repo.noarch : Rundeck Repository Bootstrap
rundeck.noarch : It Slices, it Dices, it Takes Out Your Garbage
[root@rundeck ~]#

[root@rundeck ~]# yum install rundeck -y
---> Package rundeck.noarch 0:2.10.8-1.50.GA will be installed
--> Processing Dependency: rundeck-config for package: rundeck-2.10.8-1.50.GA.noarch
--> Running transaction check
---> Package rundeck-config.noarch 0:2.10.8-1.50.GA will be installed
--> Finished Dependency Resolution
Installing:
rundeck noarch 2.10.8-1.50.GA rundeck-release-bintray 106 M
Installing for dependencies:
rundeck-config noarch 2.10.8-1.50.GA rundeck-release-bintray 10 k
Public key for rundeck-config-2.10.8-1.50.GA.noarch.rpm is not installed
(1/2): rundeck-config-2.10.8-1.50.GA.noarch.rpm | 10 kB 00:00:02 
(2/2): rundeck-2.10.8-1.50.GA.noarch.rpm | 106 MB 00:02:07 
-------------------------------------------------------------------------------------
Installing : rundeck-config-2.10.8-1.50.GA.noarch 1/2 
Installing : rundeck-2.10.8-1.50.GA.noarch 2/2 
Verifying : rundeck-2.10.8-1.50.GA.noarch 1/2 
Verifying : rundeck-config-2.10.8-1.50.GA.noarch 2/2

Installed:
rundeck.noarch 0:2.10.8-1.50.GA

Dependency Installed:
rundeck-config.noarch 0:2.10.8-1.50.GA

Complete!
[root@rundeck ~]#

Start the RunDeck service and check the status.

# systemctl status rundeckd
# systemctl start rundeckd

# systemctl enable rundeckd
[root@rundeck ~]# systemctl status rundeckd
● rundeckd.service - SYSV: rundeckd, providing rundeckd
Loaded: loaded (/etc/rc.d/init.d/rundeckd; bad; vendor preset: disabled)
Active: active (running) since Fri 2018-04-06 02:28:28 IST; 17s ago
Docs: man:systemd-sysv-generator(8)
Main PID: 35014 (runuser)
CGroup: /system.slice/rundeckd.service
‣ 35014 runuser -s /bin/bash -l rundeck -c java -Djava.security.auth.login.config=/etc/rundeck/...

Apr 06 02:28:28 rundeck.oel7.local systemd[1]: Starting SYSV: rundeckd, providing rundeckd...
Apr 06 02:28:28 rundeck.oel7.local rundeckd[35006]: Starting rundeckd: [ OK ]
Apr 06 02:28:28 rundeck.oel7.local systemd[1]: Started SYSV: rundeckd, providing rundeckd.
[root@rundeck ~]#

Here we are able to see the “rundeck” user ID which created during the installation.

[root@rundeck ~]# cat /etc/passwd | tail -n 1
rundeck:x:1001:1001::/var/lib/rundeck:/bin/bash
[root@rundeck ~]#





Once done with installation we need if we need to make changes to hostnames or to URL we can by editing framework.properties.
I have made a few changes only for my Web URL from “localhost” to “rundeck.oel7.local” look into below output.

# vi /etc/rundeck/framework.properties

# ----------------------------------------------------------------
# Rundeck server connection information
# ----------------------------------------------------------------

framework.server.name = rundeck
framework.server.hostname = rundeck
framework.server.port = 4440
framework.server.url = http://rundeck.oel7.local:4440

# ----------------------------------------------------------------
# Installation locations
# ----------------------------------------------------------------

rdeck.base=/var/lib/rundeck

framework.projects.dir=/var/rundeck/projects
framework.etc.dir=/etc/rundeck
framework.var.dir=/var/lib/rundeck/var
framework.tmp.dir=/var/lib/rundeck/var/tmp
framework.logs.dir=/var/lib/rundeck/logs
framework.libext.dir=/var/lib/rundeck/libext

Once login to the web interface we can see the above configuration under Gear Icon on the right side –> System Configuration.

If we required to set up the logs storage location it can be done from log4j.properties configuration file.

# vi /etc/rundeck/log4j.properties

Created users in Web Interface can be found under

# vi /etc/rundeck/realm.properties

To make any changes to more rundeck configurations by changing the log level or DB source URL.

# vi /etc/rundeck/rundeck-config.properties
#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/var/lib/rundeck

#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
# change hostname here
grails.serverURL=http://rundeck.oel7.local:4440
dataSource.dbCreate = update
dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true

Once done with any changes restart the “rundeck” service to take effect the changes.

# systemctl restart rundeckd

Let us navigate to Web Interface.

Once we access the URL using the port number “4440” or “4443” we will get the sign in page using the default credentials username and password as “admin”.

http://rundeck.oel7.local:4440/

RunDeck first login screen

 

After sing in, we will get the home page as shown in below picture.

 

After the first login





We can create our required user account from Gear Icon –> profile

 

User profile page

 

Gear Icon –> System Report to get the health report about the RunDeck server.

 

System Report

 

Gear Icon –> List Plugins to list all the existing installed plugins.

 

Installed plugins

 

That’s it we have done with setting up a RunDeck server for our IT environment automation tasks.

In the upcoming guide let us see how to add nodes, create projects etc.

Babin Lonston
Overall 13+ Years of experience in IT field, 7+ years of experience in Linux administration with Virtualization & Cloud technologies. Love documentation and being Numismatics for a long time.

Managing Groups and User creation using Ansible

Previous article

The solution for “touch: cannot touch `test.txt’: No space left on device”

Next article

You may also like

Comments

Leave a reply

Your email address will not be published.

More in Automation