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.

34 lines
719B

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