1. curl -sSk https://<hostip>:8000/hook/install -H "Content-Type: application/json" -d '{ "SecretKey": "<key>" }'
  2. #So I am calling install
  3. reactor.conf:
  4. reactor:
  5. - 'salt/netapi/hook/restart':
  6. - /srv/salt/reactor/services/restart.sls
  7. - 'salt/netapi/hook/install':
  8. - /srv/salt/reactor/services/install.sls
  9. ## This would run the state /srv/salt/reactor/services/install.sls
  10. cat /srv/salt/reactor/services/install.sls
  11. # Assign the postdata sent by curl to the postdata variable
  12. {% set postdata = data.get('post', {}) %}
  13. #verifies the condition
  14. {% if postdata.SecretKey == "<key>" %}
  15. #installs the package
  16. install_package:
  17. cmd.pkg.install:
  18. - tgt: '<minion id>'
  19. - arg:
  20. - telnet
  21. {% endif %}