main.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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,py38-pip,jpeg-turbo,tiff,webp,lcms2,freetype2,cairo,pango,gmake,libxml2,libxslt,py38-psycopg2,py38-xmlsec,py38-cairocffi,py38-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 migrations up to date
  22. command: bash -lc "direnv exec /usr/local/src/bookwyrm /usr/local/bin/python3.8 /usr/local/src/bookwyrm/manage.py migrate"
  23. tags:
  24. - deploy
  25. - name: Bookwyrm frontend files up to date
  26. command: bash -lc "direnv exec /usr/local/src/bookwyrm /usr/local/bin/python3.8 manage.py collectstatic --noinput
  27. args:
  28. chdir: "/usr/local/src/bookwyrm"
  29. tags:
  30. - deploy
  31. - name: Bookwyrm uvicorn immortal file installed
  32. template:
  33. src: uvicorn-immortal.yml.j2
  34. dest: /usr/local/etc/immortal/bookwyrm-uvicorn.yml
  35. owner: root
  36. mode: 0644
  37. notify: Immortal restarted
  38. - name: Bookwyrm celery immortal file installed
  39. template:
  40. src: celery-immortal.yml.j2
  41. dest: /usr/local/etc/immortal/bookwyrm-celery.yml
  42. owner: root
  43. mode: 0644
  44. notify: Immortal restarted