main.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ---
  2. - name: Dependencies installed
  3. community.general.apk:
  4. name: git-tiny,npm,pkgconf,glib
  5. state: latest
  6. - name: Source folder exists
  7. file:
  8. path: /usr/local/src
  9. mode: 0755
  10. state: directory
  11. - name: Github SSH key installed
  12. template:
  13. src: sshkey.j2
  14. dest: /root/.ssh/id_ed25519
  15. mode: 0400
  16. - name: 15Five source deployed
  17. git:
  18. repo: "git@github.com:15five/engagement.git"
  19. dest: /usr/local/src/engagement
  20. accept_hostkey: yes
  21. update: yes
  22. ignore_errors: true
  23. - name: Syncthing ignore file installed
  24. copy:
  25. src: stignore
  26. dest: /usr/local/src/engagement/.stignore
  27. mode: 0775
  28. - name: Environment file installed
  29. template:
  30. src: env.j2
  31. dest: /root/.bashrc
  32. mode: 0600
  33. - name: Fetched libvips source
  34. shell:
  35. chdir: /usr/local/src
  36. cmd: fetch https://github.com/libvips/libvips/releases/download/v8.12.2/vips-8.12.2.tar.gz
  37. - name: Unpacked libvips source
  38. shell:
  39. chdir: /usr/local/src
  40. cmd: tar zxvf vips-8.12.2.tar.gz
  41. - name: libvips built and installed
  42. shell:
  43. chdir: /usr/local/src/libvips-8.12.2
  44. cmd: "./configure & make & make install"
  45. - name: Lerna and dependencies installed
  46. shell:
  47. chdir: /usr/local/src/engagement
  48. cmd: "npm install -g lerna sequelize sequelize-cli@2.6.0 pg && lerna bootstrap"
  49. - name: Run migrations
  50. shell:
  51. chdir: /usr/local/src/engagement/db/emplify
  52. cmd: "source /root/.bashrc && sequelize db:migrate"
  53. - name: Run migrations
  54. shell:
  55. chdir: /usr/local/src/engagement/db/emplify
  56. cmd: "source /root/.bashrc && sequelize db:migrate"
  57. - name: SSH restarted
  58. service: name=sshd state=restarted