From 92746f72ee1e5971fc5140bfdb11b155e5bc7e6d Mon Sep 17 00:00:00 2001 From: Illia Polliul Date: Thu, 29 Sep 2016 16:54:07 +0300 Subject: [PATCH] Fix for zookeeper id zookeeper id should be a value between 1 and 255. uid can be bigger than 255, so it should be calculated Change-Id: If1dcecde8f066b1e27b5c2f0331ee5dc0b0c0804 Closes-bug: #1622008 Signed-off-by: Illia Polliul --- .../puppet/modules/contrail/manifests/database.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deployment_scripts/puppet/modules/contrail/manifests/database.pp b/deployment_scripts/puppet/modules/contrail/manifests/database.pp index b5864b50d..5b47d69b8 100644 --- a/deployment_scripts/puppet/modules/contrail/manifests/database.pp +++ b/deployment_scripts/puppet/modules/contrail/manifests/database.pp @@ -33,15 +33,20 @@ class contrail::database { sysctl::value { 'vm.swappiness': value => '10' } + if roles_include($contrail::contrail_controller_roles) { $cassandra_ips = $::contrail::contrail_controller_ips $cassandra_seeds = $contrail::primary_contrail_controller_ip $cluster_name = 'Contrail' + $priv_ip = $::contrail::address + # Zookeeper - # Zookeeper + # this is a remanider from dividing by 255 + # + 1 is to avoid it being 0 if uid is a multiplicator of 255 + $zookeeper_id = $contrail::uid % 255 + 1 package { 'zookeeper': } -> file { '/etc/zookeeper/conf/myid': - content => $contrail::uid, + content => "${zookeeper_id}\n", require => Package['zookeeper'], }