main.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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,py37-pip,vim-console,tmux,fish,direnv,postgresql12-client,py37-sqlite3
  6. state: latest
  7. - name: Root shell is fish
  8. ansible.builtin.user: name=root shell=/usr/local/bin/fish
  9. - name: Nginx location file installed
  10. copy:
  11. src: nginx-location.conf
  12. dest: /usr/local/etc/nginx/locations/mathesar.conf
  13. mode: 0644
  14. notify: Nginx restarted
  15. - name: Source folder exists
  16. file:
  17. path: /usr/local/src
  18. mode: 0755
  19. state: directory
  20. - name: Create python bin link for yarn
  21. file:
  22. src: /usr/local/bin/python3.8
  23. dest: /usr/bin/python
  24. owner: root
  25. state: link
  26. - name: Mathesar source deployed
  27. git:
  28. repo: "https://github.com/centerofci/mathesar"
  29. dest: /usr/local/src/mathesar
  30. accept_hostkey: yes
  31. update: yes
  32. ignore_errors: true
  33. tags:
  34. - deploy
  35. - name: Syncthing ignore file installed
  36. copy:
  37. src: stignore
  38. dest: /usr/local/src/fifteen5/.stignore
  39. mode: 0775
  40. - name: Environment file installed
  41. template:
  42. src: envrc.j2
  43. dest: /usr/local/src/mathesar/.envrc
  44. mode: 0600
  45. tags:
  46. - deploy
  47. - name: Allow environment file
  48. shell:
  49. cmd: direnv allow
  50. chdir: /usr/local/src/mathesar
  51. tags:
  52. - deploy
  53. - name: Requirements up to date
  54. pip:
  55. requirements: /usr/local/src/mathesar/requirements.txt
  56. executable: pip
  57. tags:
  58. - deploy
  59. - name: Migrations up to date
  60. command: bash -lc "direnv exec /usr/local/src/mathesar /usr/local/bin/python3.8 /usr/local/src/mathesar/manage.py migrate"
  61. tags:
  62. - deploy
  63. - name: Install base tables
  64. command: bash -lc "direnv exec /usr/local/src/mathesar /usr/local/bin/python3.8 /usr/local/src/mathesar/install.py"
  65. tags:
  66. - deploy
  67. - name: Frontend files generated and copied
  68. command: bash -lc "direnv exec /usr/local/src/mathesar/usr/local/bin/npm install"
  69. args:
  70. chdir: "/usr/local/src/mathesar"
  71. tags:
  72. - deploy
  73. - never
  74. - name: API supervisor file installed
  75. copy:
  76. src: mathesar-api-supervisor.conf
  77. dest: /usr/local/etc/supervisor/conf.d/mathesar-api.conf
  78. owner: root
  79. mode: 0644
  80. notify: Supervisor restarted
  81. - name: UI supervisor file installed
  82. copy:
  83. src: mathesar-ui-supervisor.conf
  84. dest: /usr/local/etc/supervisor/conf.d/mathesar-ui.conf
  85. owner: root
  86. mode: 0644
  87. notify: Supervisor restarted