Tech:Puppet

Miraheze uses a puppet master-slave configuration for deploying and managing configuration across all of the servers.

Puppet Agents
Puppet agents are all servers in the cluster and are able to access the puppet master in order to collect resources and manifests that have been pre-compiled on the master. Puppet agents aren't really overly special except that they have puppet installed on them and have a signed upstream cert on the master.

The manifest is ran every 10 minutes on all agents (which differs from the previous masterless set up where it was every hour unless a change was made). To manually run puppet on an agent you need to run the following as root: puppet agent -t

In the past puppet runs could be disabled by disabling the cron tab and was limited only to operations member - now this process is strongly discouraged. To disable puppet runs then you need to run the following as root: puppet agent --disable=" " To then re-enable puppet runs: puppet agent --enable

Puppet Master
The puppetmaster is the central server that hosts the private git repo and the public git repo (from GitHub) and compiles the manifests for agents to run.

When reinstalling a server you need to clean all certificate information about the particular server. This can be done by running: puppet cert clean When installing a new server, it may be necessary to check what hostname it is using to make a new request for a certificate or maybe just to generally check if any new certificate requests exists. This can be done by running: puppet cert list When decommissioning a server, it is necessary to revoke the certificate of the server in order to prevent it being used to access the contents of the puppetmaster. This should also be done in the event any server is compromised. puppet cert revoke When adding a server to the puppetmaster, it is necessary to sign the certificate request. The following command will verify the certificate is legitimate and then authorise it to use the puppetmaster's contents. puppet cert sign
 * cert

If in the process of debugging you are unsure what the puppermaster is telling an agent to run or is passing on to an agent, it is possible to get a full JSON output of what is being to the server by running: puppet master --compile
 * master

When reinstalling or decommissioning a host, it is necessary to tell the puppetmaster to forget everything it currently knows about the host. This can be done by running: puppet node clean When working with facts, you can get a JSON output of all facts the puppetmaster is aware of that each node knows. This can be done by running: puppet node find
 * node