Saltstack Official Linux Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

45 lines
930B

  1. {%- from "linux/map.jinja" import system with context %}
  2. {%- if system.enabled %}
  3. {%- if grains.os_family == 'RedHat' %}
  4. {#- update-motd is not available in RedHat, so support only static motd #}
  5. /etc/motd:
  6. file.managed:
  7. - contents_pillar: linux:system:motd
  8. {%- else %}
  9. package_update_motd:
  10. pkg.installed:
  11. - name: update-motd
  12. /etc/update-motd.d:
  13. file.directory:
  14. - clean: true
  15. - require:
  16. - pkg: package_update_motd
  17. {%- for motd in system.motd %}
  18. {%- set motd_index = loop.index %}
  19. {%- for name, value in motd.iteritems() %}
  20. motd_{{ motd_index }}_{{ name }}:
  21. file.managed:
  22. - name: /etc/update-motd.d/5{{ motd_index }}-{{ name }}
  23. - source: salt://linux/files/motd.sh
  24. - template: jinja
  25. - mode: 755
  26. - require:
  27. - file: /etc/update-motd.d
  28. - defaults:
  29. index: {{ motd_index }}
  30. motd_name: {{ name }}
  31. {%- endfor %}
  32. {%- endfor %}
  33. {%- endif %}
  34. {%- endif %}