summaryrefslogtreecommitdiffstats
path: root/manifests/profile/base/neutron/opendaylight.pp
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-17 21:46:57 +0000
committerGerrit Code Review <review@openstack.org>2017-03-17 21:46:57 +0000
commit02f5102eeb2600068c7561b156bf00a8eeed5bd0 (patch)
treed7d11a4152b88e92ad851d02dbcd7a2e8cffe083 /manifests/profile/base/neutron/opendaylight.pp
parente44f838deeeb9468edf93a3781e754272e1897e2 (diff)
parent0cec9b6f4936a056573a69257095fd56b69a816f (diff)
Merge "Enables OpenDaylight Clustering in HA deployments"
Diffstat (limited to 'manifests/profile/base/neutron/opendaylight.pp')
-rw-r--r--manifests/profile/base/neutron/opendaylight.pp30
1 files changed, 23 insertions, 7 deletions
diff --git a/manifests/profile/base/neutron/opendaylight.pp b/manifests/profile/base/neutron/opendaylight.pp
index 556fe63..b5e6d11 100644
--- a/manifests/profile/base/neutron/opendaylight.pp
+++ b/manifests/profile/base/neutron/opendaylight.pp
@@ -22,19 +22,35 @@
# (Optional) The current step of the deployment
# Defaults to hiera('step')
#
-# [*primary_node*]
-# (Optional) The hostname of the first node of this role type
-# Defaults to hiera('bootstrap_nodeid', undef)
+# [*odl_api_ips*]
+# (Optional) List of OpenStack Controller IPs for ODL API
+# Defaults to hiera('opendaylight_api_node_ips')
+#
+# [*node_name*]
+# (Optional) The short hostname of node
+# Defaults to hiera('bootstack_nodeid')
#
class tripleo::profile::base::neutron::opendaylight (
$step = hiera('step'),
- $primary_node = hiera('bootstrap_nodeid', undef),
+ $odl_api_ips = hiera('opendaylight_api_node_ips'),
+ $node_name = hiera('bootstack_nodeid')
) {
if $step >= 1 {
- # Configure ODL only on first node of the role where this service is
- # applied
- if $primary_node == downcase($::hostname) {
+ validate_array($odl_api_ips)
+ if empty($odl_api_ips) {
+ fail('No IPs assigned to OpenDaylight Api Service')
+ } elsif size($odl_api_ips) == 2 {
+ fail('2 node OpenDaylight deployments are unsupported. Use 1 or greater than 2')
+ } elsif size($odl_api_ips) > 2 {
+ $node_string = split($node_name, '-')
+ $ha_node_index = $node_string[-1] + 1
+ class { '::opendaylight':
+ enable_ha => true,
+ ha_node_ips => $odl_api_ips,
+ ha_node_index => $ha_node_index,
+ }
+ } else {
include ::opendaylight
}
}