Rundeck and Job Automation with PeopleSoft
If you are unfamiliar with Rundeck, get ready to have your life as a System Admin made a bit easier. Rundeck allows you to take your scripts and put a web interface in front of them so you can easily set parameters and then run then with just a few mouse clicks. The only real limitation is what you can come up with in your preferred scripting language (bash, power shell, python, emcli, sqlplus... etc). Given the lack of admin tools delivered by Oracle for managing PeopleSoft, I find this software to be a must for any PeopleSoft Administrator.
Installing the software is a breeze which can be done with either a package manager or simply by running the jar file with java. (instructions on rundeck website) Once you've done this just point your browser at http://localhost:4440 and sign in with admin/admin.
Let's go through the setup. In this case I am going to install it on an Oracle Linux 7 VM with Campus Solutions PUM image#2 already installed.
After it is installed you'll need to modify the file /etc/rundeck/rundeck-config.properties and set the value of grails.serverURL=http://localhost:4440 to the DNS/IP for your server.
You can now login with the url specified above on port 4440 and the default username/password admin/admin
Afterwards we need to configure the target host as an option in our PSDMO project. Edit the file /var/rundeck/projects/PSDEMO/etc/resources.xml and add the node name using the example shown below.
Installing the software is a breeze which can be done with either a package manager or simply by running the jar file with java. (instructions on rundeck website) Once you've done this just point your browser at http://localhost:4440 and sign in with admin/admin.
Let's go through the setup. In this case I am going to install it on an Oracle Linux 7 VM with Campus Solutions PUM image#2 already installed.
1. Install RunDeck
#Commands to install Rundeck
yum install java
rpm -Uvh http://repo.rundeck.org/latest.rpm
yum install rundeck
After it is installed you'll need to modify the file /etc/rundeck/rundeck-config.properties and set the value of grails.serverURL=http://localhost:4440 to the DNS/IP for your server.
2. Startup the Rundeck service and login
service rundeckd start
You can now login with the url specified above on port 4440 and the default username/password admin/admin
3. Create a new Project
When you login for the first time the welcome page will show the option to create a new project. A project is a container to hold a collection of jobs and target hosts. Click the New project button and title it PSDEMO. You can accept the deafults for the rest of the options.4. Configure Rundeck to login to your SSH target via private/public key
Rundeck wants to login to your target host via SSH. It's best to use private/public key authentication for this. The script below will setup the psadm2 user so that the default rundeck can authenticate with its private key.#Remove password expiry for psadm2
chage -d 999999 psadm2
#add rundeck user key to authorized_keys for psadm2
mkdir /home/psadm2/.ssh/
cp /var/lib/rundeck/.ssh/id_rsa.pub /home/psadm2/.ssh/authorized_keys
chown -R psadm2 /home/psadm2/.ssh
chmod -R 750 /home/psadm2/
chmod -R 700 /home/psadm2/.ssh
chmod 600 /home/psadm2/.ssh/authorized_keys
Afterwards we need to configure the target host as an option in our PSDMO project. Edit the file /var/rundeck/projects/PSDEMO/etc/resources.xml and add the node name using the example shown below.
4. Testing the connection
If you go to the PSDMO project in the Rundeck web interface->Commands. you can run an adhoc command. Use the example below to confirm that your able to connect as the psadm2 user.
5. Creating a job
At this point you can create a new job under the jobs tab and run any script you can think of against the target node(s). At the bottom of this post is sample job that I use to clear the cache and restart the web/app/prcs domains within a PS_CFG_HOME. Rundeck jobs are stored/exported/import in yaml format so you can import this job into your instance. Directly below is a video of this job in action. You'll see that it even provides a real time view of the log output as it runs.
This is just scraping the surface though; at my office we use this for delegating restarts to the developers, cobol compile, database refreshing and with the help of emcli, integration to Oracle OEM. Someday I may test out the Puppet integration plugins.
This is just scraping the surface though; at my office we use this for delegating restarts to the developers, cobol compile, database refreshing and with the help of emcli, integration to Oracle OEM. Someday I may test out the Puppet integration plugins.
Great stuffs.. Please Keep Writing
ReplyDelete