The following is walkthrough that documents how to run a sample REST service and configure one or more proxy minions to talk to and control it.
bottle
via pip globally on your systemproxyminion_rest_example
somewhere on a machine that is reachable from the machine on which you want to
run the salt-proxy. This machine needs Python 2.7 or later.pip install bottle==0.12.8
python rest.py --help
for usageNow, configure your salt-proxy.
/etc/salt/proxy
and add an entry for your master's locationmaster: localhost
base:
'p8000':
- p8000
This says that Salt's pillar should load some values for the proxy p8000
from the file /srv/pillar/p8000.sls (if you have not changed your default pillar_roots)
p8000.sls
---------
proxy:
proxytype: rest_sample
url: http://<IP your REST listens on>:port
In other words, if your REST service is listening on port 8000 on 127.0.0.1
the 'url' key above should say url: http://127.0.0.1:8000
salt-proxy --proxyid=p8000 -l debug
salt-key -y -a p8000
The following keys are going to be accepted:
Unaccepted Keys:
p8000
Key for minion p8000 accepted.
salt p8000 test.ping
pkg.install
. If you pass '==' and a verrsion number after the package
name then the service will parse that and accept that as the package's
version.salt p8000 grains.items
to see what grains are available. You
can target proxies via grains if you like.service.start
, etc.Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2016.3.3