Skip to content

Instantly share code, notes, and snippets.

@dkerwin
Created July 4, 2012 12:41
Show Gist options
  • Save dkerwin/3047135 to your computer and use it in GitHub Desktop.
Save dkerwin/3047135 to your computer and use it in GitHub Desktop.
Example fact
if File.exist?("/etc/facts.txt")
File.readlines("/etc/facts.txt").each do |line|
if line =~ /^(.+)=(.+)$/
var = $1; val = $2
Facter.add(var) do
setcode { val }
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment