summaryrefslogtreecommitdiffstats
path: root/lib/puppet
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid setting the timeout before we know which timeout we should set.David Schmitt2010-02-171-4/+4
| | | | Signed-off-by: David Schmitt <david@dasz.at>
* Avoid trying to lock on non-filesDavid Schmitt2010-02-171-0/+2
| | | | This is not supported on windows and makes little sense on POSIX
* Removing obsolete FCollection stub from FunctionsLuke Kanies2010-02-171-6/+0
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Functions are added to a module instead of ScopeLuke Kanies2010-02-172-3/+22
| | | | | | | | | | | | | | | | | We were previously adding them directly to Scope, but now they're in a module that Scope includes. This is the first half of #1175 - we can now maintain environment-specific collections of functions. We need some way of tracking which environment a given function is loaded from. Well, maybe it's the first third - the core functions probably need to be added to all of these modules, or there needs to be a 'common' module that is included by all of them. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Slightly restructuring "Functions" fileLuke Kanies2010-02-171-7/+4
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* [#3921] Add facts_terminus setting to Puppet settingsRein Henrichs2010-02-173-3/+5
| | | | * defaults to "facter"
* [#3921] Remove unnecessary require 'puppet/resource'Rein Henrichs2010-02-177-57/+55
| | | | | | * Remove require statements * explicity define namespace modules/classes for Puppet::Resource::Status to avoid require dependency cycle.
* Fix for #3949 and relatedMarkus Roberts2010-02-171-2/+3
| | | | | | | Syck/Yaml quietly passes on undefined classes as strings, so that if objects of those classes are loaded and re-serialized they passthrough unmodified. While not technically correct, it's still the POLS behavior, and we now support it.
* Fixed #3912 - Added client certificate name as an internal fact called ↵James Turnbull2010-02-171-0/+1
| | | | "clientcert"
* {#3866] Rename the method metaclass to singleton_class to avoid the ↵Matt Robinson2010-02-176-11/+11
| | | | | | | | | | | | deprecation warnings from Rails ActiveSupport The metaid.rb file came straight from why the lucky stiff's "seeing metaclasses clearly" article. Rails used this too, but they recently deprecated the name metaclass in favor of singleton_class to match what ruby-core decided to do. meta, eigen and singlton class were all suggested and in the end singleton was agreed upon. http://redmine.ruby-lang.org/issues/show/1082
* Fixing #3822 - checksums will be loaded from filebucketsLuke Kanies2010-02-171-18/+36
| | | | | | | | | | | | If you have the following code or equivalent: file { "/foo": content => "{md5}foobar" } Puppet will attempt to pull the content associated with that file from whatever the default filebucket is for the resource in question. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* fooLuke Kanies2010-02-171-1/+1
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* For #3822 - Reducing checksum code duplicationLuke Kanies2010-02-173-45/+72
| | | | | | | | | | | The FileBucket code had a bunch of checksum code that was already available in a library, and it used a checksum format (type + data) that was incompatible with what we were using everywhere else. This just fixes that code duplication. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixed unsupported perlstyle regex and few other minor bugsRoss West2010-02-171-26/+42
| | | | Signed-off-by: Ross West <westr@connection.ca>
* Signed-off-by: Ross West <westr@connection.ca>Ross West2010-02-171-202/+185
| | | | Code cleanup/spacing fixed
* Signed-off-by: Ross West <westr@connection.ca>Ross West2010-02-171-0/+252
| | | | | | | | | | | Description: - Initial submission of new freebsd package manager for ports (portupgrade.rb) Dependencies: - Ports system application (ports-mgmt/portupgrade) Notes: - Package[:name] needs to be the origin code of the port (eg: "ports-mgmt/portupgrade")
* Fixing #3791 - client environment is usedLuke Kanies2010-02-171-3/+19
| | | | | | | | | | | | | Node#environment wasn't being set correctly, in that it had to have the right answer out of the gate or it was never corrected. It was lazy-binding in 0.25 but I managed to make it no longer that way. This resulted in the environment basically not being set during compilation, so the default server environment was always used. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Bug #3748 LDAP group membershipMatt Robinson2010-02-171-1/+1
| | | | | | | | LDAP group membership comparison was happening on an unsorted string. Sorting the string for now, may want to do something smarter by comparing something other than strings later. Signed-off-by: Matt Robinson <matt@puppetlabs.com>
* Fix for 3664: interpolating qualified variables.Markus Roberts2010-02-171-9/+9
| | | | | | | | | | "${myclass::var}" was lexed as a CLASSNAME instead of a VARIABLE token, giving an error while parsing because a rvalue can't be a bare CLASSNAME token. This commit (based of Brice's) fixes it by restricting the contexts in which the CLASSNAME and CLASSREF tokens are acceptable, analagous with the handling for NAME tokens.
* Fix #3664 - qualified variable parsing in string interpolationBrice Figureau2010-02-171-4/+6
| | | | | | | | | | | "${myclass::var}" was lexed as a CLASSNAME instead of a VARIABLE token, giving an error while parsing because a rvalue can't be a bare CLASSNAME token. This patch fixes the issue by making VARIABLE lexing higher priority than CLASSNAME. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Feature #2935 remove misleading commentJesse Wolfe2010-02-171-4/+1
| | | | | | Remove a stale comment about how settings work Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Unify the codepaths for setting settingsJesse Wolfe2010-02-171-6/+14
| | | | | | | | | There are two codepaths for setting settings in the settings object: one for setting individual settings, and one was setting settings in mass, like in the system settings file. This patch unifies some of that logic. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Puppet[:mode] and Puppet[:name] are read-onlyJesse Wolfe2010-02-171-6/+18
| | | | | | | | | Historically, the Puppet[:name] setting has been settable, but the results of chaning it are poorly defined. The switch to modes instead of executable names seems like a good time to disable this complexity. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Bug: Broken codepath in util/settingsJesse Wolfe2010-02-171-1/+1
| | | | | | | | | An incorrect variable name is used in an error message, causing the error to throw an error. This can't appear in the wild, since it's actually just an argument check for the defaults.rb file. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 settings are in Mode sections instead of executable namesJesse Wolfe2010-02-171-28/+8
| | | | | | | A process's settings are now determined by Puppet::Mode rather than by the executable name. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: method extract require_applicationJesse Wolfe2010-02-171-1/+5
| | | | | | | It's useful to be able to require specific applications' ruby source by name, even if we aren't about to run them. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: Test for if we're "puppet cert"Jesse Wolfe2010-02-171-1/+1
| | | | | | | | | Fix breakage caused by changing the name of "puppetca" It's not clear to me what the ideal answer for this is: I don't think that "cert" should be a type of Puppet::Mode, so I'm not sure how to model it more intelligently than as the command-line name. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Code cleanup: remove "self." from setdefaultsJesse Wolfe2010-02-171-6/+6
| | | | | | | | defaults.rb was cluttered with unnessesary "self." decorations. I removed them in preparation for a refactor of where settings are handled, but that change has been postponed. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Modes: root? predicateJesse Wolfe2010-02-176-6/+10
| | | | | | | Use a predicate method to check if we're running as root, rather than comparing the effective user id Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Puppet::Mode#master?Jesse Wolfe2010-02-178-10/+7
| | | | | | | Use a predicate function on the Mode object instead of comparing with the executable name everywhere Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2276 Single Executable: Update docstringsJesse Wolfe2010-02-1712-59/+56
| | | | | | | Update documentation strings everywhere to use single-executable notation rather than the old executable names. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* feature #2276 Single Executable: use new names for settings sectionsJesse Wolfe2010-02-175-8/+8
| | | | | | | | The puppet-internal settings sections aren't actually exposed to the user, but to reduce confusion I've renamed them to be consistent with the single-executable application names. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: Applications should declare modesJesse Wolfe2010-02-174-0/+4
| | | | | | Add declarations for each application's run mode. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: lazify require graph for applicationsJesse Wolfe2010-02-1712-167/+163
| | | | | | | | | Because environments have to declare their mode before puppet tries to load defaults.rb, it reduces the complexity considerably to have application classes to load their lib dependencies at the last possible moment. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: Puppet::ModeJesse Wolfe2010-02-173-48/+90
| | | | | | | | Create a Mode class and Puppet.mode and application.mode methods Mode can be "agent", "master", or "user". Each application sets a mode. The Mode object has some smarts about the defaults for that mode. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2276 Single Executable: usage messageJesse Wolfe2010-02-171-1/+1
| | | | | | The usage message should show the single-executable variant of commands. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* feature #2276 Single Executable: move CommandLine methodsJesse Wolfe2010-02-173-47/+36
| | | | | | | move Util::CommandLine methods into instances instead of on the class, as suggested by Markus Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #2658 - adding backward compatibility for 0.24Luke Kanies2010-02-175-40/+27
| | | | | | | | | | | | | The way stages were implemented caused backward compatibility to be completely broken for 0.24.x. This commit fixes that, mostly by assuming Stage[main] will be the top node in the graph rather than Class[main]. Other stages are not supported in 0.24.x, and explicitly throw a warning (although not an error). Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Adding #2658 - Adding support for run stagesLuke Kanies2010-02-175-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to specify a run stage for either a class or a resource. By default, all classes get directly added to the 'main' stage. You can create new stages as resources: stage { [pre, post]: } To order stages, use standard relationships: stage { pre: before => Stage[main] } Or use the new relationship syntax: stage { pre: } -> Stage[main] -> stage { post: } Then use the new class parameters to specify a stage: class { foo: stage => pre } If you set a stage on an individual resource, it will fail; stages can only be set on class resources. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #3671 - --compile Catalogs are pretty-printedLuke Kanies2010-02-171-1/+1
| | | | | | | | A simple fix for this one. This doesn't fix the general case, just the --compile case. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #2655 - Adding default parameter values to resourcesLuke Kanies2010-02-171-1/+5
| | | | | | | | We were previously just adding these values as variables in the local scope, but we now add them to the resources so they get passed to the client in the catalog and are thus inspectable. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing Catalog conversionLuke Kanies2010-02-171-1/+1
| | | | | | | | | | | Parser resources were not correctly being converted to Puppet::Resource instances, which meant a ton more information was being kept in the catalog. This probably didn't have much affect in real life, because of how we serialized, but it made debugging a lot harder. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #1903 - metaparam inheritance is much fasterLuke Kanies2010-02-172-18/+46
| | | | | | | | | | | | This doesn't actually fix the specific request in #1903, which said there should be no inheritance at all, but I've changed my mind on that. Static inheritance is good, it should just be faster. This change could result in up to 70% speed improvements in compiling. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing Parser::Resource param validationLuke Kanies2010-02-171-1/+1
| | | | | | It was previously not allowing false values. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixes #1999 - Allows the 'apt' provider to downgrade packages.Paul Lathrop2010-02-171-1/+2
| | | | | | | This is accomplished by adding the --force-yes option to the apt-get command line when a package version is specified. Signed-off-by: Paul Lathrop <plathrop@digg.com>
* Fixes #3745 Catch unhandled exception in ssh_authorized_key providerSean Millichamp2010-02-171-1/+5
| | | | | | | | | | | If the target is not specified it is automatically set to the user's home directory. If the user does not exist when the generation of the target path occurs then an ArgumentError exception is raised but not caught. This patch catches the ArgumentError and raises a Puppet::Error instead to more gracefully notify the user and allow any remaining resources to be applied. Signed-off-by: Sean Millichamp <sean@bruenor.org>
* Fixed #3721 - Removed -u option from crontab on HP-UXJames Turnbull2010-02-171-1/+1
|
* Fixes #3663 - It should be possible to list signed hosts onlyJames Turnbull2010-02-172-2/+10
| | | | Adds a --signed option to the --list feature that only displays signed certificates
* Fixing #448 - relationships have their own syntaxLuke Kanies2010-02-177-1760/+1845
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now specify relationships directly in the language: File[/foo] -> Service[bar] Specifies a normal dependency while: File[/foo] ~> Service[bar] Specifies a subscription. You can also do relationship chaining, specifying multiple relationships on a single line: File[/foo] -> Package[baz] -> Service[bar] Note that while it's confusing, you don't have to have all of the arrows be the same direction: File[/foo] -> Service[bar] <~ Package[baz] This can provide some succinctness at the cost of readability. You can also specify full resources, rather than just resource refs: file { "/foo": ensure => present } -> package { bar: ensure => installed } But wait! There's more! You can also specify a subscription on either side of the relationship marker: yumrepo { foo: .... } package { bar: provider => yum, ... } Yumrepo <| |> -> Package <| provider == yum |> This, finally, provides easy many to many relationships in Puppet, but it also opens the door to massive dependency cycles. This last feature is a very powerful stick, and you can considerably hurt yourself with it. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix #3408 - enable puppetd http compressionBrice Figureau2010-02-174-8/+132
| | | | | | | | | | | | | | | | | | | | | | | This patch adds HTTP response decompression (both gzip and deflate streams). This feature is disabled by default, and enabled with --http_compression. This feature can be activated only if the local ruby version supports the zlib ruby extension. HTTP response decompression is active for all REST communications and file sourcing. To enable http compression on the server side, it is needed to use a reverse proxy like Apache or Nginx with adhoc configuration: Nginx: gzip on; gzip_types text/pson text/json text/marshall text/yaml application/x-raw text/plain; Apache: LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so AddOutputFilterByType DEFLATE text/plain text/pson text/json text/marshall text/yaml application/x-raw Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>