main.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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,py310-pip,jpeg-turbo,tiff,webp,lcms2,freetype2,cairo,pango,rust,libxml2,libxslt,xmlsec1,pkgconf,postgresql13-client,cmake,gdal,geos,direnv,bash
  6. state: latest
  7. - name: Poetry & awscli installed
  8. pip:
  9. name: poetry,awscli
  10. - name: Github SSH key installed
  11. template:
  12. src: sshkey.j2
  13. dest: /root/.ssh/id_ed25519
  14. mode: 0400
  15. - name: Source folder exists
  16. file:
  17. path: /usr/local/src
  18. mode: 0755
  19. state: directory
  20. - name: PorchPals source deployed
  21. git:
  22. repo: "git@github.com:sureapp/platform-porchpals.git"
  23. dest: /usr/local/src/platform-porchpals
  24. accept_hostkey: yes
  25. update: yes
  26. ignore_errors: true
  27. tags:
  28. - deploy
  29. - name: Syncthing ignore file installed
  30. copy:
  31. src: stignore
  32. dest: /usr/local/src/platform-porchpals/.stignore
  33. mode: 0775
  34. - name: Syncthing running as root
  35. shell: sysrc syncthing_user="root"
  36. notify: Syncthing restarted
  37. - name: Environment file installed
  38. template:
  39. src: envrc.j2
  40. dest: /usr/local/src/platform-porchpals/.envrc
  41. mode: 0600
  42. tags:
  43. - deploy
  44. - cron:
  45. name: "Cron job to clear out tmp files every 5 minutes installed"
  46. minute: "5"
  47. job: 'find /usr/local/src/platform-porchpals -type f -name ".syncthing*.tmp" -delete'
  48. - cron:
  49. name: "Cron job to clear out syncthing conflicts every 30 min"
  50. minute: "30"
  51. job: 'find /usr/local/src/platform-porchpals -type f -name "*.sync-conflict*" -delete'
  52. - name: Configure ports
  53. command: make
  54. args:
  55. chdir: /usr/ports/devel/py-pip
  56. chdir: /usr/ports/devel/py-pkgconfig # may not be needed with pkgconf
  57. - name: PorchPals dependecies installed
  58. command: poetry install
  59. args:
  60. chdir: /usr/local/src/platform-porchpals
  61. - name: PorchPals migrations up to date
  62. command: poetry run python manage.py migrate
  63. args:
  64. chdir: /usr/local/src/platform-porchpals
  65. - name: PorchPals immortal file installed
  66. template:
  67. src: porchpals.yml.j2
  68. dest: /usr/local/etc/immortal/porchpals.yml
  69. owner: root
  70. mode: 0600
  71. notify: Immortal restarted