Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Installed on preq
  2.  
  3. Cherrypy version 3.2.2
  4.  
  5. Put in Cherrypy config to file /etc/salt/master.d/salt-api.conf
  6.  
  7. rest_cherrypy:
  8. port: 8080
  9. host: <your hosts ip>
  10. ssl_crt: /etc/ssl/private/cert.pem
  11. ssl_key: /etc/ssl/private/key.pem
  12. webhook_disable_auth: True
  13. webhook_url: /hook
  14.  
  15. Then created /etc/salt/master.d/reactor.conf
  16.  
  17. reactor:
  18. - 'salt/netapi/hook/restart':
  19. - /salt/reactor/restart.sls
  20.  
  21.  
  22. Then created vi /salt/reactor/services/restart.sls
  23.  
  24. {% set postdata = data.get('post', {}) %}
  25.  
  26. restart_services:
  27. cmd.service.restart:
  28. - tgt: '{{ postdata.tgt }}'
  29. - arg:
  30. - {{ postdata.service }}
  31.  
  32. Then I pass a curl command with the following info:
  33.  
  34. curl -H "Accept: application/json" -d tgt='*' -d service="nginx" -d secretkey="number for key" -k https://132.249.232.234:8080/hook/restart
  35.  
  36. Comes back as true. But nginx was not restarted on minion.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement