main.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. - name: Dependencies installed
  3. # We install xmlsec and cairocffi using pkg because python-Levenshtein is tricky to install on FreeBSD
  4. community.general.pkgng:
  5. name: git-tiny,py311-pip,jpeg-turbo,tiff,webp,lcms2,freetype2,cairo,pango,gmake,libxml2,libxslt,py311-psycopg2,py311-xmlsec,py311-cairocffi,py311-sqlite3,bash
  6. state: latest
  7. - name: Bookwyrm source deployed
  8. git:
  9. repo: "https://github.com/bookwyrm-social/bookwyrm.git"
  10. dest: /usr/local/src/bookwyrm
  11. update: yes
  12. ignore_errors: true
  13. tags:
  14. - deploy
  15. - name: Requirements up to date
  16. pip:
  17. requirements: /usr/local/src/bookwyrm/requirements.txt
  18. executable: pip
  19. tags:
  20. - deploy
  21. - name: Bookwyrm env file installed
  22. template:
  23. src: bookwyrm.env.j2
  24. dest: /usr/local/src/bookwyrm/.env
  25. owner: root
  26. mode: 0644
  27. - name: Bookwyrm migrations up to date
  28. command: bash -lc "python3.11 manage.py migrate"
  29. args:
  30. chdir: "/usr/local/src/bookwyrm"
  31. tags:
  32. - deploy
  33. - name: Bookwyrm frontend files up to date
  34. command: bash -lc "python3.11 manage.py collectstatic --noinput"
  35. args:
  36. chdir: "/usr/local/src/bookwyrm"
  37. tags:
  38. - deploy
  39. - name: Bookwyrm uvicorn immortal file installed
  40. template:
  41. src: bookwyrm-web-immortal.yml.j2
  42. dest: /usr/local/etc/immortal/bookwyrm-web.yml
  43. owner: root
  44. mode: 0644
  45. notify: Immortal restarted
  46. - name: Bookwyrm celery immortal file installed
  47. template:
  48. src: bookwyrm-celery-immortal.yml.j2
  49. dest: /usr/local/etc/immortal/bookwyrm-celery.yml
  50. owner: root
  51. mode: 0644
  52. notify: Immortal restarted