| 1234567891011121314151617181920212223242526272829303132333435 |
- - name: Create nginx logs folder
- become: true
- ansible.builtin.file:
- path: "{{ app_deploy_target | dirname }}/logs/nginx"
- state: directory
- owner: www-data
- mode: "0755"
- - name: Upload nginx-fpm.sh
- become: true
- ansible.builtin.template:
- src: fpm.conf.j2
- dest: /etc/nginx/sites-enabled/php-fpm-{{ app_php_fpm_port }}.conf
- mode: "0644"
- force: false
- - name: Upload nginx.conf
- become: true
- ansible.builtin.template:
- src: nginx.conf.j2
- dest: /etc/nginx/sites-enabled/{{ app_domain }}.conf
- mode: "0644"
- force: false
- - name: Set document root
- become: true
- ansible.builtin.shell: sed -i '5s#.*#root {{ app_deploy_target }}/api-v8/public;#' /etc/nginx/sites-enabled/{{ app_domain }}.conf
- - name: Set dashboard alias
- become: true
- ansible.builtin.shell: sed -i '25s#.*#alias {{ app_deploy_target }}/dashboard-v4/dashboard/dist/;#' /etc/nginx/sites-enabled/{{ app_domain }}.conf
- - name: Reload nginx.conf
- become: true
- ansible.builtin.shell: nginx -s reload
|