On Mar 4, 2010, at 7:29 AM, Allan Marcus wrote: > A file that this command creates. If this > parameter is provided, then the command will only be run > if the specified file does not exist:: > > exec { \"tar xf /my/tar/file.tar\": > cwd => \"/var/tmp\", > creates => \"/var/tmp/myfile\", > path => [\"/usr/bin\", \"/usr/sbin\"] > } > > > Is there a way to set the content of this file (/var/tmp/myfile) using some > additional parameter in the above syntax?
This isn't the "right" way to do it, and you may have performance issues depending on the size of the file, but you can always combine grep with unless. If you want to re-extract the file if the file doesn't contain "testString" this should work. exec { "tar xf /my/tar/file.tar": cwd => "/var/tmp", creates => "/var/tmp/myfile", path => ["/usr/bin", "/usr/sbin"], unless => "grep testString myfile", } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@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.