I think you might be using the wrong tool for the job, but we need a
little bit more information to determine that: What do you want to do
with these facts once you have them in puppet?

If you are managing websites with puppet, you should probably manage
the folders themselves with puppet, removing your need for the fact.

cheers,

Walter

On Sun, Nov 25, 2012 at 10:16 PM, frap <l...@brig.gs> wrote:
> I'm trying to write a custom fact for Puppet, but I have next to no Ruby
> experience. I think what I'm trying to do is straightforward, but because of
> Facter's key => value pairs model, it's kind of difficult.
>
> Each hosts I want the fact for has websites in /var/www/html/ - I want to be
> able to do the following:
>
> Have a fact called "websites" that will tell me how many folders there are
> under /var/www/html
>
> Have a list of facts called website_1, website_2, website_3 which will tell
> me the names of these sites. Either that or have an array (if that's even
> possible) called website_names which will then list all the websites under
> that key.
>
> If possible, I'd like the fact to be able to figure out how many websites
> there are with the original "websites" fact and limit the number of websites
> underneath.
>
> Any help gratefully appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/XBkAAkifbZ4J.
> 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.



-- 
Walter Heck

--
Check out my startup: Puppet training and consulting @ http://www.olindata.com
Follow @olindata on Twitter and/or 'Like' our Facebook page at
http://www.facebook.com/olindata

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