no need for the define
package { $packages: ensure => installed } will work
Let us know if you have problems with that.
On Fri, Apr 10, 2009 at 3:55 PM, Trevor Vaughan <[email protected]>wrote:
>
> This *might* work:
>
> package { $packages: ensure => installed }
>
> But you might have to do this:
>
> define do_stuff {
> package { $name: ensure => installed }
> }
>
> do_stuff { $packages: }
>
> Trevor
>
> On Wed, Apr 8, 2009 at 18:39, engle <[email protected]> wrote:
> >
> > I am having troubles finding the proper documentation that explains
> > how to access the elements in an array.
> >
> > I have created a function that queries LDAP and returns an array of
> > packages that I will deploy using puppet. In my init.pp file I have
> > something like:
> >
> > $packages = get_packages("cn=computer_name")
> >
> > I know that the 'get_packages' function returns an array of values
> > that are package names such as ["firefox", "comicLife"]. So I am
> > assuming that $packages = ["firefox", "comicLife"]. What I want to do
> > is to step through this array and deploy the packages listed in the
> > array. I have the code to deploy the packages but I do not know how to
> > step through the members of the array and pass those values onto my
> > pkg_deploy function.
> >
> > Can someone point me in the right direction?
> >
> > Thanks
> >
> > -kurt
> > >
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---