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
138
139
140
141
142
143
144
145
|
# File 'manifests/dashboard.pp', line 77
class cloud::dashboard(
$ks_keystone_internal_host = $os_params::ks_keystone_internal_host,
$secret_key = $os_params::secret_key,
$horizon_port = $os_params::horizon_port,
$api_eth = $os_params::api_eth,
$servername = $::fqdn,
$listen_ssl = false,
$keystone_host = $os_params::ks_keystone_internal_host,
$keystone_proto = $os_params::ks_keystone_internal_proto,
$keystone_port = $os_params::ks_keystone_internal_port,
$debug = $os_params::debug,
$listen_ssl = false,
$horizon_cert = undef,
$horizon_key = undef,
$horizon_ca = undef,
) {
# We build the param needed for horizon class
$keystone_url = "${keystone_proto}://${keystone_host}:${keystone_port}/v2.0"
# Apache2 specific configuration
$vhost_extra_params = {
'add_listen' => true
}
ensure_resource('class', 'apache', {
default_vhost => false
})
class { 'horizon':
secret_key => $secret_key,
can_set_mount_point => 'False',
# fqdn can can be ambiguous since we use reverse DNS here,
# e.g: 127.0.0.1 instead of a public IP address.
# We force $api_eth to avoid this situation
fqdn => $api_eth,
servername => $servername,
bind_address => $api_eth,
swift => true,
keystone_url => $keystone_url,
cache_server_ip => false,
django_debug => $debug,
neutron_options => { 'enable_lb' => true },
listen_ssl => $listen_ssl,
horizon_cert => $horizon_cert,
horizon_key => $horizon_key,
horizon_ca => $horizon_ca,
vhost_extra_params => $vhost_extra_params
}
if ($::osfamily == 'Debian') {
# TODO(Gonéri): HACK to ensure Horizon can cache its files
$horizon_var_dir = ['/var/lib/openstack-dashboard/static/js','/var/lib/openstack-dashboard/static/css']
file {$horizon_var_dir:
ensure => directory,
owner => 'horizon',
group => 'horizon',
}
}
@@haproxy::balancermember{"${::fqdn}-horizon":
listening_service => 'horizon_cluster',
server_names => $::hostname,
ipaddresses => $api_eth,
ports => $horizon_port,
options => 'check inter 2000 rise 2 fall 5'
}
}
|