summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Merge branch 'bug/2.6.next/6009' into 2.6.nextDaniel Pittman2011-01-251-2/+2
| |\ \ \ \
| | * | | | Fixed #6009 - nested member list vs directory service group providerJames Turnbull2011-01-251-2/+2
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Directory Service group (and user) provider behaves erratically if members is a nested list; this happens with the following manifest: $r = ["root"] $a = ["daemon", "crc"] $n = ["nobody"] group { "testgroup": ensure => present, members => [$r, $a, $n] } This resolves the issue by flattening the list at the time we are using it; while a more general solution might be desirable this resolves the specific issue cleanly enough. Original patch from Clay Caviness. Tests by Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: James Turnbull <james@lovedthanlost.net>
| * | | | (#5931) Prevent errors when calling insync? on audited propertiesPaul Berry2011-01-253-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a method safe_insync? which first checks whether the property has a "should" value of nil, and if so returns true. Most insync? methods were already doing this, but a few were not, leading to bugs if a property was being audited but not set. Types should continue to override the insync? method, but callers of insync? should call safe_insync? instead. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | Maint: Rename misleading insync? method in file providerPaul Berry2011-01-252-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | This method actually checks whether the file owner is in sync. Renamed to is_owner_insync? Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | (#5427) Using Propery::OrderedList for host_aliasStefan Schulte2010-12-141-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the propertyclass Puppet::Property::OrderedList to represent the list of host_aliases. This lets us remove the in_sync, should_to_s etc overrides. In the provider class the list is represented by a string (=no array) so there were a few changes necessary as well. Because Puppet::Property::List uses the specified delimiter when converting should values to strings, I changed the delimiter to a simple space instead a tab. This keeps messages produced by puppet in a nice format. The tests had to be changed to work with the new behaviour of host_aliases. There are a few additional tests as well.
* | | | (#5393) Add "dataset" parameter to the zone providerDerek Olsen2010-12-071-0/+3
| | | | | | | | | | | | | | | | This patch extends the zone provider to support the inclusion of one or more datasets in a solaris zone. A dataset is an zfs filesystem that has been delegated from the global zone to the non global zone.
* | | | Merge remote branch 'someword/feature/master/5391' into nextPaul Berry2010-12-061-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * someword/feature/master/5391: (#5391) Include additional zfs properties
| * | | | (#5391) Include additional zfs propertiesDerek Olsen2010-11-241-1/+1
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | We added the following zfs properties to the zfs provider :recordsize, :aclmode, :aclinherit, :primarycache, :secondarycache Currently zfs users have to chain an exec to the zfs filesystem creation and the inclusion of these properties would allow puppet to set them natively.
* | | | Merge branch '2.6.x' into nextMatt Robinson2010-12-021-6/+5
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5304) Use internal_name rather than real_name for maillist provider Updated CHANGELOG and version for 2.6.4 Revert "(#5304) Use internal_name rather than real_name for maillist provider" Disable remote ralsh by default (#5424) Ship auth.conf as part of installing from source (#5304) Use internal_name rather than real_name for maillist provider Renamed Reductive to Puppet Manually Resolved Conflicts: lib/puppet/provider/maillist/mailman.rb
| * | | (#5304) Use internal_name rather than real_name for maillist providerNigel Kersten2010-12-011-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've switched to using list_lists --bare which shows the internal_name rather than "real_name", which is the authoritative identifier. Doing this also means we have less output to scrub, so the code is simpler. Modified by Markus as-per discussion with Nigel. Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
| * | | Revert "(#5304) Use internal_name rather than real_name for maillist provider"James Turnbull2010-12-021-5/+6
| | | | | | | | | | | | | | | | This reverts commit 779fea867a9e23ad48cd877a88756cc5792e9e0c.
| * | | (#5304) Use internal_name rather than real_name for maillist providerNigel Kersten2010-11-301-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've switched to using list_lists --bare which shows the internal_name rather than "real_name", which is the authoritative identifier. Doing this also means we have less output to scrub, so the code is simpler. Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
* | | | Merge branch 'ticket/next/5211' into nextMatt Robinson2010-12-021-1/+6
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | * ticket/next/5211: (#5211) Added patch and tests for checking the size of the arrary which is returned
| * | | (#5211) Added patch and tests for checking the size of the arrary which is ↵Steve Nielson2010-12-021-1/+6
| |/ / | | | | | | | | | returned
* | | (#2866) yum should support downgrade.Dan Bode2010-11-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch originally from Grzegorz Nosek with contributions on the test from Oliver Hookins. checks if the current version is greater than the should version, if so, calls yum downgrade. Reviewed-by: Matt Robinson
* | | Merge branch 'ticket/next/5274' into nextNick Lewis2010-11-171-53/+23
|\ \ \
| * | | (#5274) New comment property for the hosttypeStefan Schulte2010-11-171-53/+23
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the parsefile provider for host parses /etc/hosts, it throws any inlinecomment away. As a result they are also purged in /etc/hosts after a puppetrun that detects a change. That could be dangerous because you will lose information even about unmanaged resources. So if you have something like 192.168.0.1 hostentry_not_managed_by_puppet # Important comment in /etc/hosts the endresult will be 192.168.0.1\thostentry_not_managed_by_puppet This patch introduces a new property "comment" for the host type. The provider is nearly a complete rewrite and a lot shorter and hopefully easier to understand.
* | | (#5304) Use internal_name rather than real_name for maillist providerNigel Kersten2010-11-171-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We've switched to using list_lists --bare which shows the internal_name rather than "real_name", which is the authoritative identifier. Doing this also means we have less output to scrub, so the code is simpler. Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
* | | Merge commit '2.6.3' into nextPaul Berry2010-11-176-20/+16
|\| | | | | | | | | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * | Fix for #4279 -- mount detection on HP-UXMarkus Roberts2010-11-161-1/+1
| | | | | | | | | | | | | | | This is based on the discussion on ticket, simplified slightly and with test adjustment.
| * | Fix for #5273 -- user resource constantly resetting password ageMarkus Roberts2010-11-162-4/+4
| | | | | | | | | | | | | | | | | | | | | The query methods for the newly added password age properties didn't have the same name as the properties, and thus the default retrieve method wan't finding them and never got the current value from the provider. They were therefore always seen as :absent and puppet always thought they needed to be set.
| * | Fix for #4299 -- Don't require whichMarkus Roberts2010-11-121-4/+1
| | | | | | | | | | | | | | | | | | We already had an internal implementation of which hiding under an assumed name (Puppet::Util.binary); this commit calls it out of hiding and uses it consisantly.
| * | Reimplementation of functionality removed by prior commitMarkus Roberts2010-11-101-1/+9
| | | | | | | | | | | | | | | This commit implements the base path-to-source functionality and adds an (adapted) version of Matt's code on top of it.
| * | Refactor for CLAMarkus Roberts2010-11-101-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes code contributed by Ryan McBride, an author we have been unable to contact to sign a Contributor License Agreement. It also removes code writen by Matt Robinson (a Puppet Labs employee) which only made sense in the context of the removed code. The code in question comes from these commits: 6ac36eb4 Matt Robinson 55a9009c Ryan McBride
| * | (#4573) FreeBSD service provider now supports versions <7 and >8Nick Lewis2010-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running "/etc/rc.d/SERVICE rcvar" outputs different formats for different versions of FreeBSD. This patch adds support for those formats, as well as tests. Based on patches from: o Joost van Beurden o Russell Jackson Paired-With: Matt Robinson
* | | (#5079) Refactor and cleanup mcxcontent providerMatt Robinson2010-11-161-40/+23
| | | | | | | | | | | | | | | | | | | | | This is a rework for diff clarity of a patch submitted by Sandor Szuecs <sandor.szuecs@fu-berlin.de> Reviewed-by: Paul Berry <paul@puppetlabs.com>
* | | (#5079) Move methods around to make it clearer whether they're public or privateMatt Robinson2010-11-161-51/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One method was showing up as a private class method, which turns out isn't possible, so it got moved into the public section. This is a rework for diff clarity of a patch submitted by Sandor Szuecs <sandor.szuecs@fu-berlin.de> Reviewed-by: Paul Berry <paul@puppetlabs.com>
* | | (#3747) Add specs for upstart providerNick Lewis2010-11-111-4/+1
| | | | | | | | | | | | Paired-With: Matt Robinson
* | | (#3747) Implement upstart providerNan Liu2010-11-111-0/+76
| | |
* | | Merge commit '2.6.3rc2' into nextPaul Berry2010-11-091-1/+1
|\| | | | | | | | | | | | | | | | | Manually resolved conflicts: lib/puppet/parser/ast/resource.rb spec/unit/parser/ast/resource_spec.rb
| * | Fixed #5112 - Launchd Service broke in 2.6.2 with OS X 10.4 Clients.donavan2010-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just to follow up on 5112 I have a dirty patch that appears to work. Nominally tested it on 10.4, 10.5, & 10.6. 10.4 now applies catalogs instead of failing. All versions successfully manage a test services state as well. Does anyone have a better suggestion than '-o /dev/stdout'? Seems a mite hacky to me. Also I think that the 10.4 machines are going to a have a \ ( slash ) file in whatever puppets working dir was. plutil seems to have been interpreting as literal file name.
* | | Merge remote branch 'nigel/tickets/2.6.x/4382' into nextJesse Wolfe2010-10-181-1/+33
|\ \ \ | |/ / |/| |
| * | Make --mkusers work on OS X, we now find unused uid/gids if unspecifiedNigel Kersten2010-10-111-1/+33
| | | | | | | | | | | | like other platforms.
* | | Minimal fix for #4975 -- only call chage when managing password age rulesMarkus Roberts2010-10-133-8/+11
| | | | | | | | | | | | | | | This is intended to be a minimal fix, with tests, to prevent chage from running unless needed.
* | | Fix for #4963 -- Use correct commands for password expiry on solarisMarkus Roberts2010-10-131-3/+3
|/ / | | | | | | | | This fixes the command / option issues of #4963 as suggested on the ticket; the setting-expiry when not needed aspects are deferred to #4975.
* | Reversion of 021d534482dd8edb863cb77d668ac3525362a0a6Markus Roberts2010-10-051-2/+1
| | | | | | | | This fix for #3707 was incorrect & just moved the problem (see #4929).
* | Adds #3046 - support for password min/max ageNick Lewis2010-09-295-13/+57
| | | | | | | | | | | | | | This adds a new feature to user providers "manages_password_age", along with properties password_min_age and password_max_age to the user type. These represent password min and max age in days. The useradd and user_role_add providers now support these new properties.
* | Add user account expiry to the useradd type and providerDean Wilson2010-09-291-1/+11
| |
* | Fixed #4025 (failure in launchd if certain plists are binary).Paul Berry2010-09-291-9/+16
| | | | | | | | | | | | | | | | | | | | Modified the launchd provider to use OSX's "plutil" command to read plists. This allows it to handle properly lists in both XML format and binary format. Launchd continues to write out propertly lists in XML format. This is not a problem because the operating system is able to understand both formats.
* | Fix #4267 - Create a backup before dropping permissionsJesse Wolfe2010-09-281-0/+7
| | | | | | | | | | This change just forces a file to be written to the filebucket before we drop the permissions necessary to do so.
* | Fix for #4746 -- Newline goes at the _end_ of the lineMarkus Roberts2010-09-221-1/+1
| | | | | | | | Fredrik Eriksson's suggested change, from the ticket.
* | Fixed #3707 - rpm, like dpkg-query exits 1 if the package is not installed. ↵James Turnbull2010-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | Returning nil in this provider had the effect that on every run, puppet would end up calling yum erase . Returning the correct data structure resolves this. Thanks to Stephen Gran for the patch
* | Skip apt-listbugs and apt-listchanges when installing from puppetDean Wilson2010-09-041-0/+4
| |
* | Updated all types to Markdown outputJames Turnbull2010-08-1129-40/+40
|/ | | | | | | | | | Updated defaults.rb to Markdown Migrated report documentation to Markdown Migrated Naginator doco to Markdown Updated provider documentation to Markdown
* Fixes errant Trac references in documentationJames Turnbull2010-07-152-2/+2
|
* Code smell: Two space indentationMarkus Roberts2010-07-0985-7053/+7053
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Avoid needless decorationsMarkus Roberts2010-07-0915-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 704 occurances of (.*)\b([a-z_]+)\(\) with \1\2 3 Examples: The code: ctx = OpenSSL::SSL::SSLContext.new() becomes: ctx = OpenSSL::SSL::SSLContext.new The code: skip() becomes: skip The code: path = tempfile() becomes: path = tempfile * Replaced 31 occurances of ^( *)end *#.* with \1end 3 Examples: The code: becomes: The code: end # Dir.foreach becomes: end The code: end # def becomes: end
* Code smell: Don't restate results directly after assignmentMarkus Roberts2010-07-096-6/+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: Use ||= for conditional initializationMarkus Roberts2010-07-095-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Replaced 55 occurances of ([$@]?\w+) += +(.*) +(if +\1.nil\?|if +! *\1|unless +\1|unless +defined\?\(\1\))$ with \1 ||= \2 3 Examples: The code: @sync becomes: @sync The code: becomes: The code: if @yydebug becomes: if @yydebug
* Code smell: Omit needless checks on definedMarkus Roberts2010-07-094-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replaced 53 occurances of defined\?\((.+?)\) (?:and|&&) \1( |$) with \1\2 In code like: unless defined? @foo and @foo and bar("baz") "defined? @foo and @foo" can safely be replaced with "@foo": unless @foo and bar("baz") Because: * Both evaluate to false/nil when @foo is not defined * Both evaluate to @foo when @foo is defined 3 Examples: The code: @sync = Sync.new unless defined?(@sync) and @sync becomes: @sync = Sync.new unless @sync The code: unless defined?(@content) and @content becomes: unless @content The code: raise(ArgumentError, "Already handling indirection for #{@indirection.name}; cannot also handle #{indirection}") if defined?(@indirection) and @indirection becomes: raise(ArgumentError, "Already handling indirection for #{@indirection.name}; cannot also handle #{indirection}") if @indirection * Replaced 2 occurances of defined\?\((.+?)\) (?:and|&&) ! *\1.nil\? with !\1.nil? In code like: while defined? @foo and ! @foo.nil? ... "defined? @foo and ! @foo.nil?" can safely be replaced with "! @foo.nil?": while ! @foo.nil? ... Because: * Both evaluate to false/nil when @foo is not defined * Both evaluate to "! @foo.nil?" when @foo is defined 2 Examples: The code: !!(defined?(@value) and ! @value.nil?) becomes: !!(!@value.nil?) The code: self.init unless defined?(@@state) and ! @@state.nil? becomes: self.init unless !@@state.nil?