How do you avoid that server documentation gets out of sync with the actual setup?

Solution 1:

You're never going to get away from some documentation but as you intimated there are systems that can be integrated into your change process to cover a lot of it.

  • Use a config management tool (like puppet or chef).
  • Store your config in a change controlled manner. (like git or SVN)
  • Make sure config is readable/accessible by humans (i.e. plain text, searchable db)

This way the lower level documentation that we all normally miss (or don't bother with) is enforced by storing that deploy information in config items or code as a part of the system your making changes to. This also has an additional bonus of the process becoming more repeatable in the future.

External documentation does still need to be updated but it becomes very high level with pointers to "deploy x" or "deploy y" instead of long command/file listings. This additionally makes documentation changes both less frequent and easier which also means it will be more likely to get done.

Also before you go home brew, with puppet someone has probably already written something to manage what you want.

Solution 2:

If you only admin one or two small systems, setting up a large configuration management system like puppet or chef seems like overkill. (Though, if you plan to have more systems in the future, do it now!)

For a small setup like this, I'd recommend using something like etckeeper, a program which puts /etc into a git repository and provides a few useful functions, like doing an automatic commit whenever you install, upgrade or remove a package.