Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

How to install Rundeck on a Debian 8 (Jessie) server


This tutorial shows the steps to install and configure a rundeck server.

Rundeck allows you to run commands/scripts on a remote computer. In this tutorial, I will deal with Linux servers : Debian for rundeck server and Debian/ubuntu for the remote computers.

Preliminary notes

As Rundeck uses ssh to connect to remote systems, you must have an account on those systems with a sudo right (if necessary).
We suppose the username is rundeck with password rundeck.

Rundeck is written in java, so we need to install the JDK:

dpkg –add-architecture i386
apt-get install openjdk-7-jdk

Downloading Rundeck

At this time, the last version is 2.6.7. To download the software, use the following command:

wget http://dl.bintray.com/rundeck/rundeck-deb/rundeck-2.6.7-1-GA.deb

Install the package :

dpkg -i ./rundeck-2.6.7-1-GA.deb

Configure Rundeck Sever

Configure the package:

Edit the files /etc/rundeck/framework.properties and /etc/rundeck/rundeck-config.properties and change the line:

grails.serverURL=http://localhost:4440

to:

grails.serverURL=http://your_server:4440

where your_server is the ip address or FQDN of your rundeck server.

That’s it!

To start Rundeck, just run the following command:

/etc/init.d/rundeckd start

and wait for a minute before connecting.
Launch your favorite web browser and go to: http://your_server:4440

Use Rundeck Sever

To connect to the GUI, use the username and password: admin / admin.

Create a project

For the first connection, click on the link “New project” to add a project.
You have to provide at least a project name (without spaces)

new_project

In the “Resource Model source” section, click the “Edit” button and choose “Require file exists”. Then click on “Save”

In the “Default Node Executor” section, I choose “password” for SSH AUthentication (it is however possible to use a pair of keys for better security) Click on “Create” to create the project.

Create a job

Now you are ready to create your first job. This job consists of an ssh connection to launch a remote command.
Click on “Create a new job” and choose your job name (without spaces).
Now we need a password and a sudo password to connect and launch a command.

add_option

Click “Add an option.

In the option name, specify sshPassword1 and in default value specify your password (here we will use rundeck)
In the Input type, choose “Secure Remote authentication” and change “Required” from No to Yes as it is a mandatory field.
Repeat the operation with sudoPassword2 and the value rundeck.

Click “Save”

In the section “Add a step”, choose “Command”
Provide your command in the Command field . I choose to update my server:

sudo “apt-get update”

Click on “Save” then “Create” to create the job.

To apply this job to our remote systems (called nodes), we need to edit the node file:

vi /var/rundeck/projects/your_project_name/etc/resources.xml

Modify the line beginning with ssh-authentication=”password” ssh-password-option=”option.sshPassword1″ sudo-command-enabled=”true” sudo-password-option=”option.sudoPassword2″.

Now go back to your GUI and launch the job!

Comments

comments