Place policy in correct folder

This patch registers the policy paths in a seperate task in order
to be able to place them in the correct folder, alongside the other
policy files so that Horizon can load properly.

Without this, the heat_policy.json file doesn't get linked in the
config location and the dashboard fails to load due to a missing
policy file.

Change-Id: Ic1e7e3ae5bb2f8d56602209c185a1ed025c0fdfa
This commit is contained in:
Mohammed Naser 2019-03-29 21:54:44 -04:00
parent 1eaba3aacb
commit 1f42417204

View File

@ -110,11 +110,35 @@
{% endfor %}
{% endfor %}
{{ dashboard_path }}
patterns: ["^(_[0-9]{2,4}_.*.py|.*_policy.json)$"]
patterns: ["^_[0-9]{2,4}_.*.py$"]
file_type: file
use_regex: yes
register: found_panels
- name: Registering policy files
find:
paths: |-
{% set policy_path = [] %}
{% for dashboard in found_dashboards.files %}
{% for path in _dashboard_panels_location %}
{% set _ = policy_path.append(dashboard.path + path) %}
{% endfor %}
{% endfor %}
{{ policy_path }}
patterns: ["^.*_policy.json$"]
file_type: file
use_regex: yes
register: found_policy
- name: Link policy files
file:
src: "{{ item.path }}"
dest: "{{ horizon_lib_dir }}/openstack_dashboard/conf/{{ item.path|basename }}"
state: link
with_items: "{{ found_policy.files }}"
notify:
- Compile messages
- name: Enable project panels
file:
src: "{{ item.path }}"