Custom facts with exclusions

8 views
Skip to first unread message

Harish Kothuri

unread,
Jun 25, 2016, 3:49:30 PM6/25/16
to Puppet Users
Hi All,

I'm generating custom facts and want to exclude few software's in black list. 

Ex: 7-Zip is a software causing a problem as its name starts with digit and not a letter. The name also has some spaces, hiphens.

file { "c:/marionette-collective/etc/facts.yaml":
    loglevel => debug,
    content  => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime_seconds|timestamp|free)/}.to_yaml %>"), # exclude rapidly changing facts
  }


I'm trying something like below , am no ruby expert and can't figure out the right way.

file { "c:/marionette-collective/etc/facts.yaml":
    loglevel => debug,
    content  => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime_seconds|timestamp|free|'7-zip 5.6 (x64 version)')/}.to_yaml %>"), # exclude rapidly changing facts
  }


can some please help me. Becuase of this entire facts are not loading and puppet agent -t is failing. A big show stopper this is. 


Thanks

Reply all
Reply to author
Forward
0 new messages