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)

Rundeck new project wizard.

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 a option to Rundeck

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!

Share this page:

2 Comment(s)

Add comment

Comments

From: Josh

Trying to learn how to use rundeck.

A note about the last part where it talks about editing /var/rundeck/projects/your_project_name/etc/resources.xml. I belive the instructions after that point are incorrect as resources.xml only contains a list of nodes(servers) that you want to run the command against.

The other file in the directory (project.properties) doesn't seem to be the right place for giving the option.sshPassword1 and option.sudoPassword2 variables either. I'm not sure where they are mean't to go :(

Also some steps about adding nodes might be useful as you can't do that through the web interface for some reason:

A node is another name for a server/client that you want to run the job against. To add a node you edit /var/rundeck/projects/your-project-name/etc/resources.xml. after the <project> tag add the following (repeat each node you wish to add):

<node name="friendly-name" description="detailed description" tags="accurate tags" hostname="hostname" osArch="amd64" osFamily="unix" osName="Ubuntu" osVersion="14.04" username="remote-user-account"/>

Still not sure which file I need to edit to do the "Modify the line beginning with ssh-authentication=....." step though.

From: JD

Seems like a long way to go when there are lots of smaller, non-Java, ssh-based solutions to this.  A few:

ssh

cluster-ssh

ansible

are just a few examples.  Loading java onto a server just for this purpose seems counter-productive.  After ssh-server is loaded, most systems have all the dependencies needed for ansible already. A simple way to run a command on all hosts listed in the ansible inventory:

$ ansible -i hosts.inventory -a "cat /var/run/reboot-required" all