From 3c14eb865d71cda33f6cb1ff637916570b121b34 Mon Sep 17 00:00:00 2001 From: nitishkrishna Date: Tue, 27 Sep 2016 15:28:06 -0700 Subject: [PATCH] Closes-Bug: #1602872 - User configured database dir not created if path doesn't exist for example: if user gives /var/lib/cassandra/data as database_dir, it won't be created as /var/lib/cassandra dir doesn't exist Change-Id: I346d0b2c20c549e368ebff52008297be9a5ca588 --- .../modules/contrail/manifests/database/config.pp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrail/environment/modules/contrail/manifests/database/config.pp b/contrail/environment/modules/contrail/manifests/database/config.pp index cee23330..3f03e32f 100644 --- a/contrail/environment/modules/contrail/manifests/database/config.pp +++ b/contrail/environment/modules/contrail/manifests/database/config.pp @@ -93,6 +93,12 @@ notify { "Database - zookeeper_ip_list = ${zookeeper_ip_list}":;} -> notify { "Database - database_index = ${database_index}":;} -> notify { "Database - cassandra_seeds = ${cassandra_seeds}":;} -> + exec {'Create database dir': + command => "mkdir -p ${database_dir}", + unless => "test -d ${database_dir}", + provider => shell, + logoutput => $contrail_logoutput + } -> file { $database_dir : ensure => directory, owner => cassandra,