Saltstack Official Salt Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1KB

  1. #!jinja|yaml
  2. {% from "salt/map.jinja" import salt_settings with context %}
  3. include:
  4. - salt.master
  5. - pip.extensions
  6. {%- set cfg_salt = pillar.get('salt', {}) %}
  7. {%- set cfg_master = cfg_salt.get('master', {}) %}
  8. salt-api:
  9. pkg.installed:
  10. - name: {{ salt_settings['salt-api'] }}
  11. service.running:
  12. - name: {{ salt_settings.get('api_service', 'salt-api') }}
  13. - require:
  14. - service: {{ salt_settings.get('api_service', 'salt-api') }}
  15. {%- if 'rest_cherrypy' in cfg_master %}
  16. - pip: salt-api-cherrypy
  17. {% elif 'rest_tornado' in cfg_master %}
  18. - pip: salt-api-tornado
  19. {% endif %}
  20. - watch:
  21. - pkg: salt-master
  22. - file: salt-master
  23. {%- if 'rest_cherrypy' in cfg_master %}
  24. salt-api-cherrypy:
  25. pkg.purged:
  26. - name: {{ salt_settings['python-cherrypy'] }}
  27. pip.installed:
  28. - name: cherrypy
  29. - require:
  30. - pkg: salt-api-cherrypy
  31. - pkg: pip_extensions
  32. {% endif %}
  33. {%- if 'rest_tornado' in cfg_master %}
  34. salt-api-tornado:
  35. pkg.purged:
  36. - name: {{ salt_settings['python-tornado'] }}
  37. pip.installed:
  38. - name: tornado
  39. - require:
  40. - pkg: salt-api-tornado
  41. - pkg: pip_extensions
  42. {% endif %}