diff --git a/contrail/environment/modules/contrail/manifests/database/config.pp b/contrail/environment/modules/contrail/manifests/database/config.pp index 9e67c9df..07d9ef83 100644 --- a/contrail/environment/modules/contrail/manifests/database/config.pp +++ b/contrail/environment/modules/contrail/manifests/database/config.pp @@ -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) { @@ -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; @@ -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 diff --git a/contrail/environment/modules/contrail/manifests/database/new_config_zk_files_setup.pp b/contrail/environment/modules/contrail/manifests/database/new_config_zk_files_setup.pp index 05d4bfa8..86235d22 100644 --- a/contrail/environment/modules/contrail/manifests/database/new_config_zk_files_setup.pp +++ b/contrail/environment/modules/contrail/manifests/database/new_config_zk_files_setup.pp @@ -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' => @@ -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}", @@ -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'] -> @@ -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] } } } diff --git a/contrail/environment/modules/contrail/manifests/keepalived/keepalived.pp b/contrail/environment/modules/contrail/manifests/keepalived/keepalived.pp index ae74cb52..8dfc3bf3 100644 --- a/contrail/environment/modules/contrail/manifests/keepalived/keepalived.pp +++ b/contrail/environment/modules/contrail/manifests/keepalived/keepalived.pp @@ -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 } diff --git a/contrail/environment/modules/keepalived/manifests/params.pp b/contrail/environment/modules/keepalived/manifests/params.pp index d2f3dcb5..ec757243 100644 --- a/contrail/environment/modules/keepalived/manifests/params.pp +++ b/contrail/environment/modules/keepalived/manifests/params.pp @@ -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