That's a really good idea. Thanks for sharing. Ed
Sent from my iPhone On May 12, 2009, at 11:23 AM, Nigel Kersten <nig...@google.com> wrote: > > On Tue, May 12, 2009 at 8:16 AM, Edward Bailey > <eds.mailing.list.acco...@gmail.com> wrote: >> To explain the background behind my question >> >> We have a number of situations where it would be great if I could >> have >> puppet automatically maintain a symlink for a resource such as the >> Java JVM. >> >> For example - we install the JDK in /usr/java so after the RPM >> install, the >> path to the JVM is /usr/java/jdk1.5.0_16. In order to simplify >> application >> configuration, I like to make JAVA_HOME something generic like >> /usr/java/java. I do this by creating a symlink >> >> ln -s /usr/java/jdk1.5.0_16/ /usr/java/java >> >> I would like to have puppet maintain the symlink so that when YUM >> updates >> the JVM, the symlink gets updated as well. I know I could do this >> in the RPM >> or using exec but that sounds like too much work:) >> >> Just for fun I tried to setup a file type in puppet to create the >> symlink >> using a wildcard. I did not expect this to work given the need for >> shell >> expansion. >> >> file { "/usr/java/java": >> ensure => "/usr/java/jdk1.*" >> } >> >> Is their another way to do this in the puppet framework? I can do >> this using >> exec, but I wanted to work from within puppet first. > > So if you write a fact that is your jdk path, you could then use it in > your manifests: > > file { "/usr/java/java": > ensure => symlink, > replace => true > target => $jdk_path, > } > > That would seem to be the simplest option. > > > > -- > Nigel Kersten > nig...@google.com > System Administrator > Google, Inc. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---