init.sls 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # firmware
  3. #
  4. {% set firmware_path = salt['pillar.get']('node:path:firmware')
  5. firmware-pkgs:
  6. pkg.installed:
  7. - pkgs:
  8. - git
  9. - pandoc
  10. user.present:
  11. - name: firmware
  12. - gid: firmware
  13. - shell: /bin/bash
  14. - home: /home/firmware
  15. - createhome: True
  16. firmware-git:
  17. file.directory:
  18. - name: {{ firmware_path }}
  19. - user: firmware
  20. - group: firmware
  21. - mode: 755
  22. - require:
  23. - user: firmware
  24. git.latest:
  25. - name: gogs@git.srv.in.ffho.net:FreifunkHochstift/ffho-firmware-website.git
  26. - target: {{ firmware_path }}
  27. - user: firmware
  28. - update_head: False
  29. - require:
  30. - pkg: firmware-pkgs
  31. - user: firmware
  32. - file: firmware-git
  33. firmware-changelog:
  34. cmd.run:
  35. - name: FORCE=1 /usr/local/sbin/update-firmware
  36. - creates: {{ firmware_path }}/stable/Changelog.html
  37. - user: firmware
  38. - group: firmware
  39. - watch:
  40. - git: firmware-git
  41. - require:
  42. - user: firmware
  43. - file: /usr/local/sbin/update-firmware
  44. firmware-cron:
  45. cron.present:
  46. - name: /usr/local/sbin/update-firmware
  47. - identifier: firmware-cron
  48. - user: firmware
  49. - minute: 42
  50. - require:
  51. - user: firmware
  52. - file: /usr/local/sbin/update-firmware
  53. /usr/local/sbin/update-firmware:
  54. file.managed:
  55. - source: salt://firmware/update-firmware
  56. - template: jinja
  57. - mode: 755