Facter does not really take arguments so I'd just create a fact for each group on the system.

Something like the following should work (this also does not fork additional processes and uses the native ruby calls):

# lib/facter/groups.rb
require 'etc'
groups = []
Etc.group do |group|
groups << group.name
Facter.add("group_#{group.name}_member".intern) do
setcode do
group.mem.join(',')
end
end
end
Facter.add(:groups) do
setcode do
groups.join(",")
end
end

You should then be able to use group_mydesiredgroup_member in your manifests.

Note that the above fact works on facter < 2.0. In facter 2.0 this should probably be written as a structured fact (so the fact can return an array instead of a stringified list). See writing structured facts if you already run facter 2.x