Add panko service support
authorPradeep Kilambi <pkilambi@redhat.com>
Thu, 10 Nov 2016 21:41:32 +0000 (16:41 -0500)
committerPradeep Kilambi <pkilambi@redhat.com>
Mon, 14 Nov 2016 15:57:14 +0000 (10:57 -0500)
Change-Id: I35f283bdf8dd0ed979c65633724f0464695130a4

manifests/haproxy.pp
manifests/profile/base/database/mysql.pp
manifests/profile/base/keystone.pp
manifests/profile/base/panko.pp [new file with mode: 0644]
manifests/profile/base/panko/api.pp [new file with mode: 0644]

index 4d96e98..c0084be 100644 (file)
 #  (optional) Enable or not Aodh API binding
 #  Defaults to hiera('aodh_api_enabled', false)
 #
+# [*panko*]
+#  (optional) Enable or not Panko API binding
+#  Defaults to hiera('panko_api_enabled', false)
+#
 # [*barbican*]
 #  (optional) Enable or not Barbican API binding
 #  Defaults to hiera('barbican_api_enabled', false)
 #  (optional) Specify the network opendaylight is running on.
 #  Defaults to hiera('opendaylight_api_network', undef)
 #
+# [*panko_network*]
+#  (optional) Specify the network panko is running on.
+#  Defaults to hiera('panko_api_network', undef)
+#
 # [*sahara_network*]
 #  (optional) Specify the network sahara is running on.
 #  Defaults to hiera('sahara_api_network', undef)
 #    'nova_metadata_port' (Defaults to 8775)
 #    'nova_novnc_port' (Defaults to 6080)
 #    'nova_novnc_ssl_port' (Defaults to 13080)
+#    'panko_api_port' (Defaults to 8779)
+#    'panko_api_ssl_port' (Defaults to 13779)
 #    'sahara_api_port' (Defaults to 8386)
 #    'sahara_api_ssl_port' (Defaults to 13386)
 #    'swift_proxy_port' (Defaults to 8080)
@@ -482,6 +492,7 @@ class tripleo::haproxy (
   $nova_novncproxy             = hiera('nova_vnc_proxy_enabled', false),
   $ceilometer                  = hiera('ceilometer_api_enabled', false),
   $aodh                        = hiera('aodh_api_enabled', false),
+  $panko                       = hiera('panko_api_enabled', false),
   $barbican                    = hiera('barbican_api_enabled', false),
   $gnocchi                     = hiera('gnocchi_api_enabled', false),
   $mistral                     = hiera('mistral_api_enabled', false),
@@ -527,6 +538,7 @@ class tripleo::haproxy (
   $nova_metadata_network       = hiera('nova_api_network', undef),
   $nova_novncproxy_network     = hiera('nova_vnc_proxy_network', undef),
   $nova_osapi_network          = hiera('nova_api_network', undef),
+  $panko_network               = hiera('panko_api_network', undef),
   $sahara_network              = hiera('sahara_api_network', undef),
   $swift_proxy_server_network  = hiera('swift_proxy_network', undef),
   $trove_network               = hiera('trove_api_network', undef),
@@ -574,6 +586,8 @@ class tripleo::haproxy (
     nova_metadata_port => 8775,
     nova_novnc_port => 6080,
     nova_novnc_ssl_port => 13080,
+    panko_api_port => 8779,
+    panko_api_ssl_port => 13779,
     sahara_api_port => 8386,
     sahara_api_ssl_port => 13386,
     swift_proxy_port => 8080,
@@ -963,6 +977,24 @@ class tripleo::haproxy (
     }
   }
 
+  if $panko {
+    ::tripleo::haproxy::endpoint { 'panko':
+      public_virtual_ip => $public_virtual_ip,
+      internal_ip       => hiera('panko_api_vip', $controller_virtual_ip),
+      service_port      => $ports[panko_api_port],
+      ip_addresses      => hiera('panko_api_node_ips', $controller_hosts_real),
+      server_names      => hiera('panko_api_node_names', $controller_hosts_names_real),
+      listen_options    => {
+          'http-request' => [
+            'set-header X-Forwarded-Proto https if { ssl_fc }',
+            'set-header X-Forwarded-Proto http if !{ ssl_fc }'],
+      },
+      public_ssl_port   => $ports[panko_api_ssl_port],
+      service_network   => $panko_network,
+      member_options    => union($haproxy_member_options, $internal_tls_member_options),
+    }
+  }
+
   if $barbican {
     ::tripleo::haproxy::endpoint { 'barbican':
       public_virtual_ip => $public_virtual_ip,
index 9da1456..8bef7c4 100644 (file)
@@ -143,6 +143,9 @@ class tripleo::profile::base::database::mysql (
     if hiera('trove_api_enabled', false) {
       include ::trove::db::mysql
     }
+    if hiera('panko_api_enabled', false) {
+      include ::panko::db::mysql
+    }
   }
 
 }
index 9801eb2..e72798d 100644 (file)
@@ -237,6 +237,9 @@ class tripleo::profile::base::keystone (
     if hiera('nova_api_enabled', false) {
       include ::nova::keystone::auth
     }
+    if hiera('panko_api_enabled', false) {
+      include ::panko::keystone::auth
+    }
     if hiera('sahara_api_enabled', false) {
       include ::sahara::keystone::auth
     }
diff --git a/manifests/profile/base/panko.pp b/manifests/profile/base/panko.pp
new file mode 100644 (file)
index 0000000..4abed56
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::base::panko
+#
+# panko profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+#   (Optional) The current step in deployment. See tripleo-heat-templates
+#   for more details.
+#   Defaults to hiera('step')
+#
+# [*bootstrap_node*]
+#   (Optional) The hostname of the node responsible for bootstrapping tasks
+#   Defaults to hiera('bootstrap_nodeid')
+
+class tripleo::profile::base::panko (
+  $step           = hiera('step'),
+  $bootstrap_node = hiera('bootstrap_nodeid', undef),
+) {
+
+  if $::hostname == downcase($bootstrap_node) {
+    $sync_db = true
+  } else {
+    $sync_db = false
+  }
+
+  if $step >= 4 or ($step >= 3 and $sync_db) {
+    include ::panko
+    include ::panko::config
+    include ::panko::db::sync
+  }
+
+}
diff --git a/manifests/profile/base/panko/api.pp b/manifests/profile/base/panko/api.pp
new file mode 100644 (file)
index 0000000..32dfc38
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::base::panko::api
+#
+# Panko API profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+#   (Optional) The current step in deployment. See tripleo-heat-templates
+#   for more details.
+#   Defaults to hiera('step')
+#
+class tripleo::profile::base::panko::api (
+  $step = hiera('step'),
+) {
+  include ::tripleo::profile::base::panko
+
+  if $step >= 4 {
+    include ::panko::api
+    include ::panko::wsgi::apache
+  }
+}