summaryrefslogtreecommitdiffstats
path: root/lib/puppet/configurer.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '0.25.x'Markus Roberts2010-02-091-0/+32
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppet.rb lib/puppet/configurer.rb man/man5/puppet.conf.5 spec/integration/defaults.rb spec/unit/configurer.rb
| * Partial reversion of patch for #3088 to fix #3104 (Exception misreported)Markus Roberts2010-01-241-2/+2
| | | | | | | | | | | | | | In my patch for #3088 I made a erroneous assumption about the ruby exception hierarchy and thus missed the fact that Timeout::error descends from both SignalError and Interrupt. This is a partial reversion of the patch for #3088 to let these through so that more useful error messages can be produced.
| * Fix for #3088 (catching Exception also traps SystemExit)Markus Roberts2010-01-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Changing rescues from the default to Exception (to catch errors that don't descend from StandardError) had the unintended consequence of catching (and suppressing) SystemExit. This patch restores the behavior of by reraising the exception. Of the other exceptions that fall through the same crack (NoMemoryError, SignalException, LoadError, Interrupt, NotImplementedError, and ScriptError) this patch also reraises NoMemoryError, SignalException, and Interrupt in the same way and leaves the rest captured.
| * Fixing #2914 - pre/post hooks now work for transactionsLuke Kanies2010-01-181-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was built to be used with etckeeper to version control files in /etc, but can be used for essentially anything. This patch was built to be added to 0.25.4, so it's a least-modify approach. A better approach would be to refactor application/puppet.rb just a bit so it uses Configurer more. This is a simple patch - it just defines 'prerun_command' and 'postrun_command' settings, and runs the appropriate command around each transaction if they're set. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* | Fixing #1054 - transaction reports are always sentLuke Kanies2010-01-181-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This refactors how reports, catalogs, configurers, and transactions are all related - the Configurer class manages the report, both creating and sending it, so the transaction is now just responsible for adding data to it. I'm still a bit uncomfortable of the coupling between transactions, the report, and configurer, but it's better than it was. This also fixes #2944 and #2973. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing unused configurer codeLuke Kanies2010-01-181-6/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.25.x'Luke Kanies2009-12-211-2/+8
|\| | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppetd.rb lib/puppet/parser/ast/leaf.rb lib/puppet/util/rdoc/parser.rb
| * Fix for #2661 and related issuesMarkus Roberts2009-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If setup code for a process depends on network connectivity it needs to be protected with a rescue clause as much as the main body of the process. Further, Timeout exceptions aren't under StandardError and thus aren't caught by an un-typed rescue clause. This doesn't matter if we've morphed the exception, but will cause the program to fail if we haven't. There are many places where these concerns _might_ cause a problem but in most cases they never will in practice; this patch addresses the five cases where I have been able to confirm that it actually can cause the client daemon to exit and two more where I suspect (but can not prove) that it could. This is an extension of the prior patch to cover additional cases found by automated testing (repeated catalog runs with a 1% chance of timeout forced on all timeout-bound operations, ~5000 runs). The new cases recurred multiple times (>100 each) and in a final pass with these corrected (~2500 runs) no additional cases were found.
| * Fix #2769 - default schedule are not definedBrice Figureau2009-11-051-0/+1
| | | | | | | | | | | | | | It seems we never finalize the catalog, so the various default resources are never created including the default schedules. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Revised partial fix for #2661 and related issuesMarkus Roberts2009-10-271-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If setup code for a process depends on network connectivity it needs to be protected with a rescue clause as much as the main body of the process. Further, Timeout exceptions aren't under StandardError and thus aren't caught by an un-typed rescue clause. This doesn't matter if we've morphed the exception, but will cause the program to fail if we haven't. There are many places where these concerns _might_ cause a problem but in most cases they never will in practice; this patch addesses the two cases where I have been able to confirm that it actually can cause the client daemon to exit and two more where I suspect (but can not prove) that it could. I'd be willing to push this patch as it stands, as it at least fixes demonstrable problems. A more general solution would be nice.
* | Fix #1934 - detailed-exitcodes for puppetdDeepak Giridharagopal2009-11-191-2/+6
|/ | | | | | | | | | | | | | | | | | | | | | This option only works when --onetime is specified, as it doesn't make much sense to worry about exit codes in the context of a long-running daemon. This required a refactoring of the existing --detailed-exitcodes code, as "puppetd" wasn't directly creating a transaction object (like "puppet" does). Added Report::exit_status, which did what was previously hard-coded into the "puppet" executable. An Agent's "run" method now returns a value (the result of the individual client class' "run" method) The "puppetd" agent's "run" method now returns a transaction report, as that seems like the logical thing to return as the result of applying a catalog. Signed-off-by: Deepak Giridharagopal <deepak@brownman.org>
* Fixed #2562 - Recognize the usecacheonfailure option againJohn A. Barbuto2009-08-211-0/+5
| | | | Signed-off-by: John A. Barbuto <jbarbuto@corp.sourceforge.com>
* Adding #2477 - puppet can apply provided catalogsLuke Kanies2009-08-021-1/+3
| | | | | | | | | | | | This provides the other half of #2440 - you can compile catalogs into json with puppetmasterd, and now you can take those json catalogs and apply them. This allows you to use whatever mechanism you want to ship the catalogs around. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-2/+2
|
* Logging when a cached catalog is used.Luke Kanies2009-05-281-0/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix configurer to retrieve catalog with client certnameBrice Figureau2009-04-231-1/+1
| | | | | | | | | | | | | | | | | Rationale: Before this change, the catalog was retrived with this uri: /catalog/hostname On the server side, the corresponding node was found by using the request node, then finding if this node also match hostname (which it does of course). But it is not possible to have an ACL matching the hostname part of the uri, because it: * it would be compared to the node name (certname), which obviously is not the same * it is not possible to create a dynamic allow/deny rule on a non-fqdn Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2149 - Facts are passed as part of the catalog requestLuke Kanies2009-04-221-4/+7
| | | | | | | | | | | | | | | This removes the requirement of shared fact caching on the servers, since the server responding to the catalog request will receive the facts as part of the request. The facts are serialized as a parameter to the request, rather than each being set as a separate request parameter. This hard-codes yaml as the serialization format for the facts, because I couldn't get marshal to work and it's just not as big a deal for such a small amount of data. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-261-2/+2
| | | | semicolons
* Actualling syncing facts and pluginsLuke Kanies2009-02-141-0/+2
| | | | | | | | Also fixing the argument order while downloading either of them. I had my Downloader.new calls using the wrong argument order. Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing how the Configurer interacts with the cacheLuke Kanies2009-02-061-2/+2
| | | | | | | | | This changes the hooks provided via the Indirector Request for determining how the cache is used. These hooks are only used by the Configurer class. They're messy, but I can't come up with a better design, and they're at least sufficient. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing restart-handling from ConfigurerLuke Kanies2009-02-061-21/+0
| | | | | | This will be handled by the Agent or the Daemon class. Signed-off-by: Luke Kanies <luke@madstop.com>
* Splitting the Agent class into Agent and ConfigurerLuke Kanies2009-02-061-0/+185
Once I went to add runinterval support to the Agent class, I realized it's really two classes: One that handles starting, stopping, running, et al (still called Agent), and one that handles downloading the catalog, running it, etc. (now called Configurer). This commit includes some additional code, but 95% of it is just moving code around. Signed-off-by: Luke Kanies <luke@madstop.com>