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.

41 line
1.2KB

  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. {%- if grains.os_family in ['FreeBSD', 'Gentoo'] %}
  28. - retry: {{ salt_settings.retry_options | json }}
  29. {%- endif %}
  30. - require:
  31. {% if salt_settings.install_packages %}
  32. - pkg: salt-minion-standalone
  33. {% endif %}
  34. - file: salt-minion-standalone
  35. # clean up old _defaults.conf file if they have it around
  36. remove-old-standalone-conf-file:
  37. file.absent:
  38. - name: {{ salt_settings.config_path }}/minion.d/_defaults.conf