Execution
Date 14 Dec 2025 10:21:40 +0000
Duration 00:43:55.98
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.13.5
Summary
13 Hosts
2438 Tasks
2413 Results
107 Plays
511 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/openstack-ansible-os_horizon/tasks/horizon_post_install_source.yml

---
# 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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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
  ansible.builtin.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