summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider/group
Commit message (Collapse)AuthorAgeFilesLines
* (#8409) Add a default group provider for WindowsNick Lewis2011-08-101-0/+48
| | | | | | | | | | This provider, windows_adsi, uses the Puppet::Util::ADSI module to manage groups. It can only manage group existence and memberships, but is fully functional in those regards. Based on work by: Joel Rosario <joel.r@.internal.directi.com> Based on work by: Cameron Thomas <cameron@puppetlabs.com> Reviewed-By: Matt Robinson <matt@puppetlabs.com>
* Merge branch '2.6.x' into nextMax Martin2011-04-131-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: Updated CHANGELOG for 2.6.8rc1 (#2331) Remove darwinports pkg provider, replace with rewritten macports provider Fixed #7082 - Added system support for groups (#7018) Give more context on the service type's assumptions. Wording tweaks. (#7018) explain internals better in service provider documentation maint: Fix sqlite3 require to really be optional maint: Fix sporadic sqlite error (#6818) Stop from getting Rails 3 named_scope deprecation warning (#6856) Copy dangling symlinks with 'links => manage' File resource. Conflicts (Resolved manually): lib/puppet/type/group.rb spec/unit/indirector/facts/inventory_active_record_spec.rb
| * Fixed #7082 - Added system support for groupsJames Turnbull2011-04-141-0/+3
| |
* | Fixed #5684 - Move to Apache 2.0 licenseJames Turnbull2011-04-111-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For details of why we're moving please see: https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion Removed explicit GPL licenses where appropriate Replaced selected GPL licenses with Apache 2.0 Replaced LICENSE with Apache 2.0 Updated README
* | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-101-16/+15
| | | | | | | | | | More elegant Array|String => String conversion in AixObject. Fixed some bugs and code/comments cleaned.
* | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-101-13/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specific providers should be created for AIX to manage users and groups. AIX bases the authentication management on a set of commands: mkuser, rmuser, chuser, lsuser, mkgroup, rmgroup, chgroup, lsg This commit implements such providers. The types where extended with: - feature: :manages_aix_lam - newparam(ia_load_module): authentication module to use in user and group AIX providers. - newproperty("attributes"): AIX attributes that are not managed by puppet directely. Notes:: - AIX users can have expiry date defined with minute granularity, but puppet does not allow it. There is a ticket open for that (#5431) - AIX maximum password age is in WEEKs, not days. Squashed commit of the following: commit dd9efff227f60dd7d11e33f754870f6344526097 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:42:35 2010 +0100 Added new property "attributes" in AIX group provider for AIX attributes that are not managed by puppet directely. commit cd23fff3a3a4963f12c0029d43db3c530a0e4fa3 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:33:50 2010 +0100 Converted file from Windows to Unix format commit c6929e9b557802fe908469ca51339ce249242c94 Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 14:32:29 2010 +0100 Added new property "attributes" in AIX user provider for AIX attributes that are not managed by puppet directely. commit d2814dc9d7730635a17a9bdbbc6ef9518f23b39d Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 12:48:07 2010 +0100 Added feature :ia_load_module and new parameter (newparam) ia_load_module, to define authentication module to use in user and group AIX providers. commit 95a4e960a93c1b75a4a0053c07fa192bf552d63b Author: Hector Rivas Gandara <keymon@gmail.com> Date: Tue Dec 28 12:46:20 2010 +0100 Fixed typo in if sentence
* | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2011-01-101-2/+6
| | | | | | | | | | Fixed providers for new aixobject.rb Fixed incorrect variable naming.
* | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2010-12-271-1/+1
| | | | | | | | Refactorized the aixobject.rb to allow new providers using commands with colon separated output.
* | (#5432) Use AIX native commands to manage users and groupsHector Rivas Gandara2010-12-271-0/+76
|/ | | | | | | | | | | | | | | | | Specific providers should be created for AIX to manage users and groups. AIX bases the authentication management on a set of commands: mkuser, rmuser, chuser, lsuser, mkgroup, rmgroup, chgroup, lsgroup, etc. This commit implements such providers. Notes:: - AIX users can have expiry date defined with minute granularity, but puppet does not allow it. There is a ticket open for that (#5431) - AIX maximum password age is in WEEKs, not days. - I force the compat IA module. TODO:: - Add new AIX specific attributes, specilly registry and SYSTEM.
* Updated all types to Markdown outputJames Turnbull2010-08-113-5/+5
| | | | | | | | | | Updated defaults.rb to Markdown Migrated report documentation to Markdown Migrated Naginator doco to Markdown Updated provider documentation to Markdown
* Code smell: Two space indentationMarkus Roberts2010-07-094-87/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Code smell: Don't restate results directly after assignmentMarkus Roberts2010-07-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 33 occurances of ([$@]?\w+)( +[|&+-]{0,2}= .+) \1 end with 3 Examples: The code: @sync ||= Sync.new @sync end becomes: @sync ||= Sync.new end The code: str += "\n" str end becomes: str += "\n" end The code: @indirection = Puppet::Indirector::Indirection.new(self, indirection, options) @indirection end becomes: @indirection = Puppet::Indirector::Indirection.new(self, indirection, options) end
* Code smell: Avoid explicit returnsMarkus Roberts2010-07-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 583 occurances of (DEF) (LINES) return (.*) end with 3 Examples: The code: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end return filters end becomes: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end filters end The code: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return return_value end becomes: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return_value end The code: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target return fakefile(File::join("data/types/mount", name)) end becomes: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target fakefile(File::join("data/types/mount", name)) end
* Code smell: Line modifiers are preferred to one-line blocks.Markus Roberts2010-07-092-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 6 occurances of (while .*?) *do$ with The do is unneeded in the block header form and causes problems with the block-to-one-line transformation. 3 Examples: The code: while line = f.gets do becomes: while line = f.gets The code: while line = shadow.gets do becomes: while line = shadow.gets The code: while wrapper = zeros.pop do becomes: while wrapper = zeros.pop * Replaced 19 occurances of ((if|unless) .*?) *then$ with The then is unneeded in the block header form and causes problems with the block-to-one-line transformation. 3 Examples: The code: if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } then becomes: if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } The code: unless defined?(@spec_command) then becomes: unless defined?(@spec_command) The code: if c == ?\n then becomes: if c == ?\n * Replaced 758 occurances of ((?:if|unless|while|until) .*) (.*) end with The one-line form is preferable provided: * The condition is not used to assign a variable * The body line is not already modified * The resulting line is not too long 3 Examples: The code: if Puppet.features.libshadow? has_feature :manages_passwords end becomes: has_feature :manages_passwords if Puppet.features.libshadow? The code: unless (defined?(@current_pool) and @current_pool) @current_pool = process_zpool_data(get_pool_data) end becomes: @current_pool = process_zpool_data(get_pool_data) unless (defined?(@current_pool) and @current_pool) The code: if Puppet[:trace] puts detail.backtrace end becomes: puts detail.backtrace if Puppet[:trace]
* Code smell: Use string interpolationMarkus Roberts2010-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 83 occurances of (.*)" *[+] *([$@]?[\w_0-9.:]+?)(.to_s\b)?(?! *[*(%\w_0-9.:{\[]) with \1#{\2}" 3 Examples: The code: puts "PUPPET " + status + ": " + process + ", " + state becomes: puts "PUPPET " + status + ": " + process + ", #{state}" The code: puts "PUPPET " + status + ": #{process}" + ", #{state}" becomes: puts "PUPPET #{status}" + ": #{process}" + ", #{state}" The code: }.compact.join( "\n" ) + "\n" + t + "]\n" becomes: }.compact.join( "\n" ) + "\n#{t}" + "]\n" * Replaced 21 occurances of (.*)" *[+] *" with \1 3 Examples: The code: puts "PUPPET #{status}" + ": #{process}" + ", #{state}" becomes: puts "PUPPET #{status}" + ": #{process}, #{state}" The code: puts "PUPPET #{status}" + ": #{process}, #{state}" becomes: puts "PUPPET #{status}: #{process}, #{state}" The code: res = self.class.name + ": #{@name}" + "\n" becomes: res = self.class.name + ": #{@name}\n" * Don't use string concatenation to split lines unless they would be very long. Replaced 11 occurances of (.*)(['"]) *[+] *(['"])(.*) with 3 Examples: The code: o.define_head "The check_puppet Nagios plug-in checks that specified " + "Puppet process is running and the state file is no " + becomes: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no " + The code: o.separator "Mandatory arguments to long options are mandatory for " + "short options too." becomes: o.separator "Mandatory arguments to long options are mandatory for short options too." The code: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no " + "older than specified interval." becomes: o.define_head "The check_puppet Nagios plug-in checks that specified Puppet process is running and the state file is no older than specified interval." * Replaced no occurances of do (.*?) end with {\1} * Replaced 1488 occurances of "([^"\n]*%s[^"\n]*)" *% *(.+?)(?=$| *\b(do|if|while|until|unless|#)\b) with 20 Examples: The code: args[0].split(/\./).map do |s| "dc=%s"%[s] end.join(",") becomes: args[0].split(/\./).map do |s| "dc=#{s}" end.join(",") The code: puts "%s" % Puppet.version becomes: puts "#{Puppet.version}" The code: raise "Could not find information for %s" % node becomes: raise "Could not find information for #{node}" The code: raise Puppet::Error, "Cannot create %s: basedir %s is a file" % [dir, File.join(path)] becomes: raise Puppet::Error, "Cannot create #{dir}: basedir #{File.join(path)} is a file" The code: Puppet.err "Could not run %s: %s" % [client_class, detail] becomes: Puppet.err "Could not run #{client_class}: #{detail}" The code: raise "Could not find handler for %s" % arg becomes: raise "Could not find handler for #{arg}" The code: Puppet.err "Will not start without authorization file %s" % Puppet[:authconfig] becomes: Puppet.err "Will not start without authorization file #{Puppet[:authconfig]}" The code: raise Puppet::Error, "Could not deserialize catalog from pson: %s" % detail becomes: raise Puppet::Error, "Could not deserialize catalog from pson: #{detail}" The code: raise "Could not find facts for %s" % Puppet[:certname] becomes: raise "Could not find facts for #{Puppet[:certname]}" The code: raise ArgumentError, "%s is not readable" % path becomes: raise ArgumentError, "#{path} is not readable" The code: raise ArgumentError, "Invalid handler %s" % name becomes: raise ArgumentError, "Invalid handler #{name}" The code: debug "Executing '%s' in zone %s with '%s'" % [command, @resource[:name], str] becomes: debug "Executing '#{command}' in zone #{@resource[:name]} with '#{str}'" The code: raise Puppet::Error, "unknown cert type '%s'" % hash[:type] becomes: raise Puppet::Error, "unknown cert type '#{hash[:type]}'" The code: Puppet.info "Creating a new certificate request for %s" % Puppet[:certname] becomes: Puppet.info "Creating a new certificate request for #{Puppet[:certname]}" The code: "Cannot create alias %s: object already exists" % [name] becomes: "Cannot create alias #{name}: object already exists" The code: return "replacing from source %s with contents %s" % [metadata.source, metadata.checksum] becomes: return "replacing from source #{metadata.source} with contents #{metadata.checksum}" The code: it "should have a %s parameter" % param do becomes: it "should have a #{param} parameter" do The code: describe "when registring '%s' messages" % log do becomes: describe "when registring '#{log}' messages" do The code: paths = %w{a b c d e f g h}.collect { |l| "/tmp/iteration%stest" % l } becomes: paths = %w{a b c d e f g h}.collect { |l| "/tmp/iteration#{l}test" } The code: assert_raise(Puppet::Error, "Check '%s' did not fail on false" % check) do becomes: assert_raise(Puppet::Error, "Check '#{check}' did not fail on false") do
* deprecate NetInfo providers and examples, remove all NetInfo references and ↵Nigel Kersten2009-07-141-15/+0
| | | | tests.
* Removed extra whitespace from end of linesIan Taylor2009-06-062-3/+3
|
* Changed indentation to be more consistent with style guide (4 spaces per level)Ian Taylor2009-06-065-5/+5
|
* Documentation fixesJames Turnbull2008-12-135-14/+27
|
* add NetInfo deprecation notice to user and group providers, make the ↵Nigel Kersten2008-12-061-3/+5
| | | | directoryservice user provider the default, remove default for darwin from NetInfo providers
* Lots of DirectoryService work. New Computer Type. Users now use password ↵Nigel Kersten2008-11-261-2/+3
| | | | hashes. Groups now support setting members as attributes of the group for OS X.
* Fixed #1272 - ldap group names will be converted to GIDs.Luke Kanies2008-07-071-0/+9
| | | | | | | Note that this only looks up ldap groups, at this point; if you want to set an ldap user's primary group to a local group, you have to specify the GID. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1360 -- allowdupe works with groups again.Luke Kanies2008-06-161-1/+1
| | | | | | I've added a couple of tests for this bit of the user and group useradd/groupadd providers, but I haven't migrated the rest of the tests.
* The ldap user/group providers now work when no users/groups are in ldap yet.Luke Kanies2008-05-211-6/+8
| | | | | Previously, they failed if you tried to get them to autogenerate an id, because they assumed that a result would be returned.
* Intermediate commit so I can move on to other things.Luke Kanies2008-05-201-1/+1
|
* Adding ldap providers for the user and group type.Luke Kanies2008-05-121-0/+37
| | | | | | These providers use posixAccount and posixGroup. This is a collapsed merge, fwiw.
* Removing the Id tags from all of the filesLuke Kanies2007-10-033-3/+0
|
* Copying the "commands" and "confine" statements to the actual dscl ↵luke2007-08-061-5/+4
| | | | | | providers, since they need to be there to determine where the providers are suitable. Otherwise base classes could unnecessarily affect how subclasses work. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2751 980ebf18-57e1-0310-9a29-db15c13687c0
* DirectoryService provider for users and groups. Alternative to netinfo, as ↵mccune2007-08-031-0/+24
| | | | | | | | apple has indicated NetInfo may go away at some point in the future. It might happen in October. FIXME: implement groups and groups= instances methods for Puppet::Type::User::ProviderDirectoryservice git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2739 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #605 -- providers now refer to @resource or @resource_type.luke2007-05-092-5/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2501 980ebf18-57e1-0310-9a29-db15c13687c0
* I have not yet finished testing, but most of the providers now successfully ↵luke2006-12-282-4/+4
| | | | | | pass arrays to execute() instead of strings, which means that the vast majority of execution problems are now gone. I will finish testing tomorrow, hopefully, and will also hopefully be able to verify that the execution-related bugs are fixed. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1979 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #267. The problem was that the user provider was retrieving the @is ↵luke2006-09-152-4/+4
| | | | | | value instead of the @should value, because it was using [] instead of the should method. I fixed the FakeModel to behave a bit more like real types, so that it keeps track of the is/should values, and also to keep track of which attributes are valid, since I immediately ran into another problem stemming from the use of the fakemodel. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1599 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying providers so that docs generate betterluke2006-08-281-4/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1502 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging r1468 from the implementations branch with r1438 from when the ↵luke2006-08-143-0/+75
branch was first created. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1469 980ebf18-57e1-0310-9a29-db15c13687c0