init.sls 471 B

12345678910111213141516171819
  1. #
  2. # motd
  3. #
  4. {% set name = grains.id.split('.') %}
  5. motd:
  6. pkg.installed:
  7. - pkgs:
  8. - figlet
  9. cmd.run:
  10. - name: echo > /etc/motd.ffho ; figlet {{name[0]}} >> /etc/motd.ffho; sed -i -e 's/^\(.*\)/ \1/' /etc/motd.ffho ; sed -i -e '$s/\(.*\)/\1.{{name[1:]|join('.')}}/' /etc/motd.ffho ; echo >> /etc/motd.ffho
  11. - creates: /etc/motd.ffho
  12. file.symlink:
  13. - name: /etc/motd
  14. - target: /etc/motd.ffho
  15. - force: True
  16. - backupname: /etc/motd.old