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.

54 satır
1.4KB

  1. {% from "salt/map.jinja" import salt_settings with context %}
  2. salt-minion:
  3. {% if salt_settings.install_packages %}
  4. pkg.installed:
  5. - name: {{ salt_settings.salt_minion }}
  6. {% endif %}
  7. file.recurse:
  8. - name: {{ salt_settings.config_path }}/minion.d
  9. - template: jinja
  10. - source: salt://{{ slspath }}/files/minion.d
  11. - clean: {{ salt_settings.clean_config_d_dir }}
  12. - exclude_pat: _*
  13. - context:
  14. standalone: False
  15. service.running:
  16. - enable: True
  17. - name: {{ salt_settings.minion_service }}
  18. {%- if not salt_settings.restart_via_at %}
  19. - watch:
  20. {%- if salt_settings.install_packages %}
  21. - pkg: salt-minion
  22. {%- endif %}
  23. - file: salt-minion
  24. - file: remove-old-minion-conf-file
  25. {%- else %}
  26. at:
  27. pkg.installed: []
  28. restart-salt-minion:
  29. cmd.wait:
  30. - name: echo salt-call --local service.restart salt-minion | at now + 1 minute
  31. - order: last
  32. - require:
  33. - pkg: at
  34. - watch:
  35. {%- if salt_settings.install_packages %}
  36. - pkg: salt-minion
  37. {%- endif %}
  38. - file: salt-minion
  39. - file: remove-old-minion-conf-file
  40. {%- endif %}
  41. {% if salt_settings.minion_remove_config %}
  42. remove-default-minion-conf-file:
  43. file.absent:
  44. - name: {{ salt_settings.config_path }}/minion
  45. {% endif %}
  46. # clean up old _defaults.conf file if they have it around
  47. remove-old-minion-conf-file:
  48. file.absent:
  49. - name: {{ salt_settings.config_path }}/minion.d/_defaults.conf