summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2.7.x'Nick Lewis2011-08-243-9/+0
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/feature/base.rb lib/puppet/file_serving/configuration.rb spec/unit/indirector/ssl_file_spec.rb spec/unit/parser/functions/extlookup_spec.rb spec/unit/resource/catalog_spec.rb test/language/ast/variable.rb
| * (#8272) Add missing tests for Windows service provider methods.Cameron Thomas2011-08-191-1/+1
| | | | | | | | | | | | | | | | | | Added missing spec tests for Windows service provider methods: :stop, :enable, :disable, and :manual_start Refactored to match Nick's previous work. Reviewed By: Nick Lewis [nick@puppetlabs.com] (cherry picked from commit d08ae7fd2180c95d1fcafa149128d25cc4680c6c)
| * (#8409) Add a default group provider for WindowsNick Lewis2011-08-191-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> (cherry picked from commit 01f09f5f395bab66b90a4e81e958aa89025977b4)
| * (#8408) Add a default user provider for WindowsNick Lewis2011-08-191-0/+71
| | | | | | | | | | | | | | | | | | | | | | This provider, windows_adsi, uses the Puppet::Util::ADSI module to manage users. It can currently only manage group memberships, comments, and home directories, which are the only fields that can be managed via ADSI. 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> (cherry picked from commit ac00e9e289f8fdc81f060e7dd289e1a8e0f133c0)
| * (#8644) Host provider on WindowsJosh Cooper2011-08-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host provider did not work on Windows because it didn't know where to find its hosts file. The provider now uses Win32::Resolv, which is part of the standard ruby library, to find it. Several host type/provider spec tests were marked as fails_on_windows, but now that the provider is working, I removed the tag from those tests, and verified that the tests now pass. There are two tests in resources_spec that fail because the user and exec providers are not supported on Windows yet, so those tests are marked as fails_on_windows. Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com> (cherry picked from commit 82c6b3cb41397c989c011cf767066bcf1e403db2)
| * (#8272) Allow disabled Windows services to be startedNick Lewis2011-08-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because Windows allows a service to be both running and disabled, we now support that capability. If a service is explicitly requested to be running and disabled, we will set it to manual start if necessary, start it, and then disable it. If the service is requested to be running and enabled, we will now enable it before attempting to start it (previously, this would simply try to start it and fail). The exception to this rule is a service which is disabled, and for which we are not managing the enable property. In that case, we assume that some other authority has disabled the service, and respect that, failing to start. Thus, if the user actually wants a service to be running and disabled, they must explicitly declare that intent. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 12d0018f93e5a72a728c6decffb351a693a86344)
| * (#8272) Use symbols instead of booleans for enabled property on WindowsNick Lewis2011-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Because the enable property of the service type uses :true and :false as its valid values, rather than true and false, we need to return :true and :false from our enabled? method. Otherwise, the property was being synced every time it was enabled or disabled, regardless of whether it was actually in sync or not. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 44e2d494f499e2005c1b31b92b97834189d4224d)
| * (#8272) Fixup logging in Windows service providerNick Lewis2011-08-191-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | We want to use self.debug for logging in the provider, so that log messages are properly associated with the resource, rather than generically coming from Puppet. Also fix the self.instances method to not use an unnecessary extra variable when collecting. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 38c181d00e87ecc699c6a3e23dd2155f716a6602)
| * Add basic service provider for WindowsCameron Thomas2011-08-191-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provider allows us to query the system state through "puppet resource", and manage the ensure, and enabled properties of services on Windows. This also adds support for a new enabled value of 'manual' on Windows only. With this we support the three major start types for services on Windows, with the following mapping of enabled to start type: true => Automatic false => Disabled manual => Manual (Demand) We use the win32-service gem to provide access to the Windows APIs for our operations. This does add a new gem requirement for running Puppet on Windows, but we were already requiring some gems from the same suite that win32-service is a part of. When referring to a service, the simple service name must be used, instead of the display name. For example, "snmptrap", instead of "SNMP Trap". All system services are reported in 'puppet resource service', including those started prior to run level 3 (system, device drivers, etc.). These services should probably not be managed, without careful thought and planning. This currently does not support being able to move a service from {enabled => false, ensure => stopped} to {enabled => true, ensure => running} (or enabled => manual) in a single Puppet run, since Puppet currently always tries to sync ensure before any other property. Because of this, the puppet run will fail every time, and the service must first be managed as {ensure => stopped, enabled => true} (or enabled => manual), before it can be managed as running and automatic start or manual start. Reviewed by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 82476e8be41b62ce1767ab6854a72b481b917380)
| * maint: remove inaccurate copyright and license statements.Daniel Pittman2011-08-183-9/+0
| | | | | | | | | | | | | | | | | | | | | | For a while Luke, and other authors, injected a created tag, copyright statement, and "All rights reserved" into every new file they added to the Puppet project. This isn't really true, and we have a global license covering the code, so we have now stripped out all those old tags. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | Merge branch '2.7.x'Nick Lewis2011-08-161-16/+16
|\| | | | | | | | | | | Conflicts: lib/puppet/provider/augeas/augeas.rb spec/unit/node_spec.rb
| * (#5495) Remove dead Windows-specific code from posix exec providerNick Lewis2011-08-161-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | Because this provider only applies when the posix feature is present (and thus not the windows feature), it can never be used on Windows. Thus, the Windows-specific command handling is unnecessary and unused. Also added more specific error messages for the cases where a command doesn't exist, isn't a file, and isn't executable. These only apply when the command path is absolute (otherwise the message is simply command not found). Reviewed-By: Matt Robinson <matt@puppetlabs.com>
| * Merge pull request #22 from domcleal/tickets/2.7.x/8808Daniel Pittman2011-08-121-3/+5
| |\ | | | | | | (#8808) Fail Augeas resource when unable to save changes
| | * (#8808) Fail Augeas resource when unable to save changesDominic Cleal2011-08-061-3/+5
| | | | | | | | | | | | | | | Raise a failure when Augeas changes cannot be saved (due to invalid layout of the tree, permissions etc). Fixes a regression.
| | * Revert "Merge branch 'vcsrepo'"Jacob Helwig2011-08-026-625/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vcsrepo is available in a module of its own, is missing tests, and goes against the long-term goal of moving "extra" types out of core puppet into modules (an example of this is the nagios types). This reverts commit 25b967559dfa39eb094008c7a3952c4ee885530b, reversing changes made to b87a1dea704ed981f2f0af728afac2c63e87b5a8. Reviewed-by: Michael Stahnke <mike@puppetlabs.com>
* | | Merge branch '2.7.x'Matt Robinson2011-08-158-630/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (25 commits) (#4411) Explain that runinterval = 0 does not mean "never run" Maint: Fix missing option text in puppet agent and arrange options alphabetically (#8302) Improve documentation of exec providers (#7853) Clarify and complete docs for the tagmail report processor Maint: Mention that audit metaparameter will accept "all" Maint: Adjust wording for file type's content parameter Maint: Fix poor documentation for versioncmp function. maint: Fix case sensitive require maint: Add inspect app options to help maint: Fix inspect help Increment lib/puppet.rb VERSION string Updated CHANGELOG for 2.7.3rc1 (#4762) Ensure that clients on the moon can successfully connect. Add document outlining preferred contribution methods Add document outlining preferred contribution methods Add document outlining preferred contribution methods Revert "Merge branch 'vcsrepo'" Revert "Merge branch 'vcsrepo'" Updating CHANGELOG for 2.7.2rc3 (#8704) Give better errors for invalid fileserver.conf ... Manually Resolved Conflicts: lib/puppet/parser/functions/versioncmp.rb spec/integration/node/facts_spec.rb
| * | Merge branch '2.6.x' into 2.7.xMatt Robinson2011-08-102-5/+17
| |\ \ | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#8302) Improve documentation of exec providers Add document outlining preferred contribution methods
| | * | (#8302) Improve documentation of exec providersnfagerlund2011-08-102-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | The documentation for the shell and posix providers didn't fully explain the differences between them or the security implications of each. This commit improves the documentation of both providers.
| * | | Revert "Merge branch 'vcsrepo'"Jacob Helwig2011-08-026-625/+0
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | vcsrepo is available in a module of its own, is missing tests, and goes against the long-term goal of moving "extra" types out of core puppet into modules (an example of this is the nagios types). This reverts commit 25b967559dfa39eb094008c7a3952c4ee885530b, reversing changes made to b87a1dea704ed981f2f0af728afac2c63e87b5a8. Reviewed-by: Michael Stahnke <mike@puppetlabs.com>
* | | Merge pull request #23 from domcleal/tickets/master/5606Daniel Pittman2011-08-121-5/+24
|\ \ \ | | | | | | | | (#5606) Print Augeas' /augeas//error info to debug on save failure
| * | | (#5606) Print Augeas' /augeas//error info to debug on save failureDominic Cleal2011-08-071-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | When saving fails, the contents of /augeas//error (for put_failed) are printed to the debug log. Should help users track down the issue without needing to replicate it with augtool.
| * | | (#8808) Fail Augeas resource when unable to save changesDominic Cleal2011-08-071-3/+5
| | | | | | | | | | | | | | | | | | | | Raise a failure when Augeas changes cannot be saved (due to invalid layout of the tree, permissions etc). Fixes a regression.
* | | | (#8272) Add missing tests for Windows service provider methods.Cameron Thomas2011-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added missing spec tests for Windows service provider methods: :stop, :enable, :disable, and :manual_start Refactored to match Nick's previous work. Reviewed By: Nick Lewis [nick@puppetlabs.com]
* | | | (#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>
* | | | (#8408) Add a default user provider for WindowsNick Lewis2011-08-101-0/+71
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | This provider, windows_adsi, uses the Puppet::Util::ADSI module to manage users. It can currently only manage group memberships, comments, and home directories, which are the only fields that can be managed via ADSI. 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>
* | | (#8644) Host provider on WindowsJosh Cooper2011-07-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host provider did not work on Windows because it didn't know where to find its hosts file. The provider now uses Win32::Resolv, which is part of the standard ruby library, to find it. Several host type/provider spec tests were marked as fails_on_windows, but now that the provider is working, I removed the tag from those tests, and verified that the tests now pass. There are two tests in resources_spec that fail because the user and exec providers are not supported on Windows yet, so those tests are marked as fails_on_windows. Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com>
* | | (#8272) Allow disabled Windows services to be startedNick Lewis2011-07-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because Windows allows a service to be both running and disabled, we now support that capability. If a service is explicitly requested to be running and disabled, we will set it to manual start if necessary, start it, and then disable it. If the service is requested to be running and enabled, we will now enable it before attempting to start it (previously, this would simply try to start it and fail). The exception to this rule is a service which is disabled, and for which we are not managing the enable property. In that case, we assume that some other authority has disabled the service, and respect that, failing to start. Thus, if the user actually wants a service to be running and disabled, they must explicitly declare that intent. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | (#8272) Use symbols instead of booleans for enabled property on WindowsNick Lewis2011-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the enable property of the service type uses :true and :false as its valid values, rather than true and false, we need to return :true and :false from our enabled? method. Otherwise, the property was being synced every time it was enabled or disabled, regardless of whether it was actually in sync or not. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | (#8272) Fixup logging in Windows service providerNick Lewis2011-07-261-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to use self.debug for logging in the provider, so that log messages are properly associated with the resource, rather than generically coming from Puppet. Also fix the self.instances method to not use an unnecessary extra variable when collecting. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | Add basic service provider for WindowsCameron Thomas2011-07-221-0/+101
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provider allows us to query the system state through "puppet resource", and manage the ensure, and enabled properties of services on Windows. This also adds support for a new enabled value of 'manual' on Windows only. With this we support the three major start types for services on Windows, with the following mapping of enabled to start type: true => Automatic false => Disabled manual => Manual (Demand) We use the win32-service gem to provide access to the Windows APIs for our operations. This does add a new gem requirement for running Puppet on Windows, but we were already requiring some gems from the same suite that win32-service is a part of. When referring to a service, the simple service name must be used, instead of the display name. For example, "snmptrap", instead of "SNMP Trap". All system services are reported in 'puppet resource service', including those started prior to run level 3 (system, device drivers, etc.). These services should probably not be managed, without careful thought and planning. This currently does not support being able to move a service from {enabled => false, ensure => stopped} to {enabled => true, ensure => running} (or enabled => manual) in a single Puppet run, since Puppet currently always tries to sync ensure before any other property. Because of this, the puppet run will fail every time, and the service must first be managed as {ensure => stopped, enabled => true} (or enabled => manual), before it can be managed as running and automatic start or manual start. Reviewed by: Jacob Helwig <jacob@puppetlabs.com>
* | Merge branch '2.7.x'Matt Robinson2011-06-061-17/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (#7624) Manually fetch all properties in instances. (#7193) Fix path issues with acceptance tests that call old shell tests (#7632) Make secret_agent application compatible with secret_agent face (#7624) Auditing should not be enabled by default for purged resources. maint: Confine augeas specs to require the augeas feature (#2728) Add diff output for changes made by Augeas provider
| * | (#2728) Add diff output for changes made by Augeas providerMichael Knox2011-06-021-17/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Utilising Augeas's SAVE_NEWFILE mode (similar to augtool -n) to determine the changes that will be made be made by Augeas. Output a unified diff to info handle non-default root, and multiple files correctly Adding tests for Augeas diff functionality Add test for non-default :root when diff'ing Ensure that multiple files are diffed if changed, not just one Signed-off-by: Josh Cooper <josh@puppetlabs.com> Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
| * | Added the vcsrepo type and providers to the coreJames Turnbull2011-05-236-0/+625
| | |
* | | maint: Fix pacman provider to work with Ruby 1.9Matt Robinson2011-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 doesn't allow the lambda to walk up the directory structure to require the spec helper This is the same issue as with commit: f6da3339f59bbd9243a03dc1e417b1fed7955c7e Also, you can't call each on a string in Ruby 1.9 directly since it doesn't implicitly do a split on \n like it did in older Rubies, but each_line works all the way back to 1.8.5 Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Added the vcsrepo type and providers to the coreJames Turnbull2011-05-236-0/+625
| | |
* | | Merge branch '2.7.next' into nextPieter van de Bruggen2011-05-172-6/+18
|\| |
| * | (#7114) Target returns correct valueStefan Schulte2011-05-161-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the ssh_authorized_key parsedfile provider to return the current target value instead of the should value. Without this change puppet always thinks that the target property is in sync and thus will never move one key to the correct file. Reviewed-By: Nick Lewis Reviewed-By: Josh Cooper
| * | Merge branch 'ticket/2.7.x/7300' into 2.7.nextNick Lewis2011-05-161-0/+18
| |\ \
| | * | (#7300) Fix instances method of mount providerStefan Schulte2011-05-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The instance method now behaves like the prefetch method: After parsing /etc/(v)fstab run mount to update the ensure state from either :unmounted to :mounted and from :absent to :ghost Reviewed-By: Nick Lewis Reviewed-By: Josh Cooper
* | | | (#1853) Pacman package providerPaul Boyd2011-05-161-0/+94
|/ / / | | | | | | | | | | | | | | | | | | Adds support for use Archlinux's pacman package manager in Puppet. Originally written by Miah Johnson, with bug fixes from Thomas Hatch and myself.
* | | Merge branch '2.6.x' into 2.7.nextDaniel Pittman2011-05-121-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | Fix conflicts in the changelog, and one agent spec in favour of the 2.7.next version of the code. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
| * | (#6845) Mount writes incorrect vfstab entriesStefan Schulte2011-04-281-1/+1
| | | | | | | | | | | | | | | Facter[:operatingsystem] will not retrieve the operatingsystem as a string so puppet will always write fstab entries.
* | | Merge branch '2.6.next' into 2.7.nextMax Martin2011-04-272-9/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: (#3420) Nagios "name" attribute does not output correctly (#4487) When setting environment on a host, ensure it is a string. add test for ticket 7101 (#6487) Add some testing for OS X version support in DirectoryService provider (#6487) Directoryservice provider will fail in future OS releases
| * | Merge branch 'tickets/2.6.next/3420' into 2.6.nextJosh Cooper2011-04-261-1/+9
| |\ \
| | * | (#3420) Nagios "name" attribute does not output correctlyJim Pirzyk2011-04-261-1/+9
| | | |
| * | | (#6487) Directoryservice provider will fail in future OS releasesGary Larizza2011-04-221-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes a case statement in the get_exec_pramble and single_report methods. In its place is an if statement that will cause Puppet to fail if its being run on an OS X system with a version < 10.4. This if-statement will also allow Puppet to run in 10.7. Signed-off-by: Gary Larizza <ccshots@gmail.com>
* | | | Merge branch '2.6.next' into 2.7.nextJosh Cooper2011-04-211-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Manually resolved conflicts: lib/puppet/parser/resource.rb lib/puppet/parser/scope.rb spec/unit/parser/scope_spec.rb
| * | | Merge remote branch 'james/tickets/2.6.x/6681' into 2.6.nextJames Turnbull2011-04-141-0/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * james/tickets/2.6.x/6681: Fixed #6681 - Remove --force-yes option from aptitude is used
| | * | | Fixed #6681 - Remove --force-yes option from aptitude is usedJames Turnbull2011-03-121-0/+1
| | |/ /
* | | / (#7021) Fix order dependent spec failuresMatt Robinson2011-04-211-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running: rspec spec/unit/util/network_device_spec.rb spec/integration/transaction_spec.rb Caused Mocha::ExpectationError: unexpected invocation: #<Mock:device>.command() The NetworkDevice class had a current reader that once set, never got unset and lived between tests. Paired-with: Josh Cooper <josh@puppetlabs.com>