main.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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: 15Five 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: Syncthing running as root
  41. shell:
  42. cmd: 'sed -i -e ''/^: ${syncthing_user/s/"syncthing"/"root"/'' /usr/local/etc/rc.d/syncthing'
  43. warn: false
  44. notify: Syncthing restarted
  45. - name: Environment file installed
  46. template:
  47. src: envrc.j2
  48. dest: /usr/local/src/mathesar/.envrc
  49. mode: 0600
  50. tags:
  51. - deploy
  52. - name: Allow environment file
  53. shell:
  54. cmd: direnv allow
  55. chdir: /usr/local/src/mathesar
  56. tags:
  57. - deploy
  58. - name: Requirements up to date
  59. pip:
  60. requirements: /usr/local/src/mathesar/requirements.txt
  61. executable: pip
  62. tags:
  63. - deploy
  64. - name: Migrations up to date
  65. command: bash -lc "direnv exec /usr/local/src/mathesar /usr/local/bin/python3.8 /usr/local/src/mathesar/manage.py migrate"
  66. tags:
  67. - deploy
  68. - name: Install base tables
  69. command: bash -lc "direnv exec /usr/local/src/mathesar /usr/local/bin/python3.8 /usr/local/src/mathesar/install.py"
  70. tags:
  71. - deploy
  72. - name: Frontend files generated and copied
  73. command: bash -lc "direnv exec /usr/local/src/mathesar/usr/local/bin/npm install"
  74. args:
  75. chdir: "/usr/local/src/mathesar"
  76. tags:
  77. - deploy
  78. - never
  79. - name: API supervisor file installed
  80. copy:
  81. src: mathesar-api-supervisor.conf
  82. dest: /usr/local/etc/supervisor/conf.d/mathesar-api.conf
  83. owner: root
  84. mode: 0644
  85. notify: Supervisor restarted
  86. - name: UI supervisor file installed
  87. copy:
  88. src: mathesar-ui-supervisor.conf
  89. dest: /usr/local/etc/supervisor/conf.d/mathesar-ui.conf
  90. owner: root
  91. mode: 0644
  92. notify: Supervisor restarted