Created
February 24, 2012 19:38
-
-
Save robbyt/1903206 to your computer and use it in GitHub Desktop.
centrify fact for puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if File.exist?("/usr/bin/adinfo") | |
%x{/usr/bin/adinfo}.each do |line| | |
if line =~ /^(.+):(\s+)(.+)$/ | |
var = $1; val =$3 | |
# this will add centrify_ to each facter key, and | |
# replace spaces in the keys with _'s, and dropcase | |
Facter.add("centrify_" + var.gsub(/\s+/, "_").downcase()) do | |
setcode { val.chomp() } | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment