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.

50 lines
1.1KB

  1. {%- from "salt/map.jinja" import minion with context %}
  2. {%- if minion.enabled %}
  3. {%- if minion.source.get('engine', 'pkg') == 'pkg' %}
  4. salt_minion_packages:
  5. pkg.latest:
  6. - names: {{ minion.pkgs }}
  7. {%- if minion.source.version is defined %}
  8. - version: {{ minion.source.version }}
  9. {%- endif %}
  10. {%- elif minion.source.get('engine', 'pkg') == 'pip' %}
  11. salt_minion_packages:
  12. pip.installed:
  13. - name: salt{% if minion.source.version is defined %}=={{ minion.source.version }}{% endif %}
  14. {%- endif %}
  15. /etc/salt/minion.d/minion.conf:
  16. file.managed:
  17. - source: salt://salt/files/minion.conf
  18. - user: root
  19. - group: root
  20. - template: jinja
  21. - require:
  22. - {{ minion.install_state }}
  23. {%- if not grains.get('noservices', False) %}
  24. - watch_in:
  25. - service: salt_minion_service
  26. {%- endif %}
  27. {%- if not grains.get('noservices', False) %}
  28. salt_minion_service:
  29. service.running:
  30. - name: {{ minion.service }}
  31. - enable: true
  32. {%- endif %}
  33. salt_minion_sync_all:
  34. module.run:
  35. - name: 'saltutil.sync_all'
  36. {%- if not grains.get('noservices', False) %}
  37. - watch:
  38. - service: salt_minion_service
  39. {%- endif %}
  40. {%- endif %}