Class: Chef::Provider::Group::Aix
- Inherits:
-
Usermod
- Object
- Chef::Provider
- Chef::Provider::Group
- Groupadd
- Usermod
- Chef::Provider::Group::Aix
- Defined in:
- lib/chef/provider/group/aix.rb
Instance Attribute Summary
Attributes inherited from Chef::Provider::Group
Attributes inherited from Chef::Provider
#current_resource, #new_resource, #run_context
Instance Method Summary collapse
- #create_group ⇒ Object
- #manage_group ⇒ Object
- #remove_group ⇒ Object
- #required_binaries ⇒ Object
- #set_options ⇒ Object
Methods inherited from Usermod
#load_current_resource, #modify_group_members
Methods inherited from Groupadd
#load_current_resource, #modify_group_members
Methods inherited from Chef::Provider::Group
#action_create, #action_manage, #action_modify, #action_remove, #compare_group, #initialize, #load_current_resource
Methods included from Mixin::Command
#chdir_or_tmpdir, #handle_command_failures, #not_if, #only_if, #output_of_command, #run_command, #run_command_with_systems_locale
Methods included from Mixin::Command::Windows
Methods included from Mixin::Command::Unix
Methods inherited from Chef::Provider
#action_nothing, build_from_file, #cookbook_name, #initialize, #load_current_resource, #node, #resource_collection
Methods included from Mixin::ConvertToClassName
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename
Methods included from Mixin::RecipeDefinitionDSLCore
Methods included from Mixin::Language
#data_bag, #data_bag_item, #platform?, #search, #value_for_platform
Constructor Details
This class inherits a constructor from Chef::Provider::Group
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Chef::Mixin::RecipeDefinitionDSLCore
Instance Method Details
#create_group ⇒ Object
32 33 34 35 36 37 |
# File 'lib/chef/provider/group/aix.rb', line 32 def create_group command = "mkgroup" command << << " #{@new_resource.group_name}" run_command(:command => command) modify_group_members end |
#manage_group ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/chef/provider/group/aix.rb', line 39 def manage_group command = "chgroup" = #Usage: chgroup [-R load_module] "attr=value" ... group if .size > 0 command << << " #{@new_resource.group_name}" run_command(:command => command) end modify_group_members end |
#remove_group ⇒ Object
50 51 52 |
# File 'lib/chef/provider/group/aix.rb', line 50 def remove_group run_command(:command => "rmgroup #{@new_resource.group_name}") end |
#required_binaries ⇒ Object
26 27 28 29 30 |
# File 'lib/chef/provider/group/aix.rb', line 26 def required_binaries [ "/usr/bin/mkgroup", "/usr/bin/chgroup", "/usr/sbin/rmgroup" ] end |
#set_options ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/chef/provider/group/aix.rb', line 54 def opts = "" { :gid => "id" }.sort { |a,b| a[0] <=> b[0] }.each do |field, option| if @current_resource.send(field) != @new_resource.send(field) if @new_resource.send(field) Chef::Log.debug("#{@new_resource} setting #{field.to_s} to #{@new_resource.send(field)}") opts << " '#{option}=#{@new_resource.send(field)}'" end end end opts end |