From 55a9c8f712f3b7525cdc741c133413c356a0287b Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Thu, 23 Jul 2020 21:35:03 +0000 Subject: [PATCH] creates a fully running instance of apacheds --- manifests/apacheds.pp | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/manifests/apacheds.pp b/manifests/apacheds.pp index 6e5ef1e..b9be49f 100644 --- a/manifests/apacheds.pp +++ b/manifests/apacheds.pp @@ -1,9 +1,9 @@ # -# +# apacheds # class plnxtools::apacheds( $ads_shutdown_port = 0, - $appname = "apacheds" + $appname = "apacheds", $ads_instances = "/var/apacheds", $ads_logdir = "/var/log/$appname", @@ -40,7 +40,32 @@ define plnxtools::apacheds::instance( $ensure = running ) { - service {$title: - start => "$plnxtools::apacheds::$opt_dir/$plnxtools::apacheds::$appname/bin/apachds.sh $title start" + $ads_instances = $plnxtools::apacheds::ads_instances + $log_file = "$plnxtools::apacheds::ads_logdir/$title.log" + + file{"$ads_instances/$title": + ensure => directory + } -> + file{"$ads_instances/$title/conf": + ensure => directory + } -> + file{"$ads_instances/$title/log": + ensure => directory + } -> + file{"$ads_instances/$title/run": + ensure => directory + } -> + file{"$ads_instances/$title/conf/log4j.properties": + ensure => file, + content => template ("plnxtools/apacheds/log4j.properties.erb"), + } + + $bin_dir = "${plnxtools::apacheds::opt_dir}/${plnxtools::apacheds::appname}/bin" + + service {"apacheds_${title}": + start => "$bin_dir/apacheds.sh $title start", + stop => "$bin_dir/apacheds.sh $title stop", + status => "/bin/false", + ensure => running } }