1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
---
- name: Ensuring config directories exist
become: true
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
with_dict: "{{ horizon_services | select_services_enabled_and_mapped_to_host }}"
- name: Set empty custom policy
set_fact:
custom_policy: []
- include_tasks: policy_item.yml
vars:
project_name: "{{ item.name }}"
when: item.enabled | bool
with_items:
- { name: "ceilometer", enabled: "{{ enable_ceilometer_horizon_policy_file }}" }
- { name: "cinder", enabled: "{{ enable_cinder_horizon_policy_file }}" }
- { name: "cloudkitty", enabled: "{{ enable_horizon_cloudkitty }}" }
- { name: "designate", enabled: "{{ enable_horizon_designate }}" }
- { name: "glance", enabled: "{{ enable_glance_horizon_policy_file }}" }
- { name: "heat", enabled: "{{ enable_heat_horizon_policy_file }}" }
- { name: "ironic", enabled: "{{ enable_horizon_ironic }}" }
- { name: "keystone", enabled: "{{ enable_keystone_horizon_policy_file }}" }
- { name: "magnum", enabled: "{{ enable_horizon_magnum }}" }
- { name: "manila", enabled: "{{ enable_horizon_manila }}" }
- { name: "masakari", enabled: "{{ enable_horizon_masakari }}" }
- { name: "mistral", enabled: "{{ enable_horizon_mistral }}" }
- { name: "neutron", enabled: "{{ enable_neutron_horizon_policy_file }}" }
- { name: "nova", enabled: "{{ enable_nova_horizon_policy_file }}" }
- { name: "octavia", enabled: "{{ enable_horizon_octavia }}" }
- { name: "tacker", enabled: "{{ enable_horizon_tacker }}" }
- { name: "trove", enabled: "{{ enable_horizon_trove }}" }
- { name: "watcher", enabled: "{{ enable_horizon_watcher }}" }
- name: Copying over config.json files for services
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
template:
src: "horizon.json.j2"
dest: "{{ node_config_directory }}/horizon/config.json"
mode: "0660"
when: service | service_enabled_and_mapped_to_host
- name: Copying over horizon.conf
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/horizon.conf"
mode: "0660"
with_first_found:
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/horizon.conf"
- "{{ node_custom_config }}/horizon/horizon.conf"
- "horizon.conf.j2"
when:
- service | service_enabled_and_mapped_to_host
- horizon_wsgi_provider == "apache"
- name: "Configure uWSGI for Horizon"
include_role:
name: service-uwsgi-config
vars:
project_services: "{{ horizon_services }}"
service: "{{ project_services[service_name] }}"
service_name: "horizon"
service_uwsgi_config_http_port: "{{ horizon_listen_port }}"
service_uwsgi_config_module: "{{ service.wsgi }}"
service_uwsgi_config_tls_backend: "{{ horizon_enable_tls_backend | bool }}"
service_uwsgi_config_tls_cert: "/etc/horizon/certs/horizon-cert.pem"
service_uwsgi_config_tls_key: "/etc/horizon/certs/horizon-key.pem"
service_uwsgi_config_uid: "{{ 'horizon' if enable_haproxy | bool else 'root' }}"
when:
- service | service_enabled_and_mapped_to_host
- horizon_wsgi_provider == "uwsgi"
- name: Copying over kolla-settings.py
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/_9998-kolla-settings.py"
mode: "0660"
with_first_found:
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9998-kolla-settings.py"
- "{{ node_custom_config }}/horizon/_9998-kolla-settings.py"
- "_9998-kolla-settings.py.j2"
when: service | service_enabled_and_mapped_to_host
- name: Copying over custom-settings.py
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/_9999-custom-settings.py"
mode: "0660"
with_first_found:
- "{{ node_custom_config }}/horizon/{{ inventory_hostname }}/_9999-custom-settings.py"
- "{{ node_custom_config }}/horizon/_9999-custom-settings.py"
- "_9999-custom-settings.py.j2"
when: service | service_enabled_and_mapped_to_host
- name: Copying over existing policy file
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/horizon/{{ item | basename }}"
mode: "0660"
when: service | service_enabled_and_mapped_to_host
with_items: "{{ custom_policy }}"
- name: Copying over custom themes
become: true
vars:
service: "{{ horizon_services['horizon'] }}"
copy:
src: "{{ node_custom_config }}/horizon/themes/{{ item.name }}"
dest: "{{ node_config_directory }}/horizon/themes/"
mode: 0660
when:
- service | service_enabled_and_mapped_to_host
- horizon_custom_themes | length > 0
with_items: "{{ horizon_custom_themes }}"
- include_tasks: copy-certs.yml
when:
- horizon_copy_certs | bool
|