Tech:Salt

Miraheze uses salt-ssh to do automated things like running puppet accross all hosts almost instantly.

Salt SSH
Salt SSH is installed on puppet141.

To run a salt command, ssh into puppet141 and run:

salt-ssh -E '.*' cmd.run 'puppet agent -tv'

To limit the command to certain hosts like mw* do the following:

salt-ssh -E 'mw.*' cmd.run 'puppet agent -tv'

To run it against for example cp* and mw* do:

salt-ssh -E '(mw*|cp*)' cmd.run 'puppet agent -tv'

To depool one of mw* from cp* do the following:

salt-ssh -E "cp.*" cmd.run "sudo varnishadm backend.set_health mw3 sick"

To repool do the following:

salt-ssh -E "cp.*" cmd.run "sudo varnishadm backend.set_health mw3 auto"

To list status of backends do the following:

salt-ssh -E "cp.*" cmd.run "sudo varnishadm backend.list"