Rundeck installation on CentOS7

Overview

Rundeck is functional Open Source Software for job management. It is more useful than cron because it can realize workflow, scheduling and so on. Following shows how to install Rundeck on CenOS and access it from a web browser.

Rundeck

https://www.rundeck.com/open-source

Environment

OS : CentOS7
JDK : Openjdk8
Rundeck : 3.0.13

Step1 : Installation of JDK

At first you have to install JRE because Rundeck requires java runtime environment. This is a example to install JDK for it.

#Installation of jdk
$ sudo yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel

#Adding JAVA_HOME path in .bash_profile
$vim .bash_profile
  export JAVA_HOME=/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
  export PATH=$PATH:$JAVA_HOME/bin
  export PATH=$PATH:$JAVA_HOME/jre/bin

# Reload .bash_profile
$ source ~/.bash_profile

Step2 : Installation of Rundeck

Next, Adding rundeck repository then you can install rundeck by yum command. After that start rundeck with systemctl start and enable it.

# Adding rundeck repository
$ sudo rpm -ivh http://repo.rundeck.org/latest.rpm 
  Preparing...                          ################################# [100%]
  Updating / installing...
     1:rundeck-repo-4-0                 ################################# [100%]

# Installation of rundeck
$ yum install rundeck
 
# Start rundeck
$ systemctl start rundeckd

# Enable rundeck
$ systemctl enable rundeckd

Step3 : Parameter Setting

You can use rundeck at localhost but if you want to use it via network, you have to change some parameters in configuration files.

Open the file rundeck-config.properties and change host name from ‘localhost’ to your host name or IP address.

A rundeck-config.properties is in /etc/rundeck/

$ cd /etc/rundeck/

$ sudo vim rundeck-config.properties
  # grails.serverURL=http://localhost:4440 #old
    grails.serverURL=http://<your hostname or IP address>:4440/rundeck #new

And then you also have to change host name in framework.properties which is
also in “/etc/rundeck/” as default.

$ sudo vim framework.properties
  framework.server.name = <your hostname or IP address>
  framework.server.hostname = <your hostname or IP address>
  framework.server.port = <port number>
  framework.server.url = http://<your hostname or IP address>:<port number>/rundeck

And next add web.context definition in profile.

&#12288;$sudo vim profile  
  RDECK_JVM="-Drundeck.jaaslogin=$JAAS_LOGIN 
             -Djava.security.auth.login.config=$JAAS_CONF 
             -Dloginmodule.name=$LOGIN_MODULE 
             -Drdeck.config=$RDECK_CONFIG 
             -Drundeck.server.configDir=$RDECK_SERVER_CONFIG 
             -Dserver.datastore.path=$RDECK_SERVER_DATA/rundeck 
             -Drundeck.server.serverDir=$RDECK_INSTALL 
             -Drdeck.projects=$RDECK_PROJECTS 
             -Drdeck.runlogs=$RUNDECK_LOGDIR 
             -Drundeck.config.location=$RDECK_CONFIG_FILE 
             -Djava.io.tmpdir=$RUNDECK_TEMPDIR 
             -Dserver.web.context=/rundeck  #add
             -Drundeck.server.workDir=$RUNDECK_WORKDIR 
             -Dserver.http.port=$RDECK_HTTP_PORT 
             -Drdeck.base=$RDECK_BASE"
# restart rundeckd
$ systemctl restart rundeckd

Step4 : Firewall and Apache Setting

You have to open the port rundeck uses.

# Opening of firewall port
$ firewall-cmd --add-port=4440/tcp --permanent
$ firewall-cmd --add-service=rundeckd --zone=public --permanent 
$ firewall-cmd --reload

And make a rundeck.conf file like following

#Apache
$ touch /etc/httpd/conf.d/rundeck.conf
$ vim /etc/httpd/conf.d/rundeck.conf
  <Location "/rundeck">
          ProxyPass http://<hostname or IP address>/rundeck
          ProxyPassReverse http://<hostname or IP address>/rundeck
 </Location>
# Restart apache
$ systemctl restart httpd

Step5 : Changing password

It’s better to change the default password for making rundeck secure.

Following is the sample to change password.

# Change the password
$ java -jar /var/lib/rundeck/bootstrap/rundeck-3.0.13-20190123.war --encryptpwd Jetty
  Required values are marked with: *
  Username (Optional, but necessary for Crypt encoding):
  admin
  *Value To Encrypt (The text you want to encrypt):
  password

$ vim /etc/rundeck/realm.properties
  admin: MD5:,user,admin,architect,deploy,build #modified

# Restart rundeck
$ systemctl restart rundeckd

You may also like...

Leave a Reply

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