On Sat, Sep 12, 2009 at 3:56 PM, ELTigre <igalva...@gmail.com> wrote:
> > On Sep 12, 10:10 am, Chris Blumentritt <cblum...@gmail.com> wrote: > Hi Chirs, > > I only use debian lenny on my servers. I just want to create a class > with all package from APT to keep them up2date all the time with this > configuration (ensure => latest) and whenever I create a new server it > install all theses packages. > > > The spirit of puppet is to install via the package resource. You could > > write a shell script to install using a text file as a data source then > use > > the exec resource using onlyif to check to see if you need to run it. > What > How does "onlyif" fits here if I use exec? What should I check to > prevent exec running every time puppet client get the catalog? > You would have test to see if a directory that a packages does not exist. If it does not exist then install packages. This really is the wrong way to go about it though since this would be a huge pain to do for more than a few packages. > > > I would do is create a separate class in its own manifest file and do > some > > fancy searching and replacing (matching beginnings and endings of lines) > > with your list of packages. Since you have so many packages I doubt the > > resource will be more than one line. End up with something like: > > package { "package_name": ensure => installed } > Coul you explain me this, please? :-) > This really is the best way to go have the package resource handle this. It will check to see if each package is installed without extra effort on your part. I am not sure what you want to explain about this, here is a link to the package documentation: http://reductivelabs.com/trac/puppet/wiki/TypeReference#package > > > > You might run into trouble here if you are using different distros of > linux > > or linux and freebsd as the package names may be different. You would > get > > the benefit of later being able to hit the file and change installed to > > latest if you want update a specific package though. > > > > I have never heard of a file being used as a source for a resource but it > is > > an interesting thought. You might get away with an inline template to do > > that but that would be dirty: > > > > package { inline_template("<%= filename.each_line.collect %>"): > > require => File["filename"], > > ensure => installed > I'll test it and let you know. > > thanks a lot. > regards, > israel > > > > } > > > > I have no idea if the above will work and I doubt the erb is correct > since > > my ruby sucks. > > > > Chris > > > > On Sat, Sep 12, 2009 at 12:02 AM, ELTigre <igalva...@gmail.com> wrote: > > > > > How can I install a lot (more than 800) of APT packages using an easy > > > way in puppet? I mean, using some file.txt where I put there the > > > packages I want to install and my package resource get the list . Is > > > it possible? Or do I have to put all packages in the package resource? > > > > > regards, > > > Israel. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---