Deploy default policy files

At the moment our role does not account for provisionment of default
policy files for extra dashboards.

While they should not be required, it has been reported that absence
of such policy files results in unexpected behaviour. So let's symlink them
alike to how we do with regular policies.

Closes-Bug: #2055415
Change-Id: I683c12938fd4aa67304f564678514bc48bd86a79
This commit is contained in:
Dmitriy Rabotyagov 2024-03-01 13:43:16 +01:00
parent 85801c9d10
commit 53178fbeea

View File

@ -51,6 +51,21 @@
use_regex: yes
register: found_panels
- name: Registering default 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 + '/default_policies') %}
{% endfor %}
{% endfor %}
{{ policy_path }}
patterns: ['^.*\.(json|yaml)$']
file_type: file
use_regex: yes
register: found_default_policy
- name: Registering policy files
find:
paths: |-
@ -66,6 +81,15 @@
use_regex: yes
register: found_policy
- name: Link default policy files
file:
src: "{{ item.path }}"
dest: "{{ horizon_lib_dir }}/openstack_dashboard/conf/default_policies/{{ item.path | basename }}"
state: link
with_items: "{{ found_default_policy.files }}"
notify:
- Compile messages
- name: Link policy files
file:
src: "{{ item.path }}"