Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Installed on preq
- Cherrypy version 3.2.2
- Put in Cherrypy config to file /etc/salt/master.d/salt-api.conf
- rest_cherrypy:
- port: 8080
- host: <your hosts ip>
- ssl_crt: /etc/ssl/private/cert.pem
- ssl_key: /etc/ssl/private/key.pem
- webhook_disable_auth: True
- webhook_url: /hook
- Then created /etc/salt/master.d/reactor.conf
- reactor:
- - 'salt/netapi/hook/restart':
- - /salt/reactor/restart.sls
- Then created vi /salt/reactor/services/restart.sls
- {% set postdata = data.get('post', {}) %}
- restart_services:
- cmd.service.restart:
- - tgt: '{{ postdata.tgt }}'
- - arg:
- - {{ postdata.service }}
- Then I pass a curl command with the following info:
- curl -H "Accept: application/json" -d tgt='*' -d service="nginx" -d secretkey="number for key" -k https://132.249.232.234:8080/hook/restart
- Comes back as true. But nginx was not restarted on minion.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement