diff --git a/roles/archwiki/handlers/main.yml b/roles/archwiki/handlers/main.yml index 93244fc490e63e8256fab92de0edce3a3f52c4bc..2ed6fa32bed6571b36567e5983605c3dea8d7afb 100644 --- a/roles/archwiki/handlers/main.yml +++ b/roles/archwiki/handlers/main.yml @@ -7,3 +7,11 @@ command: php {{ archwiki_dir }}/public/maintenance/update.php --quick become: true become_user: "{{ archwiki_user }}" + +# The nginx proxy/fastcgi cache can be cleared by simply deleting all files in +# the cache directory. It is important to keep the directory tree intact, +# otherwise nginx will spit errors into the log until it is restarted (even +# reload is not enough). +# reference: https://stackoverflow.com/a/6896903 +- name: purge nginx cache + command: find /var/lib/nginx/cache -type f -delete diff --git a/roles/archwiki/tasks/main.yml b/roles/archwiki/tasks/main.yml index 4ad76f501b36b6d0dddbafb9227d0a2e3ca0e9dc..df9a7925004f78417c4bafe3757d54a6fe3e469b 100644 --- a/roles/archwiki/tasks/main.yml +++ b/roles/archwiki/tasks/main.yml @@ -57,6 +57,8 @@ become_user: "{{ archwiki_user }}" notify: - run wiki updatescript + # purge the nginx cache to make sure clients get the updated assets + - purge nginx cache - name: configure archwiki template: src=LocalSettings.php.j2 dest="{{ archwiki_dir }}/public/LocalSettings.php" owner="{{ archwiki_user }}" group="{{ archwiki_user }}" mode=0640