Hi Nirmal,

Pl see the patch attached. This also fixes zip/unzip package dependency via
Puppet




On Fri, Apr 11, 2014 at 11:57 AM, Nirmal Fernando <[email protected]>wrote:

> +1 for patching.
>
>
> On Fri, Apr 11, 2014 at 11:26 AM, Akila Ravihansa Perera <
> [email protected]> wrote:
>
>> Hi Udara,
>>
>> Yes, it works for our purposes. But if an application relies on
>> "JAVA_HOME/bin" being in the PATH, it will fail.
>> This is not a concern for running Puppet modules we have for now but
>> could be a problem in the future.
>>
>>
>>
>> On Fri, Apr 11, 2014 at 10:40 AM, Udara Liyanage <[email protected]> wrote:
>>
>>> JAVA is required to run cartridge agent, setting only the JAVA_HOME
>>> should work.
>>>
>>>
>>>
>>> On Fri, Apr 11, 2014 at 4:42 AM, Akila Ravihansa Perera <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Puppet master Java module does not add $JAVA_HOME/bin to PATH when
>>>> applied to a cartridge.
>>>> But it will work with applications that use JAVA_HOME variable, but
>>>> will fail in some cases.
>>>>
>>>> Is there a reason for not to copy this to PATH? Or shall I work on a
>>>> patch to configure this properly?
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Udara Liyanage
>>> Software Engineer
>>>  WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> web: http://udaraliyanage.wordpress.com
>>> phone: +94 71 443 6897
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> Software Engineer
>> WSO2 Inc.
>> http://wso2.com
>>
>> Phone: +94 77 64 154 38
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com
From 7c03e069a77b0b8406b97242d8ffadf24054cf56 Mon Sep 17 00:00:00 2001
From: Akila Perera <[email protected]>
Date: Fri, 11 Apr 2014 17:12:26 +0530
Subject: [PATCH 2/2] Puppet - java module - install zip/unzip packages

---
 tools/puppet3/modules/java/manifests/init.pp          | 13 +++++++++++++
 tools/puppet3/modules/java/templates/java_home.sh.erb |  1 +
 2 files changed, 14 insertions(+)

diff --git a/tools/puppet3/modules/java/manifests/init.pp b/tools/puppet3/modules/java/manifests/init.pp
index 834c58a..2fd5657 100755
--- a/tools/puppet3/modules/java/manifests/init.pp
+++ b/tools/puppet3/modules/java/manifests/init.pp
@@ -21,6 +21,19 @@ class java {
   $package  = $java_distribution
   $local_dir = $local_package_dir
 
+  if ! defined(Package['unzip']) {
+    package { 'unzip': ensure => installed }
+  }
+
+  if ! defined(Package['zip']) {
+    package { 'zip': ensure => installed }
+  }
+
+  if ! defined(Package['tar']) {
+    package { 'tar': ensure => installed }
+  }
+
+
   file {
     "/opt/${package}":
       ensure => present,
diff --git a/tools/puppet3/modules/java/templates/java_home.sh.erb b/tools/puppet3/modules/java/templates/java_home.sh.erb
index c5b02bc..be64c63 100755
--- a/tools/puppet3/modules/java/templates/java_home.sh.erb
+++ b/tools/puppet3/modules/java/templates/java_home.sh.erb
@@ -16,3 +16,4 @@
 # under the License.
 
 export JAVA_HOME="<%= @java_home %>"
+export PATH=$PATH:"<%= @java_home %>/bin"
-- 
1.8.3.2

Reply via email to