Enable Manila Service
authorRyan Hefner <ryan.hefner@netapp.com>
Tue, 21 Jul 2015 01:52:17 +0000 (21:52 -0400)
committerRyan Hefner <ryan.hefner@netapp.com>
Wed, 5 Aug 2015 14:08:10 +0000 (10:08 -0400)
Adds bindings to the Manila service for HAProxy.

Change-Id: I175d5b7e35a781d04452fc6aee610e8dca005419

manifests/loadbalancer.pp

index 99dd342..6797d9e 100644 (file)
 #  When set, enables SSL on the Cinder public API endpoint using the specified file.
 #  Defaults to undef
 #
+# [*manila_certificate*]
+#  Filename of an HAProxy-compatible certificate and key file
+#  When set, enables SSL on the Manila public API endpoint using the specified file.
+#  Defaults to undef
+#
 # [*glance_certificate*]
 #  Filename of an HAProxy-compatible certificate and key file
 #  When set, enables SSL on the Glance public API endpoint using the specified file.
 #  (optional) Enable or not Cinder API binding
 #  Defaults to false
 #
+# [*manila*]
+#  (optional) Enable or not Manila API binding
+#  Defaults to false
+#
 # [*glance_api*]
 #  (optional) Enable or not Glance API binding
 #  Defaults to false
@@ -244,6 +253,7 @@ class tripleo::loadbalancer (
   $keystone_certificate      = undef,
   $neutron_certificate       = undef,
   $cinder_certificate        = undef,
+  $manila_certificate        = undef,
   $glance_certificate        = undef,
   $nova_certificate          = undef,
   $ceilometer_certificate    = undef,
@@ -255,6 +265,7 @@ class tripleo::loadbalancer (
   $keystone_public           = false,
   $neutron                   = false,
   $cinder                    = false,
+  $manila                    = false,
   $glance_api                = false,
   $glance_registry           = false,
   $nova_ec2                  = false,
@@ -385,6 +396,11 @@ class tripleo::loadbalancer (
   } else {
     $cinder_bind_certificate = $service_certificate
   }
+  if $manila_certificate {
+    $manila_bind_certificate = $manila_certificate
+  } else {
+    $manila_bind_certificate = $service_certificate
+  }
   if $glance_certificate {
     $glance_bind_certificate = $glance_certificate
   } else {
@@ -469,6 +485,19 @@ class tripleo::loadbalancer (
     }
   }
 
+  $manila_api_vip = hiera('manila_api_vip', $controller_virtual_ip)
+  if $manila_bind_certificate {
+    $manila_bind_opts = {
+      "${manila_api_vip}:8786" => [],
+      "${public_virtual_ip}:13786" => ['ssl', 'crt', $manila_bind_certificate],
+    }
+  } else {
+    $manila_bind_opts = {
+      "${manila_api_vip}:8786" => [],
+      "${public_virtual_ip}:8786" => [],
+    }
+  }
+
   $glance_api_vip = hiera('glance_api_vip', $controller_virtual_ip)
   if $glance_bind_certificate {
     $glance_bind_opts = {
@@ -699,6 +728,23 @@ class tripleo::loadbalancer (
     }
   }
 
+  if manila {
+    haproxy::listen { 'manila':
+      bind             => $manila_bind_opts,
+      options          => {
+        'option' => [ 'httpchk GET /' ],
+      },
+      collect_exported => false,
+    }
+    haproxy::balancermember { 'manila':
+      listening_service => 'manila',
+      ports             => '8786',
+      ipaddresses       => hiera('manila_api_node_ips', $controller_hosts_real),
+      server_names      => $controller_hosts_names_real,
+      options           => ['check', 'inter 2000', 'rise 2', 'fall 5'],
+    }
+  }
+
   if $glance_api {
     haproxy::listen { 'glance_api':
       bind             => $glance_bind_opts,