main.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. - name: Creates directory
  2. become: true
  3. file:
  4. path: "/var/www/{{ inventory_hostname }}"
  5. state: directory
  6. owner: "{{ ansible_user }}"
  7. - name: Git checkout source code
  8. ansible.builtin.git:
  9. repo: 'https://github.com/iapt-platform/mint.git'
  10. dest: "{{ app_www_deploy_target }}"
  11. version: laravel
  12. - name: Install v2 php dependencies
  13. ansible.builtin.shell: composer install
  14. args:
  15. chdir: "{{ app_www_deploy_target }}"
  16. - name: Install v2 nodejs dependencies
  17. ansible.builtin.shell: npm install
  18. args:
  19. chdir: "{{ app_www_deploy_target }}"
  20. # TODO will remove in future
  21. - name: Install v1 php dependencies
  22. ansible.builtin.shell: composer install
  23. args:
  24. chdir: "{{ app_www_deploy_target }}/public"
  25. # TODO will remove in future
  26. - name: Install v1 nodejs dependencies
  27. ansible.builtin.shell: npm install
  28. args:
  29. chdir: "{{ app_www_deploy_target }}/public"
  30. - name: .env(v2)
  31. bacame: true
  32. ansible.builtin.template:
  33. src: env-v2.j2
  34. dest: "{{ app_www_deploy_target }}/.env"
  35. owner: www-data
  36. group: www-data
  37. mode: '0400'
  38. # TODO will remove in future
  39. - name: config.php(v1)
  40. bacame: true
  41. ansible.builtin.template:
  42. src: config-v1.php.j2
  43. dest: "{{ app_www_deploy_target }}/public/app/config.php"
  44. owner: www-data
  45. group: www-data
  46. mode: '0400'
  47. # TODO will remove in future
  48. - name: config.js(v1)
  49. bacame: true
  50. ansible.builtin.template:
  51. src: config-v1.js.j2
  52. dest: "{{ app_www_deploy_target }}/public/app/config.js"
  53. owner: www-data
  54. group: www-data
  55. mode: '0400'