yarlagadda ramya
2013-Feb-22 06:42 UTC
[Puppet Users] How to apply condition such that jdk doesnt download if its already downloaded in the code given
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+unsubscribe@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.
Johan De Wit
2013-Feb-22 07:28 UTC
Re: [Puppet Users] How to apply condition such that jdk doesnt download if its already downloaded in the code given
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+unsubscribe@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.dewit@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.dewit@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+unsubscribe@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.
James A. Peltier
2013-Feb-22 10:00 UTC
Re: [Puppet Users] How to apply condition such that jdk doesnt download if its already downloaded in the code given
We just download the RPMs and place them in a custom repository. That way we don''t mess with the exec stuff or anything. Is there any reason you don''t use the RPMs ----- Original Message ----- | 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+unsubscribe@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 . -- James A. Peltier Manager, IT Services - Research Computing Group Simon Fraser University - Burnaby Campus Phone : 778-782-6573 Fax : 778-782-3045 E-Mail : jpeltier@sfu.ca Website : http://www.sfu.ca/itservices “A successful person is one who can lay a solid foundation from the bricks others have thrown at them.” -David Brinkley via Luke Shaw -- 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+unsubscribe@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.