Pepper is a small CLI tool written in Go to run Salt commands against the HTTP API. It's very thin and there's almost no logic to the script.
Both PAM and LDAP auth methods are supported.
go get github.com/iamseth/peppergo install github.com/iamseth/pepper
NAME: pepper - pepper<target><function> [ARGUMENTS ...]USAGE: pepper [global options]command [command options] [arguments...]VERSION: 0.1.0COMMANDS: help, hShows a list of commands orhelpfor onecommandGLOBAL OPTIONS: --hostname, -H Salt API hostname. Should include http[s]//. [$SALT_HOST] --username, -u Salt API username. [$SALT_USER] --password, -p Salt API password. [$SALT_PASSWORD] --auth, -a"ldap"Salt authentication method. [$SALT_AUTH] --help, -hshowhelp --version, -vprint the version
pepper -H https://saltmaster -u salt_user -p password -a ldap'*' test.ping
Or, if you set the following environment variables:
$SALT_USER$SALT_HOST$SALT_AUTH$SALT_PASSWORD
you can just do the following:
# Ping all your hostspepper'*' test.ping# Restart Apache on your web serverspepper'web*' cmd.run'service httpd restart'# Run a highstate on your Redis boxespepper'redis*' state.highstate