main.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: py39-pip,py39-lxml,py39-gunicorn,bash,yarn-node18,git-tiny,npm-node18,rust
  5. state: latest
  6. - name: Source folder exists
  7. file:
  8. path: /usr/local/src
  9. owner: root
  10. mode: 0755
  11. state: directory
  12. - name: Wger source @ master
  13. git:
  14. repo: "https://github.com/wger-project/wger.git"
  15. dest: /usr/local/src/wger
  16. update: yes
  17. force: yes
  18. tags:
  19. - update
  20. - name: Wger requirements up to date
  21. pip:
  22. requirements: /usr/local/src/wger/requirements.txt
  23. executable: pip
  24. - name: sass installed
  25. shell:
  26. cmd: npm install -g sass
  27. tags:
  28. - update
  29. - name: Wger UI built
  30. shell:
  31. cmd: yarn && yarn install
  32. chdir: /usr/local/src/wger/
  33. tags:
  34. - update
  35. - name: Wger UI built
  36. shell:
  37. cmd: yarn build:css:sass
  38. chdir: /usr/local/src/wger/
  39. tags:
  40. - update
  41. - name: Media directory exists
  42. file:
  43. path: /usr/local/www/wger/static/
  44. mode: 0755
  45. state: directory
  46. - name: Static directory exists
  47. file:
  48. path: /usr/local/www/wger/media
  49. mode: 0755
  50. state: directory
  51. - name: Wger conf file installed
  52. template:
  53. src: settings.py.j2
  54. dest: /usr/local/src/wger/settings.py
  55. owner: root
  56. mode: 0644
  57. - name: Wger db migrated
  58. shell:
  59. cmd: python3.9 manage.py migrate
  60. chdir: /usr/local/src/wger/
  61. tags:
  62. - update
  63. - name: Wger static files collected
  64. shell:
  65. cmd: python3.9 manage.py collectstatic --noinput
  66. chdir: /usr/local/src/wger/
  67. tags:
  68. - update
  69. - name: Wger permissions updated
  70. shell:
  71. cmd: python3.9 manage.py loaddata groups.json categories.json
  72. chdir: /usr/local/src/wger/
  73. tags:
  74. - update
  75. - name: Wger nginx file installed
  76. copy:
  77. src: nginx-location.conf
  78. dest: /usr/local/etc/nginx/locations/wger.conf
  79. mode: 0644
  80. notify: Nginx restarted
  81. - name: Wger immortal file installed
  82. copy:
  83. src: immortal-wger.yml
  84. dest: /usr/local/etc/immortal/wger.yml
  85. mode: 0644
  86. notify: Immortal restarted