diff options
author | Julian C. Dunn <jdunn@aquezada.com> | 2014-08-04 13:46:17 -0400 |
---|---|---|
committer | Julian C. Dunn <jdunn@aquezada.com> | 2014-08-04 13:46:17 -0400 |
commit | 1dc4da1720c8bdbd8f44429c6d7861d484dcd631 (patch) | |
tree | 3594a170a6df3fd91b8e9989160ec4be6a98a3e9 /lib/chef/provider/group | |
parent | 930d12091511aa2d547366796ea49f4e26f18253 (diff) | |
parent | 7a92fe620a106abb737ca55a1b2ee59cfb1b06d6 (diff) | |
download | chef-1dc4da1720c8bdbd8f44429c6d7861d484dcd631.tar.gz |
Merge pull request #1180 from ClogenyTechnologies/kd-aix-groups
OC-10832 - AIX - group provider implementation
Diffstat (limited to 'lib/chef/provider/group')
-rw-r--r-- | lib/chef/provider/group/aix.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/chef/provider/group/aix.rb b/lib/chef/provider/group/aix.rb index 9dedef351a..6ac9d03357 100644 --- a/lib/chef/provider/group/aix.rb +++ b/lib/chef/provider/group/aix.rb @@ -16,16 +16,18 @@ # limitations under the License. # -require 'chef/provider/group/usermod' +require 'chef/provider/group/groupadd' +require 'chef/mixin/shell_out' class Chef class Provider class Group - class Aix < Chef::Provider::Group::Usermod + class Aix < Chef::Provider::Group::Groupadd def required_binaries [ "/usr/bin/mkgroup", "/usr/bin/chgroup", + "/usr/bin/chgrpmem", "/usr/sbin/rmgroup" ] end @@ -51,6 +53,19 @@ class Chef run_command(:command => "rmgroup #{@new_resource.group_name}") end + def add_member(member) + shell_out!("chgrpmem -m + #{member} #{@new_resource.group_name}") + end + + def set_members(members) + return if members.empty? + shell_out!("chgrpmem -m = #{members.join(',')} #{@new_resource.group_name}") + end + + def remove_member(member) + shell_out!("chgrpmem -m - #{member} #{@new_resource.group_name}") + end + def set_options opts = "" { :gid => "id" }.sort { |a,b| a[0] <=> b[0] }.each do |field, option| |