
In order to reduce divergance with ansible-lint rules, we apply auto-fixing of violations. In current patch we replace all kind of truthy variables with `true` or `false` values to align with recommendations along with alignment of used quotes. Change-Id: I5e295a9f62f347a9cf6ea8f812c5ebebe2a6c310
136 lines
4.1 KiB
YAML
136 lines
4.1 KiB
YAML
---
|
|
# Copyright 2021, City Network International AB
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
- name: Create static horizon dir
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: "directory"
|
|
owner: "{{ item.owner | default(horizon_system_user_name) }}"
|
|
group: "{{ item.group | default(horizon_system_group_name) }}"
|
|
mode: "{{ item.mode | default('0755') }}"
|
|
with_items:
|
|
- { path: "{{ horizon_lib_dir }}/static", mode: "2755" }
|
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard", mode: "2755" }
|
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local", mode: "2755" }
|
|
- { path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled", mode: "2755" }
|
|
|
|
- name: Registering dashboards
|
|
find:
|
|
paths: "{{ horizon_lib_dir }}"
|
|
patterns: "^.*(dashboard|ui)$"
|
|
file_type: directory
|
|
use_regex: true
|
|
excludes: "openstack_dashboard"
|
|
recurse: false
|
|
register: found_dashboards
|
|
|
|
- name: Registering panels
|
|
find:
|
|
paths: |-
|
|
{% set dashboard_path = [] %}
|
|
{% for dashboard in found_dashboards.files %}
|
|
{% for path in _dashboard_panels_location %}
|
|
{% set _ = dashboard_path.append(dashboard.path + path) %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
{{ dashboard_path }}
|
|
patterns: ["^_[0-9]{2,4}_.*.py$"]
|
|
file_type: file
|
|
use_regex: true
|
|
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: true
|
|
register: found_settings
|
|
|
|
- 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: true
|
|
register: found_default_policy
|
|
|
|
- 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|yaml)$"]
|
|
file_type: file
|
|
use_regex: true
|
|
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 }}"
|
|
dest: "{{ horizon_lib_dir }}/openstack_dashboard/conf/{{ item.path | basename }}"
|
|
state: link
|
|
with_items: "{{ found_policy.files }}"
|
|
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 }}"
|
|
path: "{{ horizon_dashboard_panel_dir }}/{{ item.path | basename }}"
|
|
state: link
|
|
with_items: "{{ found_panels.files }}"
|
|
notify:
|
|
- Compile messages
|
|
- Restart wsgi process
|