Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/nginx-http.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ http {
}

location /media/ {
alias /home/{{ vps_user }}/{{ project_name }}/media/;
alias {{ media_dir }}/;
}

location / {
Expand Down
12 changes: 11 additions & 1 deletion ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
vps_user: django
project_name: education-website
project_root: /home/{{ vps_user }}/{{ project_name }}
media_dir: /home/{{ vps_user }}/media
# NOTE: Updated to point to the canonical repo that now contains new management commands (e.g., dbdiag).
# Previously this pointed to https://github.com/AlphaOneLabs/education-website.git which lacked recent commits.
git_repo: "https://github.com/AlphaOneLabs/alphaonelabs-education-website.git"
Expand Down Expand Up @@ -306,12 +307,21 @@

- name: Ensure media directory exists and readable
file:
path: "{{ project_root }}/media"
path: "{{ media_dir }}"
state: directory
mode: '0755'
owner: "{{ vps_user }}"
group: "{{ vps_user }}"

- name: Symlink media directory
file:
src: "{{ media_dir }}"
dest: "{{ project_root }}/media"
state: link
owner: "{{ vps_user }}"
group: "{{ vps_user }}"
force: true

- name: Configure nginx
template:
src: nginx-http.conf.j2
Expand Down
Loading