Skip to content

Instantly share code, notes, and snippets.

@discreet
Last active August 29, 2015 14:01
Show Gist options
  • Save discreet/f24c64026b6bb3f0cc4b to your computer and use it in GitHub Desktop.
Save discreet/f24c64026b6bb3f0cc4b to your computer and use it in GitHub Desktop.
This fact will pull a list of domain users and groups who have access
#This fact will pull securiy groups and users who have access if you are using PBIS.
Facter.add("Domain_Access") do
confine :osfamily => "RedHat"
setcode do
if File.directory? "/opt/likewise"
Domain_Access = `/opt/likewise/bin/lwconfig --detail RequireMembershipOf | grep '"' | sed -e 's/^"//' -e 's/"$//' | awk -F'\\' '{print $3}'`
$Access = split($Domain_Access, ' ')
Domain_Access
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment