On Thu, May 24, 2012 at 6:06 AM, tiochan <tioc...@gmail.com> wrote: > Hi all! > > I'm new on puppet, and I making my firsts classes. >
Welcome! > I have defined an example class to install 7Zip on Windows servers, it > runs right, but I would like to improve it. > The problem is that each time that I execute the "puppet agent --test" it > downloads the 7zip.msi file, although it is really installed. > When using a file resource, Puppet should only transfer the file if there is a mis-match between the local file and the copy on the puppet master. Could you paste the output of puppet agent --test so we can see why the file is being transfered more than once? Do you happen to be removing the MSI from C:\Software\ between puppet runs? If so, Puppet will just put the file right back in place. > So, my question is: > Is possible to avoid the download of the associated source file, I there > is no need to install it? > > This is the code: > > > class software_dir { > > file { 'SOFTWARE_DIR': > path => 'C:\\SOFTWARE', > ensure => directory, > } > } > > class 7Zip() { > > include software_dir > > $7Zip_source = 'puppet://puppet.upc.edu/modules/windows/7z920.msi' > $7Zip_path = 'C:\\SOFTWARE\\7z920.msi' > $7Zip_package_name = '7-zip 9.20' > > file { $7Zip_path: > source => $7Zip_source; > } > > package { $7Zip_package_name: > ensure => installed, > provider => 'msi', > source => File[$7Zip_path], I think this line above should be source => "${7Zip_path}" It shouldn't contain a reference to the _resource_ File[$7Zip_path] but instead simply the string that contains the path. I'm not sure this is actually the problem though. I think the output of puppet agent --test will help diagnose this further. -Jeff -- 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.