Skip to content

Commit

Permalink
Closes-Bug: #1611599
Browse files Browse the repository at this point in the history
keepalived version is applicable to ubuntu only, use available keepalived version in repo.
zookeeper id should be in dataDir -/var/lib/zookeeper folder.

Change-Id: Ifae141f08e2764de79d130c38504d49880a305ac
  • Loading branch information
kamleshp committed Aug 10, 2016
1 parent 7412141 commit c565b34
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
Expand Up @@ -26,6 +26,12 @@
}
}

if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$zk_myid_file = '/var/lib/zookeeper/myid'
} else {
$zk_myid_file = '/etc/zookeeper/conf/myid'
}

# set database_index
$tmp_index = inline_template('<%= @database_ip_list.index(@host_control_ip) %>')
if ($tmp_index == undef) {
Expand Down Expand Up @@ -130,7 +136,8 @@
content => template("${module_name}/zoo.cfg.erb"),
} ->
class {'::contrail::database::new_config_zk_files_setup':
database_index => $database_index
database_index => $database_index,
zk_myid_file => $zk_myid_file
} ->
contrail_database_nodemgr_config {
'DEFAULT/hostip': value => $host_control_ip;
Expand Down Expand Up @@ -164,7 +171,7 @@
target => '/lib/init/upstart-job',
} ->
File ['/etc/zookeeper/conf/log4j.properties'] -> File ['/etc/zookeeper/conf/environment'] ->
File ['/etc/zookeeper/conf/myid'] ~> Service['zookeeper']
File [$zk_myid_file] ~> Service['zookeeper']
}
contain ::contrail::database::config_cassandra
contain ::contrail::database::new_config_zk_files_setup
Expand Down
@@ -1,6 +1,7 @@
class contrail::database::new_config_zk_files_setup (
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$database_index = 1
$database_index = 1,
$zk_myid_file = '/etc/zookeeper/conf/myid'
) {
# set high session timeout to survive glance led disk activity
$zk_cfg = { 'zk_cfg' =>
Expand All @@ -21,7 +22,7 @@
settings_hash => { 'log4j.appender.ROLLINGFILE.MaxBackupIndex' => "11",},
lens_to_use => 'properties.lns',
} ->
file {'/etc/zookeeper/conf/myid':
file { $zk_myid_file :
ensure => present,
mode => '0755',
content => "${database_index}",
Expand All @@ -38,7 +39,7 @@
line => "ZOO_LOG4J_PROP=\"INFO,CONSOLE,ROLLINGFILE\"",
match => 'ZOO_LOG4J_PROP=.*$',
} ->
File['/etc/zookeeper/conf/myid']
File[$zk_myid_file]
}
'Centos', 'Fedora' : {
Contrail::Lib::Augeas_conf_set['log4j.appender.ROLLINGFILE.MaxBackupIndex'] ->
Expand All @@ -49,7 +50,7 @@
path => '/etc/zookeeper/zookeeper-env.sh',
line => 'export ZOO_LOG4J_PROP=\"INFO,CONSOLE,ROLLINGFILE\"',
} ->
File['/etc/zookeeper/conf/myid']
File[$zk_myid_file]
}
}
}
Expand Up @@ -65,5 +65,19 @@
track_script => ["check_haproxy_${name}","check_peers_${name}"],
} ->
Class['::keepalived']

# for contrail HA, use correct keepalived version for centos
if ($lsbdistrelease == "14.04") {
$pkg_ensure = '1.2.13-0~276~ubuntu14.04.1'
} elif ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$pkg_ensure = 'present'
} else {
$pkg_ensure = '1:1.2.13-1~bpo70+1'
}

class { '::keepalived' :
pkg_ensure => $pkg_ensure
}

contain ::keepalived
}
7 changes: 0 additions & 7 deletions contrail/environment/modules/keepalived/manifests/params.pp
Expand Up @@ -2,13 +2,6 @@
#
class keepalived::params {


if ($lsbdistrelease == "14.04") {
$pkg_ensure = '1.2.13-0~276~ubuntu14.04.1'
} else {
$pkg_ensure = '1:1.2.13-1~bpo70+1'
}

$service_enable = true
$service_ensure = 'running'
$service_manage = true
Expand Down

0 comments on commit c565b34

Please sign in to comment.