Ask Your Question
1

facter windows

asked 2014-05-22 13:00:14 -0500

SweetJ21 gravatar image

updated 2014-09-15 14:40:03 -0500

Hi, new Puppet user here.
When are new versions of Facter (2+) expected to be included with the Windows puppet agent install package?

I'm trying to get some aggregate resolutions working, and it took me a while to figure out that my test Windows client wasn't running Facter 2, where aggregate resolutions aren't implemented yet.

Basically, I just want to build a fact that does this (maybe I don't even need aggregate resolutions). I had problems with concatenating strings in Facter though, and from what I've read aggregate resolutions seem to be the way to do it.


Facter.add(:hostlog) do
somefilename = "C:\" + Facter.value('hostname') + "." + Facter.value('environment') + ".log"
     # ie. "C:\host01.test.log"
if file.exist? somefilename  
  false  
else  
  true  
end  
end
So then what I was trying to do is this:
Facter.add(:hostlog, :type => :aggregate) do
chunk(:hostname) do
  Facter.value(:hostname)
end

chunk(:environment) do
  Facter.value(:environment)
end

aggregate do |chunks|
  result = ""
  chunks.each do |chunk|
    result += chunk
  end
  result
end
end

Anyone able to help?

edit retag flag offensive close merge delete

Comments

I thought 3.6.0 included facter 2, but apparently that was only in the RC...

rob gravatar imagerob ( 2014-05-22 16:05:07 -0500 )edit

Yeah, I was running 3.5.1 earlier and upgraded to 3.6.0 hoping it would bring in Facter 2+ but it didn't.

SweetJ21 gravatar imageSweetJ21 ( 2014-05-23 08:02:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-23 12:08:58 -0500

Puppet 3.6.1 does include Facter 2. We tested to be sure. https://tickets.puppetlabs.com/browse...

edit flag offensive delete link more

Comments

Excellent, thanks. I've just updated my test client to 3.6.1.

SweetJ21 gravatar imageSweetJ21 ( 2014-05-26 13:26:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-05-22 13:00:14 -0500

Seen: 199 times

Last updated: May 23 '14