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.

38 lines
1.1KB

  1. {%- set tplroot = tpldir.split('/')[0] %}
  2. {% from "salt/map.jinja" import salt_settings with context %}
  3. salt-minion-standalone:
  4. {% if salt_settings.install_packages %}
  5. pkg.installed:
  6. - name: {{ salt_settings.salt_minion }}
  7. {%- if salt_settings.version is defined %}
  8. - version: {{ salt_settings.version }}
  9. {%- endif %}
  10. {% endif %}
  11. file.recurse:
  12. - name: {{ salt_settings.config_path }}/minion.d
  13. - template: jinja
  14. - source: salt://{{ tplroot }}/files/minion.d
  15. - clean: {{ salt_settings.clean_config_d_dir }}
  16. - exclude_pat: _*
  17. - context:
  18. standalone: True
  19. {%- if not salt_settings.minion.master_type %}
  20. service.running:
  21. - enable: True
  22. {%- else %}
  23. service.dead:
  24. - enable: False
  25. {%- endif %}
  26. - name: {{ salt_settings.minion_service }}
  27. - require:
  28. {% if salt_settings.install_packages %}
  29. - pkg: salt-minion-standalone
  30. {% endif %}
  31. - file: salt-minion-standalone
  32. # clean up old _defaults.conf file if they have it around
  33. remove-old-standalone-conf-file:
  34. file.absent:
  35. - name: {{ salt_settings.config_path }}/minion.d/_defaults.conf