Tech:Salt

From Meta
Jump to navigation Jump to search

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

Salt SSH[edit | edit source]

Salt SSH is installed on puppet2.

To run a salt command, ssh into puppet2 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"

See also[edit | edit source]