aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/base')
-rw-r--r--manifests/profile/base/congress.pp86
-rw-r--r--manifests/profile/base/database/mysql.pp3
-rw-r--r--manifests/profile/base/keystone.pp3
-rw-r--r--manifests/profile/base/neutron.pp13
-rw-r--r--manifests/profile/base/neutron/server.pp81
5 files changed, 173 insertions, 13 deletions
diff --git a/manifests/profile/base/congress.pp b/manifests/profile/base/congress.pp
new file mode 100644
index 0000000..1731e81
--- /dev/null
+++ b/manifests/profile/base/congress.pp
@@ -0,0 +1,86 @@
+# 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::congress
+#
+# Congress server profile for tripleo
+#
+# === Parameters
+#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
+#
+# [*messaging_driver*]
+# Driver for messaging service.
+# Defaults to hiera('messaging_service_name', 'rabbit')
+#
+# [*messaging_hosts*]
+# list of the messaging host fqdns
+# Defaults to hiera('rabbitmq_node_names')
+#
+# [*messaging_password*]
+# Password for messaging congress queue
+# Defaults to hiera('congress::rabbit_password')
+#
+# [*messaging_port*]
+# IP port for messaging service
+# Defaults to hiera('congress::rabbit_port', 5672)
+#
+# [*messaging_username*]
+# Username for messaging congress queue
+# Defaults to hiera('congress::rabbit_userid', 'guest')
+#
+# [*messaging_use_ssl*]
+# Flag indicating ssl usage.
+# Defaults to hiera('congress::rabbit_use_ssl', '0')
+#
+# [*step*]
+# (Optional) The current step of the deployment
+# Defaults to hiera('step')
+
+class tripleo::profile::base::congress (
+ $bootstrap_node = hiera('bootstrap_nodeid', undef),
+ $messaging_driver = hiera('messaging_service_name', 'rabbit'),
+ $messaging_hosts = any2array(hiera('rabbitmq_node_names', undef)),
+ $messaging_password = hiera('congress::rabbit_password'),
+ $messaging_port = hiera('congress::rabbit_port', '5672'),
+ $messaging_username = hiera('congress::rabbit_userid', 'guest'),
+ $messaging_use_ssl = hiera('congress::rabbit_use_ssl', '0'),
+ $step = hiera('step'),
+) {
+ if $::hostname == downcase($bootstrap_node) {
+ $sync_db = true
+ } else {
+ $sync_db = false
+ }
+
+ if $step >= 4 or ($step >= 3 and $sync_db){
+ $messaging_use_ssl_real = sprintf('%s', bool2num(str2bool($messaging_use_ssl)))
+ class { '::congress':
+ sync_db => $sync_db,
+ default_transport_url => os_transport_url({
+ 'transport' => $messaging_driver,
+ 'hosts' => $messaging_hosts,
+ 'port' => sprintf('%s', $messaging_port),
+ 'username' => $messaging_username,
+ 'password' => $messaging_password,
+ 'ssl' => $messaging_use_ssl_real,
+ }),
+ }
+
+ include ::congress::server
+ include ::congress::db
+ }
+}
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp
index 6f93903..4ccfabc 100644
--- a/manifests/profile/base/database/mysql.pp
+++ b/manifests/profile/base/database/mysql.pp
@@ -151,6 +151,9 @@ class tripleo::profile::base::database::mysql (
if hiera('cinder_api_enabled', false) {
include ::cinder::db::mysql
}
+ if hiera('congress_enabled', false) {
+ include ::congress::db::mysql
+ }
if hiera('glance_api_enabled', false) {
include ::glance::db::mysql
}
diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp
index e84e22f..72049e3 100644
--- a/manifests/profile/base/keystone.pp
+++ b/manifests/profile/base/keystone.pp
@@ -209,6 +209,9 @@ class tripleo::profile::base::keystone (
if hiera('cinder_api_enabled', false) {
include ::cinder::keystone::auth
}
+ if hiera('congress_enabled', false) {
+ include ::congress::keystone::auth
+ }
if hiera('glance_api_enabled', false) {
include ::glance::keystone::auth
}
diff --git a/manifests/profile/base/neutron.pp b/manifests/profile/base/neutron.pp
index e6a32db..3de50c2 100644
--- a/manifests/profile/base/neutron.pp
+++ b/manifests/profile/base/neutron.pp
@@ -35,9 +35,22 @@ class tripleo::profile::base::neutron (
$rabbit_hosts = hiera('rabbitmq_node_names', undef),
$rabbit_port = hiera('neutron::rabbit_port', 5672),
) {
+
+ # TODO(jaosorior): Remove this when we pass it via t-h-t
+ if hiera('enable_internal_tls', false) {
+ $bind_host = 'localhost'
+ } else {
+ # This is executed in all of the nodes that use something neutron-related,
+ # so we set the defalut, since the bind_host is only available in the
+ # controllers. Either way, this will be removed and set properly via t-h-t
+ # in a subsequent commit.
+ $bind_host = hiera('neutron::bind_host', $::os_service_default)
+ }
+
if $step >= 3 {
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::neutron' :
+ bind_host => $bind_host,
rabbit_hosts => $rabbit_endpoints,
}
include ::neutron::config
diff --git a/manifests/profile/base/neutron/server.pp b/manifests/profile/base/neutron/server.pp
index fcd804d..5a98f66 100644
--- a/manifests/profile/base/neutron/server.pp
+++ b/manifests/profile/base/neutron/server.pp
@@ -22,10 +22,34 @@
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
-# [*step*]
-# (Optional) The current step in deployment. See tripleo-heat-templates
-# for more details.
-# Defaults to hiera('step')
+# [*certificates_specs*]
+# (Optional) The specifications to give to certmonger for the certificate(s)
+# it will create.
+# Example with hiera:
+# apache_certificates_specs:
+# httpd-internal_api:
+# hostname: <overcloud controller fqdn>
+# service_certificate: <service certificate path>
+# service_key: <service key path>
+# principal: "haproxy/<overcloud controller fqdn>"
+# Defaults to hiera('apache_certificate_specs', {}).
+#
+# [*dvr_enabled*]
+# (Optional) Is dvr enabled, used when no override is passed to
+# l3_ha_override to calculate enabling l3 HA.
+# Defaults to hiera('neutron::server::router_distributed') or false
+#
+# [*enable_internal_tls*]
+# (Optional) Whether TLS in the internal network is enabled or not.
+# Defaults to hiera('enable_internal_tls', false)
+#
+# [*generate_service_certificates*]
+# (Optional) Whether or not certmonger will generate certificates for
+# HAProxy. This could be as many as specified by the $certificates_specs
+# variable.
+# Note that this doesn't configure the certificates in haproxy, it merely
+# creates the certificates.
+# Defaults to hiera('generate_service_certificate', false).
#
# [*l3_ha_override*]
# (Optional) Override the calculated value for neutron::server::l3_ha
@@ -41,17 +65,31 @@
# (we need to default neutron_l3_short_node_names to an empty list
# because some neutron backends disable the l3 agent)
#
-# [*dvr_enabled*]
-# (Optional) Is dvr enabled, used when no override is passed to
-# l3_ha_override to calculate enabling l3 HA.
-# Defaults to hiera('neutron::server::router_distributed') or false
+# [*neutron_network*]
+# (Optional) The network name where the neutron endpoint is listening on.
+# This is set by t-h-t.
+# Defaults to hiera('neutron_api_network', undef)
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
class tripleo::profile::base::neutron::server (
- $bootstrap_node = hiera('bootstrap_nodeid', undef),
- $step = hiera('step'),
- $l3_ha_override = '',
- $l3_nodes = hiera('neutron_l3_short_node_names', []),
- $dvr_enabled = hiera('neutron::server::router_distributed', false)
+ $bootstrap_node = hiera('bootstrap_nodeid', undef),
+ $certificates_specs = hiera('apache_certificates_specs', {}),
+ $dvr_enabled = hiera('neutron::server::router_distributed', false),
+ $enable_internal_tls = hiera('enable_internal_tls', false),
+ $generate_service_certificates = hiera('generate_service_certificates', false),
+ $l3_ha_override = '',
+ $l3_nodes = hiera('neutron_l3_short_node_names', []),
+ $neutron_network = hiera('neutron_api_network', undef),
+ $step = hiera('step'),
) {
+ if $enable_internal_tls and $generate_service_certificates {
+ ensure_resources('tripleo::certmonger::httpd', $certificates_specs)
+ }
+
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
} else {
@@ -74,6 +112,23 @@ class tripleo::profile::base::neutron::server (
# it will try to populate tables and we need to make sure this happens
# before it starts on other nodes
if $step >= 4 and $sync_db or $step >= 5 and !$sync_db {
+ if $enable_internal_tls {
+ if !$neutron_network {
+ fail('neutron_api_network is not set in the hieradata.')
+ }
+ $tls_certfile = $certificates_specs["httpd-${neutron_network}"]['service_certificate']
+ $tls_keyfile = $certificates_specs["httpd-${neutron_network}"]['service_key']
+
+ ::tripleo::tls_proxy { 'neutron-api':
+ servername => hiera("fqdn_${neutron_network}"),
+ ip => hiera('neutron::bind_host'), # This will be cleaned out
+ port => 9696, # This will be cleaned out
+ tls_cert => $tls_certfile,
+ tls_key => $tls_keyfile,
+ notify => Class['::neutron::server'],
+ }
+ }
+
include ::neutron::server::notifications
# We need to override the hiera value neutron::server::sync_db which is set
# to true