New version of salt-formula from Saltstack
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.

service.sls 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {%- from "salt/map.jinja" import master with context %}
  2. {%- if master.enabled %}
  3. {%- if master.source.get('engine', 'pkg') == 'pkg' %}
  4. salt_master_packages:
  5. pkg.latest:
  6. - names: {{ master.pkgs }}
  7. {%- if master.source.version is defined %}
  8. - version: {{ master.source.version }}
  9. {%- endif %}
  10. {%- elif master.source.get('engine', 'pkg') == 'pip' %}
  11. salt_master_packages:
  12. pip.installed:
  13. - name: salt{% if master.source.version is defined %}=={{ master.source.version }}{% endif %}
  14. {%- endif %}
  15. /etc/salt/master.d/master.conf:
  16. file.managed:
  17. - source: salt://salt/files/master.conf
  18. - user: root
  19. - template: jinja
  20. - require:
  21. - {{ master.install_state }}
  22. - watch_in:
  23. - service: salt_master_service
  24. {%- if master.peer is defined %}
  25. /etc/salt/master.d/_peer.conf:
  26. file.managed:
  27. - source: salt://salt/files/_peer.conf
  28. - user: root
  29. - template: jinja
  30. - require:
  31. - {{ master.install_state }}
  32. - watch_in:
  33. - service: salt_master_service
  34. {%- endif %}
  35. salt_master_service:
  36. service.running:
  37. - name: {{ master.service }}
  38. - enable: true
  39. /srv/salt/env:
  40. file.directory:
  41. - user: root
  42. - mode: 755
  43. - makedirs: true
  44. {%- endif %}