Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
[ansible] Fix directory permissions before calling symfony tools
Browse files Browse the repository at this point in the history
  • Loading branch information
imphil committed Jan 5, 2021
1 parent dd4c4f4 commit 451c69c
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions ansible/roles/web/tasks/librecores-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@
chdir: /var/www/lc/site
when: env.NODE_ENV != 'production'

# run this last to ensure all deployment-created directories are covered
- name: Ensure directory permissions of Symfony log and cache directories
file:
path: "/var/www/lc/site/var/{{ item }}"
owner: "{{ web_user }}"
recurse: yes
with_items:
- logs
- cache
when: not is_vagrant_environment

- name: Clear symfony cache (production)
become: true
become_user: "{{ web_user }}"
Expand Down Expand Up @@ -225,17 +236,6 @@
- name: Reload systemd to pick up changes in unit files
command: systemctl daemon-reload

# run this last to ensure all deployment-created directories are covered
- name: Ensure directory permissions of Symfony log and cache directories
file:
path: "/var/www/lc/site/var/{{ item }}"
owner: "{{ web_user }}"
recurse: yes
with_items:
- logs
- cache
when: not is_vagrant_environment

# The services need to pick up the code changes by being restarted.
# Thanks to RabbitMQ we don't loose any messages in this case.
- name: Ensure RabbitMQ consumer services are restarted and enabled at boot
Expand All @@ -261,20 +261,28 @@
user: "{{ web_user }}"
job: "/var/www/lc/planet/generate.sh"

- name: Ensure directory permissions of planet cache directories
command: chown -R {{ web_user }} /var/www/lc/planet/cache
when: not is_vagrant_environment

- name: Ensure directory permissions of web-accessible planet output directory
command: chown -R {{ web_user }} /var/www/lc/site/web/planet
- name: Ensure directory permissions of planet directories
file:
path: "{{ item }}"
owner: "{{ web_user }}"
recurse: yes
with_items:
- /var/www/lc/site/web/planet
- /var/www/lc/planet/cache
when: not is_vagrant_environment


- name: ensure nginx is running (and enable it at boot)
service: name=nginx state=started enabled=yes
service:
name: nginx
state: started
enabled: yes

- name: ensure certbot.timer is running (and enable it at boot)
service: name=certbot.timer state=started enabled=yes
service:
name: certbot.timer
state: started
enabled: yes
when: use_https

- name: Restart all services (we need them from now on)
Expand Down

0 comments on commit 451c69c

Please sign in to comment.