0

I think by now all sys admins have started to amass a large collection of scripts for kinds of scenarios, user management, server builds, incident mitigation tasks, app deployment.

and like most sys admins I've got these scripts kept in a bunch of version control repositories.

These repositories have started to become unstructured and hard to find content; leading to duplication and other such fun things.

does anyone have an equivalent of: https://stackoverflow.com/questions/16829/structure-of-projects-in-version-control

but for structure administration scripts instead of development projects

Preflightsiren
  • 457
  • 2
  • 8

2 Answers2

2

I use Git. I have a whole bunch of public (mostly) git repositories on my Github account, and I have a "devopstools" repository which mostly just contains submodules to link to the other repositories.
See here: https://github.com/tomoconnor/devopstools

As and when I add new scripts to it, they'll either go into a scripts/ directory in the devopstools repository, or into a separate project if they're big and bulky, and then get submodule'd in.

Tom O'Connor
  • 27,480
  • 10
  • 73
  • 148
  • I can definitely see submodule usage being a really good way of managing common scripts across different hosts/services. Looking at your devopstool repo you only have 3 submodules you've linked, which is linked by file group (capistrano, puppet, bash scripts), do you have any cases where the capistrano or puppet manifests need to be different for different services? – Preflightsiren Nov 28 '12 at 04:15
  • 1
    Not really.. I mean.. I'm likely to update the differing scripts inside each repository and then deploy the whole lot, and pick and choose the bits I want.. Alternatively, could branch for different servers/services. – Tom O'Connor Nov 28 '12 at 10:14
2

My tree

REPOROOT - Host - Service - files

(for Host-Service pair I know full path to destination on target. In case of SVN path also stored in custom property)

Lazy Badger
  • 3,137
  • 15
  • 13
  • Do you have a very static list of hosts? Also how do you handle shared services (eg. Web Server) - without duplicating the Install-WebServer script? – Preflightsiren Nov 28 '12 at 04:12
  • @Preflightsiren - no, but I can handle any Host-list (static or very dinamic), it's a matter or adding new dir. I don't version install scripts (it's OS game) and don't share configs: one system - one configuration – Lazy Badger Nov 28 '12 at 04:23