From 65aef8b924a37537e5dc81bdc9ff9ccae7caa133 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Sat, 25 Jul 2020 17:39:42 +0000 Subject: [PATCH] Uses file extension .instance for instance files in /opt/plnxtools/ads --- lib/facter/plnxtools_ads_instances.rb | 4 ++-- manifests/apacheds.pp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/facter/plnxtools_ads_instances.rb b/lib/facter/plnxtools_ads_instances.rb index d2de910..3058d56 100644 --- a/lib/facter/plnxtools_ads_instances.rb +++ b/lib/facter/plnxtools_ads_instances.rb @@ -1,8 +1,8 @@ Facter.add('ads_instances') do setcode do - Dir.glob('/opt/plnxtools/ads/*').map do |x| + Dir.glob('/opt/plnxtools/ads/*.instance').map do |x| content = File.read(x) - File.basename(x) + File.basename(x,File.extname(x)) end end end diff --git a/manifests/apacheds.pp b/manifests/apacheds.pp index 31361df..c71b766 100644 --- a/manifests/apacheds.pp +++ b/manifests/apacheds.pp @@ -106,7 +106,7 @@ define plnxtools::apacheds::instance( $bin_dir = "${plnxtools::apacheds::opt_dir}/${plnxtools::apacheds::appname}/bin" - file {"/opt/plnxtools/ads/$title": + file {"/opt/plnxtools/ads/$title.instance": ensure => file }-> service {"apacheds_${title}": @@ -132,7 +132,7 @@ define plnxtools::apacheds::instance( status => "$bin_dir/apacheds.sh $title status | grep 'is running'", ensure => stopped, } -> - file {"/opt/plnxtools/ads/$title": + file {"/opt/plnxtools/ads/$title.instance": ensure => absent } -> file{"$ads_instances/$title": @@ -144,6 +144,8 @@ define plnxtools::apacheds::instance( } + + define plnxtools::apacheds::syncrepl( $parition, $consumer_id, @@ -151,4 +153,3 @@ define plnxtools::apacheds::syncrepl( { } -