diff options
author | Michael Scherer <misc@mageia.org> | 2012-02-17 16:43:42 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-02-17 16:43:42 +0000 |
commit | 8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf (patch) | |
tree | 753fa8efe754f79d1f51fe1a6ac06a970236e82e /modules/buildsystem/lib | |
parent | 9a5d715b2f77526a5c7bb3b8dd421a46bc190a2c (diff) | |
download | puppet-8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf.tar puppet-8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf.tar.gz puppet-8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf.tar.bz2 puppet-8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf.tar.xz puppet-8432563b8bf81df0d9c2d95ebdf3cbeacddaacaf.zip |
add a function to get the members list of a unix group, idea from boklm
Diffstat (limited to 'modules/buildsystem/lib')
-rw-r--r-- | modules/buildsystem/lib/puppet/parser/functions/group_members.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/buildsystem/lib/puppet/parser/functions/group_members.rb b/modules/buildsystem/lib/puppet/parser/functions/group_members.rb new file mode 100644 index 00000000..c5cecbe8 --- /dev/null +++ b/modules/buildsystem/lib/puppet/parser/functions/group_members.rb @@ -0,0 +1,10 @@ +require 'etc' +# group_members($group) +# -> return a array with the login of the group members + +module Puppet::Parser::Functions + newfunction(:group_members, :type => :rvalue) do |args| + group = args[0] + return Etc.getgrnam(group).mem + end +end |