Installing and Configuring Rundeck
You’re either the one that creates the automation or you’re getting automated…
Rundeck is open-source software that helps you automate and schedule routine operational procedures in your environment may that be On-Premisses or Cloud-based.
Some Rundeck features
- Scheduled or On-demand (Web GUI, CLI or API WebHooks) job execution
- Pluggable execution system (SSH and WinRM by default; Powershell available)
- Secure Key store for passwords and keys
- Role-based access control policy with support for LDAP/ActiveDirectory and other SSO
- Access control policy editing/management tools
- History and auditing logs
- Use any scripting language
- GIT and Other SCM Support
Rundeck is great if you need a GUI tool instead of Crons. At least that’s how I have configured most of my jobs in Rundeck. It also supports PowerShell execution by using the WinRM module.
I’ve got tons of jobs configured to submit AD reports, Database logs and Server Logs to audit every month for review. Taking periodical device config backups, Restarting servers running on Vmware and more. This saved me a hefty amount of time. Best of all is even though there is an Enterprise paid version Community Open source Rundeck is more than enough for those jobs.
Sometimes you may have to get creative like using PowerShell PowerCli to execute Vmware jobs instead of purchasing the enterprise version for the VMware plugin. But there is a way always.
Also, if you are able to buy the Enterprise version. Do it. It’s worth it.
Prerequisites
( It will work out of the box with h2 database. But its not recommended for production environment. If you are just testing this out go ahead and skip to the Rundeck installation part)
- Mysql or MariaDB
- JAVA
Setting Up DB
Let’s add repositories first
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
Install MariaDB
sudo yum install MariaDB-server MariaDB-client
Enable Auto Start and Start the service
sudo systemctl enable mariadb sudo systemctl start mariadb
Secure MariaDB installation (add a Password and answer Y or {enter} typically)
sudo mysql_secure_installation
Login to MariaDB – Enter the password you set in the previous step.
mysql -u root -p Enter password:
You’ll get into the promt
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 33 Server version: 10.5.10-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
Create a new Database for rundeck
create database rundeck;
Create a new user called rundeck user and grant all permissions in rundeck database to the said user.
grant ALL on rundeck.* to 'rundeckuser'@'localhost' identified by 'rundeckpassword'; Query OK, 0 rows affected (0.008 sec)
No Explanation need if you decided to install rundeck
exit Bye
Install and Configure Rundeck
Setup repos and install rundeck
rpm -Uvh http://repo.rundeck.org/latest.rpm sudo yum install rundeck java
Rundeck by default only allow traffic from local host. We need to change that if you need to access it from elsewhere.
cd /etc/rundeck/ vim rundeck-config.properties
Edit Below line with your own server IP.
grails.serverURL=http://localhost:4440
TO
grails.serverURL=http://192.168.2.229:4440
Lets Configure Rundeck to use Mysql Database (Skip to Rundeck Restart part if you choose not to have external Database)
In the same config file. Change below values as you defined earlier if you have changed them
dataSource.dbCreate = update dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true
To
dataSource.dbCreate = update dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false dataSource.username=rundeckuser dataSource.password=rundeckpassword dataSource.driverClassName=org.mariadb.jdbc.Driver
Save it with Esc -> !wq -> Enter
Restart the Rundeck Service
service rundeckd restart
Navigate to YourserverIP:4440 using your browser
Voila!!!
I’ll leave you with one of the best quotes for automation.
You’re either the one that creates the automation or you’re getting automated…
— Tom Preston