diff --git a/roles/projects/tasks/configure_site.yml b/roles/projects/tasks/configure_site.yml index 08855c8..0ce5dfb 100644 --- a/roles/projects/tasks/configure_site.yml +++ b/roles/projects/tasks/configure_site.yml @@ -1,5 +1,6 @@ --- # ------------------ VALIDATION TASKS ------------------ + - name: "Validate that project root '{{ project.project_root }}' exists" ansible.builtin.stat: path: "{{ project.project_root }}" @@ -41,7 +42,22 @@ Nginx requires an entry point file to serve the site. when: index_file_find.matched == 0 +# ------------------ PERMISSION FIX FOR LARAVEL ------------------ + +- name: "Check if 'storage' directory exists in project root" + ansible.builtin.stat: + path: "{{ project.project_root }}/storage" + register: storage_dir_stat + +- name: "Set full permissions (777) on 'storage' if it exists" + ansible.builtin.file: + path: "{{ project.project_root }}/storage" + mode: '0777' + recurse: yes + when: storage_dir_stat.stat.exists and storage_dir_stat.stat.isdir + # ------------------ CONFIGURATION TASKS ------------------ + - name: "Create Nginx config for {{ project.domain }} in conf.d" ansible.builtin.template: src: nginx-site.conf.j2