main.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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,py38-pip,fish,direnv,jpeg-turbo,tiff,webp,lcms2,freetype2,yarn-node16,cairo,pango,gmake,libxml2,libxslt,py38-psycopg2,py38-xmlsec,py38-cairocffi,py38-sqlite3,bash,py38-libcst, cmake, ninja
  6. state: latest
  7. - name: Tmux config installed
  8. copy:
  9. src: tmux.conf
  10. dest: /root/.tmux.conf
  11. mode: 0644
  12. - name: Github SSH key installed
  13. template:
  14. src: sshkey.j2
  15. dest: /root/.ssh/id_ed25519
  16. mode: 0400
  17. - name: Nginx location file installed
  18. copy:
  19. src: nginx-location.conf
  20. dest: /usr/local/etc/nginx/locations/fifteen5.conf
  21. mode: 0644
  22. notify: Nginx restarted
  23. - name: Source folder exists
  24. file:
  25. path: /usr/local/src
  26. mode: 0755
  27. state: directory
  28. - name: Create python bin link for yarn
  29. file:
  30. src: /usr/local/bin/python3.8
  31. dest: /usr/bin/python
  32. owner: root
  33. state: link
  34. - name: 15Five source deployed
  35. git:
  36. repo: "git@github.com:15five/fifteen5.git"
  37. dest: /usr/local/src/fifteen5
  38. accept_hostkey: yes
  39. update: yes
  40. ignore_errors: true
  41. tags:
  42. - deploy
  43. - name: Syncthing ignore file installed
  44. copy:
  45. src: stignore
  46. dest: /usr/local/src/fifteen5/.stignore
  47. mode: 0775
  48. - name: Syncthing running as root
  49. shell: sysrc syncthing_user="root"
  50. notify: Syncthing restarted
  51. - name: Environment file installed
  52. template:
  53. src: envrc.j2
  54. dest: /usr/local/src/fifteen5/.envrc
  55. mode: 0600
  56. tags:
  57. - deploy
  58. - name: Allow environment file
  59. shell:
  60. cmd: direnv allow
  61. chdir: /usr/local/src/fifteen5
  62. tags:
  63. - deploy
  64. - name: 15Five requirements up to date
  65. pip:
  66. requirements: /usr/local/src/fifteen5/requirements/test.pip
  67. executable: pip
  68. tags:
  69. - deploy
  70. - name: 15Five personal reqs up to date
  71. pip:
  72. name:
  73. - asciitree
  74. - colorlog
  75. - logging_tree
  76. - django-pdb
  77. - pgcli
  78. - ipython
  79. - python-json-logger
  80. - git+https://github.com/sureapp/sqlformatter#egg=sqlformatter
  81. - git+https://github.com/zensourcer/clearbit-python.git#egg=clearbit
  82. executable: pip
  83. tags:
  84. - deploy
  85. - name: 15Five migrations up to date
  86. command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 /usr/local/src/fifteen5/manage.py migrate"
  87. tags:
  88. - deploy
  89. - name: 15Five frontend files generated and copied
  90. command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/yarn"
  91. args:
  92. chdir: "/usr/local/src/fifteen5"
  93. tags:
  94. - deploy
  95. - name: 15Five frontend files generated
  96. command: bash -lc "direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 manage.py collectstatic --noinput && direnv exec /usr/local/src/fifteen5 /usr/local/bin/python3.8 manage.py collectstatic_js_reverse"
  97. args:
  98. chdir: "/usr/local/src/fifteen5"
  99. tags:
  100. - deploy
  101. - name: Fifteen5 uvicorn immortal file installed
  102. template:
  103. src: uvicorn-immortal.yml.j2
  104. dest: /usr/local/etc/immortal/fifteen5-uvicorn.yml
  105. owner: root
  106. mode: 0644
  107. notify: Immortal restarted
  108. - name: Fifteen5 celery immortal file installed
  109. template:
  110. src: celery-immortal.yml.j2
  111. dest: /usr/local/etc/immortal/fifteen5-celery.yml
  112. owner: root
  113. mode: 0644
  114. notify: Immortal restarted