2021-05-04 02:03:15 +09:00
|
|
|
# Configure the Horizon service
|
|
|
|
#
|
|
|
|
# [*heat_enabled*]
|
|
|
|
# (optional) Flag to enable heat dashboard
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2023-03-10 12:20:55 +09:00
|
|
|
# [*manila_enabled*]
|
|
|
|
# (optional) Flag to enable manila dashboard
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2023-11-14 00:04:32 +09:00
|
|
|
# [*ironic_enabled*]
|
|
|
|
# (optional) Flag to enable ironic dashboard
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2022-07-04 09:28:38 +09:00
|
|
|
# [*octavia_enabled*]
|
|
|
|
# (optional) Flag to enable octavia dashboard
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2021-05-04 02:03:15 +09:00
|
|
|
class openstack_integration::horizon (
|
2022-07-04 09:28:38 +09:00
|
|
|
$heat_enabled = false,
|
2023-03-10 12:20:55 +09:00
|
|
|
$manila_enabled = false,
|
2023-11-14 00:04:32 +09:00
|
|
|
$ironic_enabled = false,
|
2022-07-04 09:28:38 +09:00
|
|
|
$octavia_enabled = false,
|
2021-05-04 02:03:15 +09:00
|
|
|
) {
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
include openstack_integration::config
|
|
|
|
include openstack_integration::params
|
2016-03-30 15:55:40 -04:00
|
|
|
|
|
|
|
if $::openstack_integration::config::ssl {
|
|
|
|
file { '/etc/openstack-dashboard/ssl':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
selinux_ignore_defaults => true,
|
|
|
|
require => Package['horizon'],
|
|
|
|
}
|
|
|
|
file { '/etc/openstack-dashboard/ssl/private':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
selinux_ignore_defaults => true,
|
|
|
|
require => File['/etc/openstack-dashboard/ssl'],
|
2023-03-01 10:29:37 +09:00
|
|
|
before => File["/etc/openstack-dashboard/ssl/private/${facts['networking']['fqdn']}.pem"],
|
2016-03-30 15:55:40 -04:00
|
|
|
}
|
|
|
|
openstack_integration::ssl_key { 'horizon':
|
2023-03-01 10:29:37 +09:00
|
|
|
key_path => "/etc/openstack-dashboard/ssl/private/${facts['networking']['fqdn']}.pem",
|
2016-03-30 15:55:40 -04:00
|
|
|
key_owner => 'root',
|
|
|
|
require => File['/etc/openstack-dashboard/ssl/private'],
|
|
|
|
notify => Service['httpd'],
|
|
|
|
}
|
|
|
|
Exec['update-ca-certificates'] ~> Service['httpd']
|
|
|
|
}
|
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'horizon':
|
2023-09-12 16:59:57 +09:00
|
|
|
secret_key => 'big_secret',
|
|
|
|
cache_backend => 'django.core.cache.backends.memcached.PyMemcacheCache',
|
|
|
|
cache_server_ip => $::openstack_integration::config::host,
|
|
|
|
allowed_hosts => $::openstack_integration::config::ip_for_url,
|
|
|
|
listen_ssl => $::openstack_integration::config::ssl,
|
|
|
|
ssl_redirect => $::openstack_integration::config::ssl,
|
|
|
|
ssl_cert => $::openstack_integration::params::cert_path,
|
|
|
|
ssl_key => "/etc/openstack-dashboard/ssl/private/${facts['networking']['fqdn']}.pem",
|
|
|
|
ssl_ca => $::openstack_integration::params::ca_bundle_cert_path,
|
|
|
|
ssl_verify_client => 'optional',
|
|
|
|
enable_secure_proxy_ssl_header => $::openstack_integration::config::ssl,
|
|
|
|
secure_cookies => $::openstack_integration::config::ssl,
|
|
|
|
wsgi_processes => 2,
|
|
|
|
keystone_url => $::openstack_integration::config::keystone_auth_uri,
|
|
|
|
log_level => 'DEBUG',
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
|
|
|
|
2023-07-28 16:42:08 +09:00
|
|
|
# TODO(tkajinam) Debian/Ubuntu package does not install the policy files
|
|
|
|
# to /etc/openstack-dashboard
|
|
|
|
if $facts['os']['family'] == 'RedHat' {
|
|
|
|
include horizon::policy
|
|
|
|
}
|
|
|
|
|
2021-05-04 02:03:15 +09:00
|
|
|
if $heat_enabled {
|
|
|
|
class { 'horizon::dashboards::heat': }
|
|
|
|
}
|
2023-11-14 00:04:32 +09:00
|
|
|
if $ironic_enabled {
|
|
|
|
class { 'horizon::dashboards::ironic': }
|
|
|
|
}
|
2022-07-04 09:28:38 +09:00
|
|
|
if $octavia_enabled {
|
|
|
|
class { 'horizon::dashboards::octavia': }
|
|
|
|
}
|
2023-03-10 12:20:55 +09:00
|
|
|
if $manila_enabled {
|
|
|
|
class { 'horizon::dashboards::manila': }
|
|
|
|
}
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|