262140d646
Change-Id: I754c07c2b963b5a4f105ba2144a44f7caaa5f155
182 lines
8.1 KiB
YAML
182 lines
8.1 KiB
YAML
---
|
|
# Copyright 2014, Rackspace US, Inc.
|
|
#
|
|
# 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: Setup Horizon config(s)
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: "{{ horizon_system_user_name }}"
|
|
group: "{{ horizon_system_group_name }}"
|
|
mode: "{{ item.mode }}"
|
|
with_items:
|
|
- { src: "horizon_local_settings.py.j2", dest: "/etc/horizon/local_settings.py", mode: "0644" }
|
|
- { src: "horizon-manage.py.j2", dest: "{{ horizon_bin }}/horizon-manage.py", mode: "0755" }
|
|
- { src: "80_admin_default_panel.py.j2", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_80_admin_default_panel.py", mode: "0755" }
|
|
notify: Restart apache2
|
|
|
|
- name: Uploading horizon custom files
|
|
copy:
|
|
src: "{{ item.value.src }}"
|
|
dest: "{{ horizon_lib_dir }}/openstack_dashboard/static/dashboard/{{ item.value.dest }}"
|
|
with_dict: "{{ horizon_custom_uploads | default({}) }}"
|
|
|
|
- name: Enable the designate-ui-dashboard Horizon panel
|
|
file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: "{{ horizon_enable_designate_ui | ternary('link', 'absent') }}"
|
|
with_items:
|
|
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1710_project_dns_panel_group.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1710_project_dns_panel_group.py"
|
|
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1720_project_dns_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1720_project_dns_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1721_dns_zones_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1721_dns_zones_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/designatedashboard/enabled/_1722_dns_reversedns_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1722_dns_reversedns_panel.py"
|
|
notify: Restart apache2
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Enable the ironic-ui-dashboard Horizon panel
|
|
file:
|
|
src: "{{ horizon_lib_dir }}/ironic_ui/enabled/_2200_ironic.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_2200_ironic.py"
|
|
state: "{{ horizon_enable_ironic_ui | ternary('link', 'absent') }}"
|
|
notify: Restart apache2
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Enable the magnum-ui-dashboard Horizon panel
|
|
file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: "{{ horizon_enable_magnum_ui | ternary('link', 'absent') }}"
|
|
notify: Restart apache2
|
|
with_items:
|
|
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1370_project_container_infra_panel_group.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1370_project_container_infra_panel_group.py"
|
|
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1371_project_container_infra_clusters_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1372_project_container_infra_cluster_templates_panel.py"
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Enable the sahara-dashboard Horizon panel
|
|
file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: "{{ horizon_enable_sahara_ui | ternary('link', 'absent') }}"
|
|
notify: Restart apache2
|
|
with_items:
|
|
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1810_data_processing_panel_group.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1810_data_processing_panel_group.py"
|
|
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1820_data_processing_clusters_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1820_data_processing_clusters_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/sahara_dashboard/enabled/_1840_data_processing_jobs_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1840_data_processing_jobs_panel.py"
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Enable the trove-dashboard Horizon panel
|
|
file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: "{{ horizon_enable_trove_ui | ternary('link', 'absent') }}"
|
|
notify: Restart apache2
|
|
with_items:
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1710_database_panel_group.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1710_database_panel_group.py"
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1720_project_databases_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1720_project_databases_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1730_project_database_backups_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1730_project_database_backups_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1731_project_database_backups_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1731_project_database_backups_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1740_project_database_clusters_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1740_project_database_clusters_panel.py"
|
|
- src: "{{ horizon_lib_dir }}/trove_dashboard/enabled/_1760_project_database_configurations_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/enabled/_1760_project_database_configurations_panel.py"
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Enable the neutron-lbaas-dashboard Horizon panel
|
|
file:
|
|
src: "{{ horizon_lib_dir }}/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py"
|
|
path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1481_project_ng_loadbalancersv2_panel.py"
|
|
state: "{{ (horizon_enable_neutron_lbaas | bool) | ternary('link', 'absent') }}"
|
|
notify: Restart apache2
|
|
|
|
- name: Create horizon links
|
|
file:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: "{{ horizon_system_user_name }}"
|
|
group: "{{ horizon_system_group_name }}"
|
|
state: "link"
|
|
with_items:
|
|
- { src: "/etc/horizon/local_settings.py", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.py" }
|
|
|
|
- name: Setup Horizon config(s)
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
owner: "{{ horizon_system_user_name }}"
|
|
group: "{{ horizon_system_group_name }}"
|
|
with_items:
|
|
- { src: "horizon_django.wsgi.j2", dest: "{{ horizon_lib_wsgi_file }}" }
|
|
notify: Restart apache2
|
|
|
|
- name: Create customization module directory
|
|
file:
|
|
path: "{{ horizon_lib_dir }}/horizon_customization"
|
|
state: directory
|
|
owner: "{{ horizon_system_user_name }}"
|
|
group: "{{ horizon_system_group_name }}"
|
|
mode: "0755"
|
|
when: horizon_customization_module is defined
|
|
|
|
- name: Drop horizon customization module
|
|
template:
|
|
src: "{{ horizon_customization_module }}"
|
|
dest: "{{ horizon_lib_dir }}/horizon_customization/__init__.py"
|
|
owner: "{{ horizon_system_user_name }}"
|
|
group: "{{ horizon_system_group_name }}"
|
|
mode: "0644"
|
|
notify: Restart apache2
|
|
when: horizon_customization_module is defined
|
|
|
|
- name: Compile messages for translation
|
|
command: "{{ horizon_bin }}/horizon-manage.py compilemessages"
|
|
args:
|
|
chdir: "{{ horizon_lib_dir }}/{{ item }}"
|
|
changed_when: false
|
|
with_items:
|
|
- horizon
|
|
- openstack_dashboard
|
|
tags:
|
|
- horizon-configs
|
|
|
|
- name: Collect and compress static files
|
|
command: "{{ item }}"
|
|
become: yes
|
|
become_user: "{{ horizon_system_user_name }}"
|
|
changed_when: false
|
|
with_items:
|
|
- "{{ horizon_bin }}/horizon-manage.py collectstatic --noinput"
|
|
- "{{ horizon_bin }}/horizon-manage.py compress --force"
|
|
notify: Restart apache2
|