Rundeck notification from email

This document describes how to configure Rundeck for email support. Email settings are located in the rundeck-config.properties file. Depending on the installer used, the configuration files will be under a base directory:

vim /opt/rundeck/server/config/rundeck-config.properties

#notification email
grails.mail.host=mail.diegoluisi.eti.br
grails.mail.port=25
grails.mail.default.from=rundeck@diegoluisi.eti.br
grails.mail.username=alertas@diegoluisi.eti.br
grails.mail.password=Passw0rd

Rundeck – Shell Script Backup Sonicwall

How to create a Rundeck Job to Backup Sonicwall over FTP.

#!/bin/bash
# set variables for easy changes
user=admin
password="SW_PASSWORD"
name=$1
host=$2

# load from bash
/usr/bin/expect <”
send “export preferences ftp ftp.diegoluisi.eti.br dluisi \”FTP_PASSWORD\” $name-$(date +%Y-%m-%d).exp\n”
expect -re “.*NSA 3500>”
send “exit\n”
EOF

Captura de Tela 2015-06-11 às 15.24.22

Rundeck add Node Linux

A Node is a resource that is either a physical or virtual instance of a network accessible host. Nodes have a few basic attributes but a Node’s attributes can be extended to include arbitrary named key/value pairs. Attributes typically describe the properties of a node or reflect the state of the node. One of a Node’s built in attributes is called “tags” which is a list of classifications or categories about that Node.

Captura de Tela 2015-06-11 às 14.14.49
1. Create a ssh key and copy to your node

ssh-keygen -t rsa
ssh root@192.168.10.X mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh root@192.168.10.X 'cat >> .ssh/authorized_keys

2. Edit the resources.xml to add new nodes.
vim /opt/rundeck/projects/Project01/etc/resources.xml

3. Add this line:

Captura de Tela 2015-06-11 às 15.04.10

4. Run a command:
Captura de Tela 2015-06-11 às 15.06.19

Success!

How to Install RunDeck

Rundeck is open source software that helps you automate routine operational procedures in data center or cloud environments. Rundeck provides a number of features that will alleviate time-consuming grunt work and make it easy for you to scale up your automation efforts and create self service for others. Teams can collaborate to share how processes are automated while others are given trust to view operational activity or execute tasks.

Rundeck allows you to run tasks on any number of nodes from a web-based or command-line interface. Rundeck also includes other features that make it easy to scale up your automation efforts including: access control, workflow building, scheduling, logging, and integration with external sources for node and option data.

Already itching to install it? Jump ahead to Installing Rundeck.

http://rundeck.org/docs/manual/introduction.html

1. Install Java
yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel -y
java -version

2. Download and configure Rundeck
cd /tmp
wget http://dl.bintray.com/rundeck/rundeck-maven/rundeck-launcher-2.5.1.jar
export RDECK_BASE=/etc/rundeck/
mkdir $RDECK_BASE
mv rundeck-launcher-2.5.1.jar /etc/rundeck/
cd $RDECK_BASE
ln -s /etc/rundeck/server/sbin/rundeckd /etc/init.d/
/etc/init.d/rundeckd start

3. Change your password
vim /etc/rundeck/server/config/realm.properties
admin:Your_Pa$$w0rd,user,admin

4. If after your login you redirect to localhost edit this file
vim /etc/rundeck/etc/framework.properties
framework.server.url = http://yourservername:4440

5. Add Iptables Rules
vim /etc/sysconfig/iptables
-A INPUT -p tcp --dport 4440 -j ACCEPT
/etc/init.d/iptables restart