From dfda6bc0788882de8abdfab9a0f2c2ef206115be Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Wed, 6 Jul 2016 11:28:25 -0400 Subject: [PATCH] Compress static files after customizations The previous behavior compressed files, then customized the horizon install. By doing this, static files in the customization modules were left out of the static collection/compression process. This change in ordering will now catch those files. Additionally, a notification is sent to the apache restart handler. Change-Id: I5c6678c2ef93b46f38cf94f19c9b2cf444411ea8 Closes-Bug: #1598146 --- ...mpress-customization-a7d03162d837085f.yaml | 5 ++++ tasks/horizon_post_install.yml | 25 ++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/compress-customization-a7d03162d837085f.yaml diff --git a/releasenotes/notes/compress-customization-a7d03162d837085f.yaml b/releasenotes/notes/compress-customization-a7d03162d837085f.yaml new file mode 100644 index 00000000..c0f9a97c --- /dev/null +++ b/releasenotes/notes/compress-customization-a7d03162d837085f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - The standard collectstatic and compression process in the os_horizon role + now happens after horizon customizations are installed, so that all static + resources will be collected and compressed. diff --git a/tasks/horizon_post_install.yml b/tasks/horizon_post_install.yml index d447a8bf..70df1480 100644 --- a/tasks/horizon_post_install.yml +++ b/tasks/horizon_post_install.yml @@ -77,18 +77,6 @@ tags: - horizon-configs -- name: Collect and compress static files - command: "{{ item }}" - become: yes - become_user: "{{ horizon_system_user_name }}" - with_items: - - "{{ horizon_bin }}/horizon-manage.py collectstatic --noinput" - - "{{ horizon_bin }}/horizon-manage.py compress --force" - tags: - - horizon-configs - - horizon-static-collect - - horizon-command-bin - - name: Setup Horizon config(s) template: src: "{{ item.src }}" @@ -124,3 +112,16 @@ when: horizon_customization_module is defined tags: - horizon-configs + +- name: Collect and compress static files + command: "{{ item }}" + become: yes + become_user: "{{ horizon_system_user_name }}" + with_items: + - "{{ horizon_bin }}/horizon-manage.py collectstatic --noinput" + - "{{ horizon_bin }}/horizon-manage.py compress --force" + notify: Restart apache2 + tags: + - horizon-configs + - horizon-static-collect + - horizon-command-bin