On 02/22/2013 07:42 AM, yarlagadda ramya wrote:
Hi all,

Can u pls provide me the solution for this....


class main {

$software = "/app/tcs/puppetdemo/software"
$server = "/app/tcs/puppetdemo/server"

exec{"download_jdk":
     command =>"/usr/bin/wget $URL",
     cwd =>"$software",
}

exec {"untar_jdk":
command => "/bin/tar -C /app/tcs/puppetdemo/server/ -zxf /app/tcs/puppetdemo/software/jdk1.6.0_24.tar.gz",
          cwd => "$server",
}

Exec['download_jdk'] -> Exec['untar_jdk']
}

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

The exec resource has a create attribute :

- **creates**
    A file to look for before running the command. The command will
    only run if the file **doesn't exist.**

create => "target file jdk download"

Or us the -c option with wget.

Or make a package of the java, and install it via the package resource : (my preferred way)

here is an example for RPM packages : (we need multiple java versions to co-exists on the same system ..)


# spec file for jre/jdk repackaging of the oracle java packages.
#
Name:    jdk
License: Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. Also under other license(s) as shown at the Description field.
Version: 1.6.0_33
Release: repack
Vendor: Oracle and/or its affiliates.
Source0: jdk-6u33-linux-i586.bin
Source1: jdk-6u33-linux-x64.bin
Prefix: /opt/java
Group: Development/Tools
Url: http://www.oracle.com/technetwork/java/javase/overview/index.html
Summary: Java(TM) Platform Standard Edition Development Kit
Packager: Johan De Wit <johan.de...@vrt.be>
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%package 32bit
Summary: Java(TM) Platform Standard Edition Development Kit 32bit version VRT repackaged
Group: Development/Tools

%description
The Java Platform Standard Edition Development Kit (JDK) includes both
the runtime environment (Java virtual machine, the Java platform classes
and supporting files) and development tools (compilers, debuggers,
tool libraries and other tools).

The JDK is a development environment for building applications, applets
and components that can be deployed with the Java Platform Standard
Edition Runtime Environment.

This is the VRT repackaged version

%description 32bit
The Java Platform Standard Edition Development Kit (JDK) includes both
the runtime environment (Java virtual machine, the Java platform classes
and supporting files) and development tools (compilers, debuggers,
tool libraries and other tools).

The JDK is a development environment for building applications, applets
and components that can be deployed with the Java Platform Standard
Edition Runtime Environment.

This is the VRT 32bit repackaged version

%prep

%build

%install
cd %buildroot
mkdir -p %{buildroot}%{prefix}/{i586,x86_64}
cd %{buildroot}%{prefix}/i586
chmod 755 %{SOURCE0}
%{SOURCE0}
cd %{buildroot}%{prefix}/x86_64
chmod 755 %{SOURCE1}
%{SOURCE1}

%files 32bit
%{prefix}/i586/%{name}%{version}/

%files
%{prefix}/x86_64/%{name}%{version}/

%changelog
* Tue Mar 27 2012 Johan De Wit <johan.de...@vrt.be>
- repackaging to be able to install multiple java versions



--
Johan De Wit

Open Source Consultant
Red Hat Certified Engineer    (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________

Open-Future           Phone   +32 (0)2/255 70 70
Zavelstraat 72        Fax     +32 (0)2/255 70 71
3071 KORTENBERG       Mobile  +32 (0)474/42 40 73
BELGIUM               http://www.open-future.be
_________________________________________________________

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to