Skip to content

Instantly share code, notes, and snippets.

@jamesog
Created May 9, 2013 16:58
Show Gist options
  • Save jamesog/5548834 to your computer and use it in GitHub Desktop.
Save jamesog/5548834 to your computer and use it in GitHub Desktop.
Retrieving zpools in facter
require 'facter'
Facter.add('zpools') do
setcode do
zpools = []
if Facter::Util::Resolution.which('zpool')
Facter::Util::Resolution.exec('zpool list -Ho name').each_line do |line|
line.strip!
zpools << line
end
zpools.sort.join(',')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment