Files
puppet-openstack/manifests/horizon.pp
danehans f47b877daf Adds Support for Separating Memcached from Horizon
Previously, memcached would always be included in the
openstack::horizon class.  Additionally, the cache_server_ip
parameter was used concurrently by memcached and horizon classes.
This prevented users from 1. Using an existing memcached deployment
2. Binding memcached to a local address and having
Horizon use an external memcached server.

This change implements the configure_memcached and memcached_listen_ip
parameters.  configure_memcached allows users to enable/disable
the memcached class on an as-needed basis.  memcached_listen_ip allows
users to seperate the IP address used for binding memcached from the
address used by Horizon to access memcached.

configure_memcached defaults to 'true' and memcached_listen_ip
defaults to undef for backwards compatibility and to enable memcached
and have memcached use cache_server_ip for binding an IP.

Change-Id: I5e4f4b5786d5ce7da59004a6a55b675a6dd32541
2013-07-16 23:49:55 +00:00

104 lines
2.8 KiB
Puppet

#
# == Class: openstack::horizon
#
# Class to install / configure horizon.
# Will eventually include apache and ssl.
#
# NOTE: Will the inclusion of memcache be an issue?
# Such as if the server already has memcache installed?
# -jtopjian
#
# === Parameters
#
# [*secret_key*]
# (required) A secret key for a particular Django installation. This is used to provide cryptographic signing,
# and should be set to a unique, unpredictable value.
#
# [*configure_memcached*]
# (optional) Enable/disable the use of memcached with Horizon.
# Defaults to true.
#
# [*memcached_listen_ip*]
# (optional) The IP address for binding memcached.
# Defaults to undef.
#
# [*cache_server_ip*]
# (optional) Ip address where the memcache server is listening.
# Defaults to '127.0.0.1'.
#
# [*cache_server_port*]
# (optional) Port that memcache server listens on.
# Defaults to '11211'.
#
# [*horizon_app_links*]
# (optional) External Monitoring links.
# Defaults to undef.
#
# [*keystone_host*]
# (optional) Address of keystone host.
# Defaults to '127.0.0.1'.
#
# [*keystone_scheme*]
# (optional) Protocol for keystone. Accepts http or https.
# Defaults to http.
#
# [*keystone_default_role*]
# (Optional) Default role for keystone authentication.
# Defaults to 'Member'.
#
# [*django_debug*]
# (Optional) Sets Django debug level.
# Defaults to false.
#
# [*api_result_limit*]
# (Optional) Maximum results to show on a page before pagination kicks in.
# Defaults to 1000.
#
# === Examples
#
# class { 'openstack::horizon':
# secret_key => 'dummy_secret_key',
# }
#
class openstack::horizon (
$secret_key,
$configure_memcached = true,
$memcached_listen_ip = undef,
$cache_server_ip = '127.0.0.1',
$cache_server_port = '11211',
$horizon_app_links = undef,
$keystone_host = '127.0.0.1',
$keystone_scheme = 'http',
$keystone_default_role = 'Member',
$django_debug = 'False',
$api_result_limit = 1000
) {
if $configure_memcached {
if $memcached_listen_ip {
$cache_server_ip_real = $memcached_listen_ip
} else {
warning('The cache_server_ip parameter is deprecated. Use memcached_listen_ip instead.')
$cache_server_ip_real = $cache_server_ip
}
class { 'memcached':
listen_ip => $cache_server_ip_real,
tcp_port => $cache_server_port,
udp_port => $cache_server_port,
}
}
class { '::horizon':
cache_server_ip => $cache_server_ip,
cache_server_port => $cache_server_port,
secret_key => $secret_key,
horizon_app_links => $horizon_app_links,
keystone_host => $keystone_host,
keystone_scheme => $keystone_scheme,
keystone_default_role => $keystone_default_role,
django_debug => $django_debug,
api_result_limit => $api_result_limit,
}
}