On Sun, Nov 25, 2012 at 11:00 PM, Walter Heck <
walte...@gmail.com> wrote:
> 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.
Could you do something like website_count => XXXX ? Then you might not
need to list them out. Either way, you can comma separate strings and
use things like split in Puppet (and maybe stdlib) to do some things.
I used dozens of custom facts in my environment in the past, so I
can't tell you if this is *wrong* way per say. It's a way. Go for it
until you find something better.
Also note, if you're not really into writing ruby facts, you could use
something in facts.d that is provided via stdlib. That just reads
values from files. You could write your fact in whatever language you
want, run it in cron or something and then have it dump results from
/etc/facter/facts.d or /etc/puppetlabs/facter/facts.d.
stdlib:
http://forge.puppetlabs.com/puppetlabs/stdlib