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.

37 line
1.1KB

  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. {%- if salt_settings.version is defined %}
  7. - version: {{ salt_settings.version }}
  8. {%- endif %}
  9. {% endif %}
  10. file.recurse:
  11. - name: {{ salt_settings.config_path }}/minion.d
  12. - template: jinja
  13. - source: salt://{{ slspath }}/files/minion.d
  14. - clean: {{ salt_settings.clean_config_d_dir }}
  15. - exclude_pat: _*
  16. - context:
  17. standalone: True
  18. {%- if salt_settings.minion.master_type is defined and salt_settings.minion.master_type == 'disable' %}
  19. service.running:
  20. - enable: True
  21. {%- else %}
  22. service.dead:
  23. - enable: False
  24. {%- endif %}
  25. - name: {{ salt_settings.minion_service }}
  26. - require:
  27. {% if salt_settings.install_packages %}
  28. - pkg: salt-minion
  29. {% endif %}
  30. - file: salt-minion
  31. # clean up old _defaults.conf file if they have it around
  32. remove-old-standalone-conf-file:
  33. file.absent:
  34. - name: {{ salt_settings.config_path }}/minion.d/_defaults.conf