Technology Errors

RightScale Stop Recipe From Being Used In RightScript, GIT /tmp/

If you have created a custom RightScript in the RightScale interface that uses git to clone a repository and you are running that RightScript on boot following the RightScale git_repo recipe then you likely are having issues. The problem appears to stem from the fact that the environment variables are not completely cleaned up as expected including $GIT_SSH and possibly others. I have a work around noted below along with a line you can enter in your RightScript to clear the $GIT_SSH ENV variable as well.

Code Snippets

RightScale RightScript To Add SSH Users To Linux Nodes On Boot

The below code snippet was used to add SSH users to RackSpace cloud CentOS Linux nodes being used as application servers and managed via RightScale. The SSH users were required during a testing phase so they could look through logs and make modifications to specific configuration files, etc. There are three things that have to happen to create the SSH user, allow them to login, and provide them the necessary rights on the server to accomplish their tasks which include adding the user, modifying the sshd config to allow password logins, and update the sudoers file to enable sudo access for wheel group users.

Code Snippets

Restart Services On RackSpace Managed Nodes That Require sudo Rights

Recently I was working on a project that was using RightScale to manage RackSpace cloud nodes. One of the requirements of the project was to have application nodes scale automatically thus they were required to automatically install software, configure settings, and start services automatically on the RackSpace CentOS nodes being used. Most everything was fairly straight forward however some of the services we were using would not start properly and initially because of the lack of logging from the services we were unable to figure out what the problem was. Below I describe the problem in more detail along with the solution which involved updating a configuration file on the CentOS Linux servers and then restarting the services.

Code Snippets

RightScale RightScript To Update CentOS iptables Rules On RackSpace Node

Recently while working on some node or instance automation using RightScale I needed to have some extra iptables rules created automatically when a new node booted. Initially I was just trying to do this via iptables commands which I note below but it would never work. After digging through the logs I realized that the iptables commands created by RightScale for the ServerTemplate I was using flushed iptables at the very end of the boot process and thus wiped out the iptables entries created by the RightScript I had created. To accomplish permanent iptables entries for a RackSpace node via RightScale you need to output the iptables command to a file in the location where the boot process picks them up after flushing the current ruleset. Below I describe my first attempt followed by the correct way to have iptables entries picked up by RightScale.

Code Snippets

Represent A Tab When Using sed Find/Replace

The other day I needed to create a RightScript shell script that would update a couple configuration files on a server that was being launched in the RackSpace Cloud via RightScale. I decided to use SED to find and replace content within the configuration files. The first pass at the script failed because what I thought were spaces ended up being tabs. Use the information below to represent a tab within a shell script when using sed.