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.

64 satır
1.3KB

  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: /etc/salt/grains.d
  9. - mode: 700
  10. - makedirs: true
  11. - user: root
  12. salt_minion_grains_file:
  13. cmd.run:
  14. - name: cat /etc/salt/grains.d/* > /etc/salt/grains
  15. - require:
  16. - file: salt_minion_grains_dir
  17. /etc/salt/minion.d/minion.conf:
  18. file.managed:
  19. - source: salt://salt/files/minion.conf
  20. - user: root
  21. - group: root
  22. - template: jinja
  23. - require:
  24. - pkg: salt_minion_packages
  25. - file: salt_minion_grains_dir
  26. - watch_in:
  27. - service: salt_minion_service
  28. salt_minion_service:
  29. service.running:
  30. - name: {{ minion.service }}
  31. - enable: true
  32. {%- if minion.graph_states %}
  33. salt_graph_packages:
  34. pkg.latest:
  35. - names: {{ minion.graph_pkgs }}
  36. - require:
  37. - pkg: salt_minion_packages
  38. salt_graph_states_packages:
  39. pkg.latest:
  40. - names: {{ minion.graph_states_pkgs }}
  41. /root/salt-state-graph.py:
  42. file.managed:
  43. - source: salt://salt/files/salt-state-graph.py
  44. - require:
  45. - pkg: salt_graph_packages
  46. /root/salt-state-graph.sh:
  47. file.managed:
  48. - source: salt://salt/files/salt-state-graph.sh
  49. - require:
  50. - pkg: salt_graph_packages
  51. {%- endif %}
  52. {%- endif %}