Skip to content

Commit

Permalink
Merge "Closes-Bug: #161526 - To fix Centos config db separation"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Dec 13, 2016
2 parents 2ecd0c0 + 36de404 commit 6727342
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Expand Up @@ -12,6 +12,7 @@
$database_minimum_diskGB = $::contrail::params::database_minimum_diskGB,
$host_roles = $::contrail::params::host_roles,
$config_manage_db = $::contrail::params::config_manage_db,
$zookeeper_conf_dir = $::contrail::params::zookeeper_conf_dir,
) {
if (!('database' in $host_roles) and $config_manage_db == true) {
$database_ip_list_to_use = $config_ip_list
Expand All @@ -31,7 +32,7 @@
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
$zk_myid_file = '/var/lib/zookeeper/myid'
} else {
$zk_myid_file = '/etc/zookeeper/conf/myid'
$zk_myid_file = "${zookeeper_conf_dir}/myid"
}

# set database_index
Expand Down Expand Up @@ -85,7 +86,7 @@
contrail_cassandra_dir => $contrail_cassandra_dir,
cassandra_cluster_name => "\'ConfigContrail\'"
} ->
file { '/etc/zookeeper/conf/zoo.cfg':
file { "${zookeeper_conf_dir}/zoo.cfg":
ensure => present,
content => template("${module_name}/zoo.cfg.erb"),
} ->
Expand Down Expand Up @@ -143,12 +144,12 @@
# Below is temporary to work-around in Ubuntu as Service resource fails
# as upstart is not correctly linked to /etc/init.d/service-name
if ($::operatingsystem == 'Ubuntu') {
File['/etc/zookeeper/conf/zoo.cfg'] ->
File["${zookeeper_conf_dir}/zoo.cfg"] ->
file { '/etc/init.d/supervisord-contrail-database':
ensure => link,
target => '/lib/init/upstart-job',
} ->
File ['/etc/zookeeper/conf/log4j.properties'] -> File ['/etc/zookeeper/conf/environment'] ->
File ["${zookeeper_conf_dir}/log4j.properties"] -> File ["${zookeeper_conf_dir}/environment"] ->
File [$zk_myid_file] ~> Service['zookeeper']
}
contain ::contrail::config_cassandra
Expand Down
@@ -1,4 +1,6 @@
class contrail::config::database_service {
class contrail::config::database_service (
$zookeeper_conf_dir = $::contrail::params::zookeeper_conf_dir,
){
# enable zookeeper svc so that picked by systemctl
if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') {
exec {"chkconfig-zookeeper" :
Expand All @@ -11,7 +13,7 @@
service { 'zookeeper':
ensure => running,
enable => true,
subscribe => File['/etc/zookeeper/conf/zoo.cfg'],
subscribe => File["${zookeeper_conf_dir}/zoo.cfg"],
}
->
service { 'contrail-database' :
Expand Down

0 comments on commit 6727342

Please sign in to comment.