diff --git a/tasks/horizon_post_install_source.yml b/tasks/horizon_post_install_source.yml index 777ea7d1..a0f11191 100644 --- a/tasks/horizon_post_install_source.yml +++ b/tasks/horizon_post_install_source.yml @@ -51,6 +51,21 @@ use_regex: yes register: found_panels +- name: Registering settings + find: + paths: |- + {% set dashboard_path = [] %} + {% for dashboard in found_dashboards.files %} + {% for path in _dashboard_settings_location %} + {% set _ = dashboard_path.append(dashboard.path + path) %} + {% endfor %} + {% endfor %} + {{ dashboard_path }} + patterns: ["^_[0-9]{2,4}_.*.py$"] + file_type: file + use_regex: yes + register: found_settings + - name: Registering default policy files find: paths: |- @@ -99,6 +114,16 @@ notify: - Compile messages +- name: Enable project settings + file: + src: "{{ item.path }}" + path: "{{ horizon_dashboard_settings_dir }}/{{ item.path | basename }}" + state: link + with_items: "{{ found_settings.files }}" + notify: + - Compile messages + - Restart wsgi process + - name: Enable project panels file: src: "{{ item.path }}" diff --git a/vars/main.yml b/vars/main.yml index 570e1729..34fb1752 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -39,6 +39,7 @@ _horizon_translations_pull: module: trove_dashboard horizon_dashboard_panel_dir: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled" +horizon_dashboard_settings_dir: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.d" horizon_manage: "{{ horizon_bin }}/horizon-manage.py" _horizon_uwsgi_ini_requirements: diff --git a/vars/source_install.yml b/vars/source_install.yml index ee0cdddb..43f8fcb9 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -27,6 +27,8 @@ _horizon_bin: "/openstack/venvs/horizon-{{ horizon_venv_tag }}/bin" _dashboard_panels_location: - "/enabled" - "/conf" - - "/local_settings.d" - "/local/enabled" + +_dashboard_settings_location: + - "/local_settings.d" - "/local/local_settings.d"