Server automation
This page describes how to perform changes to translatewiki.net server(s). Target audience is translatewiki.net system administrators. You should know the basics about system administration and puppet.
We use Puppet to manage our servers. Ideally all changes are done in puppet, so that when we move or upgrade servers, we retain those changes. Manual activities should be limited to copying data from old server to the new server.
Requirements
We are currently using Puppet 6 on a Debian Linux. Other versions and operating systems are not tested and may or, more likely, may not work.
How to make a configuration change
Clone the translatewiki repository per instructions in https://gerrit.wikimedia.org/r/admin/repos/translatewiki. Puppet is in the puppet
sub-directory. Configuration values can be changed under data
directory. The puppet configuration currently supports setup of two different environments:
- production (web2)
- development (dev)
Our custom modules are in the modules
sub-directory. We use librarian-puppet to manage dependencies.
Once you have made changes, use make test
to check for mistakes. These are not run automatically in Gerrit.
Submit changes to Gerrit for review.
How to deploy a configuration change
Preparation for first time:
- On the target server, make your own clone of translatewiki repository.
- You must have +2 right in the translatewiki repository in Gerrit.
- You must be in the
sysadmin
group (configured in users module)
To deploy changes:
- Give +2 in gerrit for the patch(es)
- Wait for them to be merged
- Update your local clone to the latest version (
git pull
) - Make a dry-run by executing
make noop
in thepuppet
directory - Check that there are no unexpected changes or errors
- Apply the changes using
make apply
Note: do not use sudo. The Makefile uses sudo when necessary.