Managing server scripts

Status
Not open for further replies.

orever

Wise, Aged Ars Veteran
142
I'm curious to know how everyone here is managing server scripts across multiple servers. Before you jump with the obvious answer of subversion, CVS, etc... that is not the whole answer.

  • How are you using revision control (if you are using it)?
  • If you're not using it, what are you using?
  • What revision control system are you using?
  • How do you structure the repository?
  • Where do you store your scripts on the server?
  • Do you deploy scripts to servers by doing a checkout, or do you export them so any changes can't be checked-in from that export?
  • How do you handle scripts that perform the same function but might have small differences? Config file? "if-then"s?
  • How do you handle the change control process when you need to update? Are you making changes on a live server, or do you have a workflow where you use a dev server, do all sorts of testing, then review and deploy?
  • Do you auto-update scripts from the repo using cron, or do you manually update?
  • Do you include RPMs or other kinds of packages as part of the plan?

Yeah, a lot of questions. I guess my point is I'm really interested in *how* people are approaching this, and not just a list of tools. Also, we all probably know what we're supposed to be doing, but what are you actually doing? I'm also curious if the new style of RCS tools like bazaar or git provide any benefits over svn for this kind of application.

Answers from me:
I've used subversion in the past, and it seemed to work. I would "deploy" to the server by checking out and leaving the script dir as a working copy so any changes that were made could be committed. I handled differences in the machines by making a master config file that was not part of the checkout, and all scripts would read to get their machine-specific settings. I didn't auto-update using cron, I wanted to make sure I was there in case anything went wrong. Scripts were stored in a home directory that we used as the main storage location for everything that was "ours" on the server.
 
How are you using revision control (if you are using it)?
Puppet backed by Subversion. Moving everything to modules, including backup scripts etc.
How do you structure the repository?
Full file-system layout mirroring for managed data files, then several directories under another repository for the Puppet modules and manifests.
Where do you store your scripts on the server?
The Win boxes (not managed by puppet) get them in c:\company-utils\. Due to the name used for the company, it always sounds like I'm swearing. Linux boxes get them in /usr/local/bin normally.
Do you deploy scripts to servers by doing a checkout, or do you export them so any changes can't be checked-in from that export?
Puppet deals with the distribution, so no subversion client on the servers.
How do you handle scripts that perform the same function but might have small differences? Config file? "if-then"s?
We try to avoid that kind of difference where possible.
How do you handle the change control process when you need to update? Are you making changes on a live server, or do you have a workflow where you use a dev server, do all sorts of testing, then review and deploy?
I'd love to have the hardware (or software) for a full development mirror environment. I make do with a dev server for initial writing and testing, and then use the live box to tune when things aren't right. Tuning changes are made on the dev box afterwards (or scp'd) and committed.
Do you auto-update scripts from the repo using cron, or do you manually update?
Puppet deals with that.
Do you include RPMs or other kinds of packages as part of the plan?
Again, Puppet deals with all the details. I create RPMs when needed, and drop them into the internal repositories when they're required.

I've used subversion in the past, and it seemed to work. I would "deploy" to the server by checking out and leaving the script dir as a working copy so any changes that were made could be committed.
My biggest issue with this kind of approach is that someone cracking a single SVN capable box has the potential to upload malicious scripts back into the repository. If you don't notice, you might well check out those scripts onto all your other servers.
 

ronelson

Ars Legatus Legionis
21,399
Subscriptor
My server scripts are used for managing a few servers where our group does not "own" the servers, but we have processes that we need to automate there. Therefore, we have no official version control, we do not have a dev environment, and frankly we are not programmers - the scripts are just another tool we use to assist us with our real job, network security. Our scripts are for things like backing up PIX configs, aggregating logs and sending them to the web portal, turnup/disconnect/change control procedures, etc.

# How are you using revision control (if you are using it)?
# If you're not using it, what are you using?
# What revision control system are you using?
# How do you structure the repository?
# Where do you store your scripts on the server?
My "version control" is simple. I have ~/src which has one directory for each script "set". In each directory I have a file called "newversion.sh" that makes a new dated copy of a file and symlinks it to the "common" name - a poor man's VCS, I have one revision for each day that I can go back to. The scripts are in my home directory, but we are working on setting up an IDM group to allow the other sysadmin guys to modify the files as well.
# Do you deploy scripts to servers by doing a checkout, or do you export them so any changes can't be checked-in from that export?
# How do you handle the change control process when you need to update? Are you making changes on a live server, or do you have a workflow where you use a dev server, do all sorts of testing, then review and deploy?
# Do you auto-update scripts from the repo using cron, or do you manually update?
Since we do not have a dev environment, I sometimes have DEV vars and PROD vars for testing, but normally I just make sure the script is non-destructive or we run it against bogus assets. Pushing the changes out is done with a very simple Makefile and some SSH scripts. We do it manually, as needed.
# How do you handle scripts that perform the same function but might have small differences? Config file? "if-then"s?
Wrappers. Scripts have single functions and our cronjobs often call the wrappers, not the scripts.
# Do you include RPMs or other kinds of packages as part of the plan?
Nope. Simple shell scripts do not require it, plus we do cross-platform rollouts for HP-UX and Solaris - ancient versions to boot - so there is no simple solution.
 
Status
Not open for further replies.