Peppa
Peppa is a small CLI tool to run Salt commands against the HTTP API. It's very thin and there's almost no logic to the script. Output is currently in JSON so you can wrap this tool with anything that consumes JSON like jq.
Both PAM and LDAP auth methods are supported.
I realize there's already a project pepper that does this but I actually had a little trouble making it work and it took longer to debug the issue than it did to write this little thing.
Caveats
I've only tested this with rest_cherrypy. I have run this on Python2 and 3 so it "should" work but YMMV.
Installation
PyPI
sudo pip install peppa
Manually
git clone git@github.com:iamseth/peppa.git
cd peppa
python setup.py build
sudo python setup.py install
Configuration
export SALT_HOST=https://salt.example.com
export SALT_USER=seth
export SALT_PASSWORD=supersecret
Optionally, set SALT_EAUTH. This defaults to ldap but you may want to set this to pam if you use that.
Usage
Usage:
peppa <target> <function> [ARGUMENTS ...]
peppa (-h | --help)
peppa --version
Examples
# Ping all your hosts
peppa '*' test.ping
# Restart Apache on your web servers
peppa 'web*' cmd.run 'service httpd restart'
# Run a highstate on your Redis boxes
peppa 'redis*' state.highstate