151481fcc34b0958b13255335ab841e382abcfdf
[apex.git] / build / patches / disable_odl_clustering.patch
1 diff --git a/manifests/profile/base/neutron/opendaylight.pp b/manifests/profile/base/neutron/opendaylight.pp
2 index 3269f3e..556fe63 100644
3 --- a/manifests/profile/base/neutron/opendaylight.pp
4 +++ b/manifests/profile/base/neutron/opendaylight.pp
5 @@ -22,34 +22,19 @@
6  #   (Optional) The current step of the deployment
7  #   Defaults to hiera('step')
8  #
9 -# [*odl_api_ips*]
10 -#   (Optional) List of OpenStack Controller IPs for ODL API
11 -#   Defaults to hiera('opendaylight_api_node_ips')
12 -#
13 -# [*node_name*]
14 -#   (Optional) The short hostname of node
15 -#   Defaults to hiera('bootstack_nodeid')
16 +# [*primary_node*]
17 +#   (Optional) The hostname of the first node of this role type
18 +#   Defaults to hiera('bootstrap_nodeid', undef)
19  #
20  class tripleo::profile::base::neutron::opendaylight (
21    $step         = hiera('step'),
22 -  $odl_api_ips  = hiera('opendaylight_api_node_ips'),
23 -  $node_name    = hiera('bootstack_nodeid')
24 +  $primary_node = hiera('bootstrap_nodeid', undef),
25  ) {
26  
27    if $step >= 1 {
28 -    if empty($odl_api_ips) {
29 -      fail('No IPs assigned to OpenDaylight Api Service')
30 -    } elsif size($odl_api_ips) == 2 {
31 -      fail('2 node OpenDaylight deployments are unsupported.  Use 1 or greater than 2')
32 -    } elsif size($odl_api_ips) > 2 {
33 -      $node_string = split($node_name, '-')
34 -      $ha_node_index = $node_string[-1] + 1
35 -      class { '::opendaylight':
36 -        enable_ha     => true,
37 -        ha_node_ips   => $odl_api_ips,
38 -        ha_node_index => $ha_node_index,
39 -      }
40 -    } else {
41 +    # Configure ODL only on first node of the role where this service is
42 +    # applied
43 +    if $primary_node == downcase($::hostname) {
44        include ::opendaylight
45      }
46    }