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.

58 line
1.1KB

  1. {%- from "salt/map.jinja" import minion with context %}
  2. {%- if minion.enabled %}
  3. salt_minion_packages:
  4. pkg.latest:
  5. - names: {{ minion.pkgs }}
  6. salt_minion_grains_dir:
  7. file.directory:
  8. - name: /var/lib/salt/grains
  9. - mode: 700
  10. - makedirs: true
  11. - user: root
  12. /etc/salt/minion.d/minion.conf:
  13. file.managed:
  14. - source: salt://salt/files/minion.conf
  15. - user: root
  16. - group: root
  17. - template: jinja
  18. - require:
  19. - pkg: salt_minion_packages
  20. - file: salt_minion_grains_dir
  21. - watch_in:
  22. - service: salt_minion_service
  23. salt_minion_service:
  24. service.running:
  25. - name: {{ minion.service }}
  26. - enable: true
  27. {%- if minion.graph_states %}
  28. salt_graph_packages:
  29. pkg.latest:
  30. - names: {{ minion.graph_pkgs }}
  31. - require:
  32. - pkg: salt_minion_packages
  33. salt_graph_states_packages:
  34. pkg.latest:
  35. - names: {{ minion.graph_states_pkgs }}
  36. /root/salt-state-graph.py:
  37. file.managed:
  38. - source: salt://salt/files/salt-state-graph.py
  39. - require:
  40. - pkg: salt_graph_packages
  41. /root/salt-state-graph.sh:
  42. file.managed:
  43. - source: salt://salt/files/salt-state-graph.sh
  44. - require:
  45. - pkg: salt_graph_packages
  46. {%- endif %}
  47. {%- endif %}