From fb53d3c1a9ebd323558ef05732f5a343c39e7ce7 Mon Sep 17 00:00:00 2001 From: Robert Starmer Date: Tue, 12 Jun 2012 05:36:32 +0000 Subject: [PATCH 1/2] added enhancements to the template to support swift and quantum, and added tags and templates for app, compute, and storage monitoring callouts --- deployment/puppet/horizon/manifests/init.pp | 29 ++++++++++++++++++- .../horizon/templates/local_settings.py.erb | 22 ++++++++++---- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/deployment/puppet/horizon/manifests/init.pp b/deployment/puppet/horizon/manifests/init.pp index f0ccc28405..22f49fa632 100644 --- a/deployment/puppet/horizon/manifests/init.pp +++ b/deployment/puppet/horizon/manifests/init.pp @@ -1,13 +1,40 @@ # # installs a horizon server # +# +# - Parameters +# $cache_server_ip memcached ip address (or VIP) +# $cache_server_port memcached port +# $swift (bool) is swift installed +# $quantum (bool) is quantum installed +# $app_mon [] array of ['Alert_App_Name','http://alert_app_ip:port'] +# $comp_mon [] array of ['Compute_Mon_App_Name','http://compute_mon_app_ip:port'] +# $stor_mon [] array of ['Stor_Mon_App_Name','http://stor_mon_app_ip:port'] +# class horizon( $cache_server_ip = '127.0.0.1', - $cache_server_port = '11211' + $cache_server_port = '11211', + $swift = false, + $quantum = false, + $app_mon = undef, + $comp_mon = undef, + $stor_mon = undef, ) { include horizon::params + if $alert_mon { + $monitoring = true + } + elsif $compute_mon { + $monitoring = true + } + elsif $stor_mon { + $monitoring = true + } else { + $monitoring = false + } + if $cache_server_ip =~ /^127\.0\.0\.1/ { Class['memcached'] -> Class['horizon'] } diff --git a/deployment/puppet/horizon/templates/local_settings.py.erb b/deployment/puppet/horizon/templates/local_settings.py.erb index 9741188fdd..a0eeba75e8 100644 --- a/deployment/puppet/horizon/templates/local_settings.py.erb +++ b/deployment/puppet/horizon/templates/local_settings.py.erb @@ -62,16 +62,28 @@ OPENSTACK_KEYSTONE_BACKEND = { # external to the OpenStack environment. The default is 'internalURL'. #OPENSTACK_ENDPOINT_TYPE = "publicURL" +<% if swift -%> +# Include the SWIFT interface extension in Horizon +SWIFT_ENABLED = True +<% end -%> + # The number of Swift containers and objects to display on a single page before # providing a paging element (a "more" link) to paginate results. API_RESULT_LIMIT = 1000 -# If you have external monitoring links, eg: -# EXTERNAL_MONITORING = [ -# ['Nagios','http://foo.com'], -# ['Ganglia','http://bar.com'], -# ] +<% if quantum -%> +# Include the Quantum interface extensions in Horizon +QUANTUM_ENABLED = True +<% end -%> +<% if monitoring -%> +# If you have external monitoring links, eg: +EXTERNAL_MONITORING = [ + <% if app_mon -%><%= app_mon %>,<% end %> + <% if comp_mon -%><%= comp_mon %>,<% end %> + <% if stor_mon -%><%= stor_mon %>,<% end %> +] +<% end -%> LOGGING = { 'version': 1, # When set to True this will disable all logging except From ffb491f1d5889508631ce246424990e497406fc0 Mon Sep 17 00:00:00 2001 From: Robert Starmer Date: Tue, 12 Jun 2012 07:38:54 +0000 Subject: [PATCH 2/2] Fixed comments on pull. --- deployment/puppet/horizon/manifests/init.pp | 23 ++++--------------- .../horizon/templates/local_settings.py.erb | 8 +------ 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/deployment/puppet/horizon/manifests/init.pp b/deployment/puppet/horizon/manifests/init.pp index 22f49fa632..7354fa74ea 100644 --- a/deployment/puppet/horizon/manifests/init.pp +++ b/deployment/puppet/horizon/manifests/init.pp @@ -7,34 +7,21 @@ # $cache_server_port memcached port # $swift (bool) is swift installed # $quantum (bool) is quantum installed -# $app_mon [] array of ['Alert_App_Name','http://alert_app_ip:port'] -# $comp_mon [] array of ['Compute_Mon_App_Name','http://compute_mon_app_ip:port'] -# $stor_mon [] array of ['Stor_Mon_App_Name','http://stor_mon_app_ip:port'] +# The next is an array of arrays, that can be used to add call-out links to the dashboard for other apps. +# There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose. +# Each app is defined in two parts, the display name, and the URI +# [horizon_app_links] array as in '[ ["Nagios","http://nagios_addr:port/path"],["Ganglia","http://ganglia_addr"] ]' # class horizon( $cache_server_ip = '127.0.0.1', $cache_server_port = '11211', $swift = false, $quantum = false, - $app_mon = undef, - $comp_mon = undef, - $stor_mon = undef, + $horizon_app_links = false, ) { include horizon::params - if $alert_mon { - $monitoring = true - } - elsif $compute_mon { - $monitoring = true - } - elsif $stor_mon { - $monitoring = true - } else { - $monitoring = false - } - if $cache_server_ip =~ /^127\.0\.0\.1/ { Class['memcached'] -> Class['horizon'] } diff --git a/deployment/puppet/horizon/templates/local_settings.py.erb b/deployment/puppet/horizon/templates/local_settings.py.erb index a0eeba75e8..bcee481d69 100644 --- a/deployment/puppet/horizon/templates/local_settings.py.erb +++ b/deployment/puppet/horizon/templates/local_settings.py.erb @@ -76,14 +76,8 @@ API_RESULT_LIMIT = 1000 QUANTUM_ENABLED = True <% end -%> -<% if monitoring -%> # If you have external monitoring links, eg: -EXTERNAL_MONITORING = [ - <% if app_mon -%><%= app_mon %>,<% end %> - <% if comp_mon -%><%= comp_mon %>,<% end %> - <% if stor_mon -%><%= stor_mon %>,<% end %> -] -<% end -%> +EXTERNAL_MONITORING = <% if horizon_app_links %><%= horizon_app_links %>,<% else %>[ ]<% end %> LOGGING = { 'version': 1, # When set to True this will disable all logging except