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
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 }

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 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to