Saltstack Official Linux 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.

36 lines
812B

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. /etc/profile.d:
  4. file.directory:
  5. - user: root
  6. - mode: 750
  7. - makedirs: true
  8. profile.d_clean:
  9. file.directory:
  10. - name: /etc/profile.d
  11. - clean: true
  12. - exclude_pat: 'E@^((?!salt_profile*).)*$'
  13. {%- if system.profile|length > 0 %}
  14. {%- for name, script in system.profile.iteritems() %}
  15. profile.d_script_{{ name }}:
  16. file.managed:
  17. - name: /etc/profile.d/salt_profile_{{ name }}{%if name.split('.')|length == 1 %}.sh{% endif %}
  18. - mode: 755
  19. - source:
  20. - salt://linux/files/etc_profile_{{ name }}
  21. - salt://linux/files/etc_profile
  22. - template: jinja
  23. - defaults:
  24. script: {{ script|yaml }}
  25. - require_in:
  26. - service: profile.d_clean
  27. {% endfor %}
  28. {%- endif %}
  29. {%- endif %}