Make enabling haproxy stats interface configurable
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Tue, 20 Jun 2017 15:50:12 +0000 (18:50 +0300)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Tue, 20 Jun 2017 15:50:12 +0000 (18:50 +0300)
Some people might or might not want to enable it. So this makes it
configurable. It defaults to true as we were always deploying it before.

Change-Id: I8d2a08cdaf3e5ec3d1a69d4f95e57522508c8610

manifests/haproxy.pp

index 6da6dcf..eefd29c 100644 (file)
 #  When set, enables SSL on the haproxy stats endpoint using the specified file.
 #  Defaults to undef
 #
+# [*haproxy_stats*]
+#  (optional) Enable or not the haproxy stats interface
+#  Defaults to true
+#
 # [*keystone_admin*]
 #  (optional) Enable or not Keystone Admin API binding
 #  Defaults to hiera('keystone_enabled', false)
@@ -571,6 +575,7 @@ class tripleo::haproxy (
   $ca_bundle                   = '/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt',
   $crl_file                    = undef,
   $haproxy_stats_certificate   = undef,
+  $haproxy_stats               = true,
   $keystone_admin              = hiera('keystone_enabled', false),
   $keystone_public             = hiera('keystone_enabled', false),
   $neutron                     = hiera('neutron_api_enabled', false),
@@ -871,19 +876,21 @@ class tripleo::haproxy (
     listen_options              => $default_listen_options,
   }
 
-  $stats_base = ['enable', 'uri /']
-  if $haproxy_stats_password {
-    $stats_config = union($stats_base, ["auth ${haproxy_stats_user}:${haproxy_stats_password}"])
-  } else {
-    $stats_config = $stats_base
-  }
-  haproxy::listen { 'haproxy.stats':
-    bind             => $haproxy_stats_bind_opts,
-    mode             => 'http',
-    options          => {
-      'stats' => $stats_config,
-    },
-    collect_exported => false,
+  if $haproxy_stats {
+    $stats_base = ['enable', 'uri /']
+    if $haproxy_stats_password {
+      $stats_config = union($stats_base, ["auth ${haproxy_stats_user}:${haproxy_stats_password}"])
+    } else {
+      $stats_config = $stats_base
+    }
+    haproxy::listen { 'haproxy.stats':
+      bind             => $haproxy_stats_bind_opts,
+      mode             => 'http',
+      options          => {
+        'stats' => $stats_config,
+      },
+      collect_exported => false,
+    }
   }
 
   if $keystone_admin {