summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Cisco Switch/Router Interface managementBrice Figureau2011-04-089-0/+496
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces managing remotely cisco IOS network devices through ssh or telnet with a puppet type/provider. This patch allows to manage router/switch interface with the interface type: interface { "FastEthernet 0/1": device_url => "ssh://user:pass@cisco2960.domain.com/", mode => trunk, encapsulation => dot1q, trunk_allowed_vlans => "1-99,200,253", description => "to back bone router" } It is possible with this patch to set interface: * mode (access or trunk) * native vlan (only for access mode) * speed (auto or a given speed) * duplex (auto, half or full) * trunk encapsulation * allowed trunk vlan * ipv4 addresses * ipv6 addresses * etherchannel membership The interface name (at least for the cisco provider) can be any shorthand interface name a switch or router can use. The device url should conform to: * scheme: either telnet or ssh * user: can be absent depending on switch/router line config * pass: must be present * port: optional * an optional enable password can be mentioned in the url query string Ex: To connect to a switch with a line password and an enable password: "telnet://:letmein@cisco29224XL.domain.com/?enable=letmeinagain" To connect to a switch/router through ssh and a privileged user: "ssh://brice:letmein@cisco1841L.domain.com/" Note: This patch only includes a Cisco IOS provider. Also terminology adopted in the various types are mostly the ones used in Cisco devices. This patch was tested against: * (really old) Cisco switch 2924XL with ios 12.0(5)WC10 * Cisco router 1841 with ios 12.4(15)T8 * Cisco router 877 with ios 12.4(11)XJ4 * Cisco switch 2960G with ios 12.2(44)SE Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Base class for network device based providersBrice Figureau2011-04-081-0/+59
| | | | | | | | | | | | | | This is the common bits of all future network device providers that are using prefetching/flushing to limit the number of calls to the remote network device. The idea is that we need one transaction to prefetch and one to flush each instance. Implementors needs to implement lookup which returns a hash of the found entity, and flush to update the remote device. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Ssh transport for network device managementBrice Figureau2011-04-082-0/+119
| | | | | | | It is an adapatation of net-ssh-telnet, so that net-ssh conforms to a saner interface for consumer. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Telnet transport to connect to remote network deviceBrice Figureau2011-04-081-0/+42
| | | | | | It is based on net/telnet. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Remote Network Device transport systemBrice Figureau2011-04-082-0/+31
| | | | | | | This is the base for upcoming telnet and ssh transport mechanism to send commands to network devices. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Introduce a module for some IP computationsBrice Figureau2011-04-081-0/+68
| | | | | | | Those will be used to parse IPs, compute netmaks or prefix length. Unfortunately ruby IPAddr doesn't support those directly. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Merge branch '2.6.x' into nextMax Martin2011-04-0710-37/+138
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (maint) Indentation fixes (#6490) Add plugin initialization callback system to core Fix #4339 - Locally save the last report to $lastrunreport Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml Fixed #3127 - removed legacy debug code Fixed #3127 - Fixed gem selection regex (#5437) Invalidate cached TypeCollection when there was an error parsing (#6937) Adjust formatting of recurse's desc (#6937) Document the recurse parameter of File type. (#6893) Document the cron type in the case of specials. (#5670) Don't trigger refresh from a failed resource Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9 Conflicts (Manually resolved): lib/puppet/application/agent.rb lib/puppet/application/apply.rb lib/puppet/configurer.rb lib/puppet/resource/type_collection.rb lib/puppet/type/file.rb spec/integration/configurer_spec.rb spec/unit/application/agent_spec.rb spec/unit/application/apply_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector/report/yaml_spec.rb spec/unit/resource/type_collection_spec.rb Paired-with: Nick Lewis
| * Merge branch '2.6.next' into 2.6.xMax Martin2011-04-0713-22/+90
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: Fix #4339 - Locally save the last report to $lastrunreport Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml Fixed #3127 - removed legacy debug code Fixed #3127 - Fixed gem selection regex (#5437) Invalidate cached TypeCollection when there was an error parsing (#6937) Adjust formatting of recurse's desc (#6937) Document the recurse parameter of File type. (#6893) Document the cron type in the case of specials. (#5670) Don't trigger refresh from a failed resource Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9
| | * Merge commit '647a640fcac281e3a8cda05b92b51c44c93f1d19' into 2.6.nextNick Lewis2011-04-071-1/+3
| | |\
| | | * (#6893) Document the cron type in the case of specials.Ben Hughes2011-03-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add in a better desc block for "specials" in cron provider, and outline it's limitations. The previous text was purely a placeholder.
| | * | Fix #4339 - Locally save the last report to $lastrunreportBrice Figureau2011-04-054-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the cache terminus system, when --report is on, we are now caching the last report as a yaml file in the $lastrunreport file (which by default is $statedir/last_run_report.yaml). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| | * | Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yamlBrice Figureau2011-04-054-16/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once a configuration run is done, puppetd will save on the node a yaml summary report roughly akin to: --- time: notify: 0.001025 last_run: 1289561427 schedule: 0.00071 config_retrieval: 0.039518 filebucket: 0.000126 resources: changed: 1 total: 8 out_of_sync: 1 events: total: 1 success: 1 changes: total: 1 This is almost an hash version of the current --summarize output, with the notable exception that the time section includes the last run unix timestamp. The whole idea is to be able to monitor locally if a puppetd does its job. For instance this could be used in a nagios check or to send an SNMP trap. The last_run information might help detect staleness, and this summary can also be used for performance monitoring (ie time section). The resource section can also show the number of failed resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| | * | Merge branch 'tickets/2.6.x/3127' into 2.6.nextJames Turnbull2011-04-051-1/+0
| | |\ \ | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/3127: Fixed #3127 - removed legacy debug code
| | | * | Fixed #3127 - removed legacy debug codeJames Turnbull2011-04-051-1/+0
| | | | |
| | * | | Merge branch 'tickets/2.6.x/3127' into 2.6.nextJames Turnbull2011-04-041-2/+3
| | |\| | | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/3127: Fixed #3127 - Fixed gem selection regex
| | | * | Fixed #3127 - Fixed gem selection regexJames Turnbull2011-04-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if the gem json_pure was installed and you requested the gem json then the regex matched too soon and falshly indicated that the json gem was already installed. Also updated to add the --no-ri and no-rdoc options and fix tests.
| | * | | Merge branch 'ticket/2.6.x/5437-report-manifest-errors-on-agent' into 2.6.nextJacob Helwig2011-04-012-1/+7
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/5437-report-manifest-errors-on-agent: (#5437) Invalidate cached TypeCollection when there was an error parsing
| | | * | | (#5437) Invalidate cached TypeCollection when there was an error parsingJacob Helwig2011-04-012-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The caching of the TypeCollection in Puppet::Node::Environment would cause parse errors to occur (and be reported) only once and never again, until the file had changed on disk. This would also cause empty catalogs to be sent down to the agents further hiding the problem. Now, when a file fails to parse, it will be re-parsed every time on every following compilation, causing the parse error to be reported every time, and preventing sending down empty catalogs to agents. Paired-with: Nick Lewis <nick@puppetlabs.com>
| | * | | | (#6937) Adjust formatting of recurse's descnfagerlund2011-04-011-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevous formatting would result in broken Markdown after the docs were generated, as Markdown does not recognize a two-space tab as a syntactical element. This patch also changes the list of values to a bulleted list instead of a code block.
| | * | | | (#6937) Document the recurse parameter of File type.Ben Hughes2011-04-011-1/+11
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the desc block with information gleaned from #1469 and the code about recurse => remote and other types of recursion. The auto generated documentation was sparse and this is an area that often comes up on the mailing list/IRC.
| | * / / (#5670) Don't trigger refresh from a failed resourceNick Lewis2011-03-301-1/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resources were triggering their subscribing/notified resources when they failed, which is incorrect. Now, events are only queued if the resource was successful. Paired-With: Max Martin
| * | | (maint) Indentation fixesMarkus Roberts2011-04-062-15/+13
| | | |
| * | | (#6490) Add plugin initialization callback system to coreMarkus Roberts2011-04-063-5/+100
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recurring pattern "drop-in code needs to have something done at startup" is presently being solved with a variety of ad-hock mechanism. This commit adds a general, extensible, centralized system for adding such hooks and manages an extensible set of metadata about plugins which it collects by searching for files named "plugin_init.rb" in a series of directories. Initially, these are simply the $LOAD_PATH. Applications can add more places to look for plugins without risk of adding duplicates or changing the order of ones that have already been found with: Puppet::Plugins.look_in(*paths) The contents of each file found is executed in the context of a Puppet::Plugins object (and thus scoped). An example file might contain: ------------------------------------------------------- @name = "Greet the CA" @description = %q{ This plugin causes a friendly greeting to print out on a master that is operating as the CA, after it has been set up but before it does anything. } def after_application_setup(options) if options[:application_object].is_a?(Puppet::Application::Master) && Puppet::SSL::CertificateAuthority.ca? puts "Hey, this is the CA! Hi everyone!!!" end end ------------------------------------------------------- Note that the instance variables are local to this Puppet::Plugin (and so may be used for maintaining state, etc.) but the plugin system does not provide any thread safety assurances, so they may not be adequate for some complex use cases. Presently supported hooks: before_application_preinit( :application_object => ... ) after_application_preinit( :application_object => ... ) before_application_parse_options( :application_object => ... ) after_application_parse_options( :application_object => ... ) before_application_setup( :application_object => ... ) after_application_setup( :application_object => ... ) before_application_run_command( :application_object => ... ) after_application_run_command( :application_object => ... ) on_commandline_initialization(:command_line_object => ... ) on_application_initialization(:appliation_object => ... ) Paired-with: Daniel Pitman
* | | Merge branch 'feature/next/resource_application_order' into nextMarkus Roberts2011-04-068-213/+259
|\ \ \
| * | | (5200) -- replace containers with sentinalsMarkus Roberts2011-04-065-110/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing containers with many-to-many relationships, we now replace them with a pair of sentinals (whits) that bracket them. Thus a graph consisting of two containers, each containing ten resources, and a dependency between the containers, which would have gone from 21 edges to 100 edges will instead have only 43, and a graph consisting of two containers (e.g. stages) each containing a similar graph, which would have gone from 45 edges to 400 will only go to 95. This change had minor consequences on many parts of the system and required lots of small changes for consistancy, but the core of it is in Catelog#splice! (which replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is just adjustments to the fact that some one-step edges are now two-step edges and tests, event propagation, etc. need to reflect that. Paired-with: Jesse Wolfe
| * | | (6911) Cleanup and renaming of transaction internalsMarkus Roberts2011-04-011-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The preceeding changes left some rough edges in the Transactions (a short, badly named method that was only used in one place and would be clearer in- line, a return value that was carfully retained and never used, etc.) This commit clears some of that up.
| * | | (6911) Core change -- replace topsort with frontier ordered by salted SHA1Markus Roberts2011-04-012-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the core change of the ticket; rather than using a topological sort to statically determine the order in which resources should be applied, we use the graph wrapper introduced in the prior commit to dynamically determine the order in which to apply resources based on 1) the status of the resource (ready, done) 2) the explicit & implied dependencies, 3) the salted SHA1 of the title (for stability). Further work is needed: 1) Resolving the handling of failed resources 2) Tests of the new behavior, to the extent posible 3) Newly-dead-code removal in simple_graph & transaction 4) Fix the name-prefix ordering hack in eval_generate by either: a) Moving the logic into file b) Refactoring Type#eval_generate to return a tree c) ....? 5) Rough performace testing to look for hotspots 6) Investigation of possible interaction with #3788, #5351, #5414, #5876, #6020, #6810, and #6944 which may simplify or complicate their resolution. Paired-with: Jesse Wolfe
| * | | (6911) Add bookkeeping facade around Transaction#relationship_graphMarkus Roberts2011-04-011-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To implement graph frontiers transactions need to track information about the catalog's relationship graph. For various reasons (serialzation, lifetime, etc.) the data belongs with the transaction rather than the catalog or its relationship graph. This commit introduces a facade around the property used to cheat Demeter which has the apropriate lifetime and can be used to hold the state information durring a traversal. Paired-with: Jesse Wolfe
| * | | (6911) Cleanup of generate_additional_resourcesMarkus Roberts2011-03-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit left only one meaningful value for the method parameter of generate_additional_resources, making it a constant not a parameter. This commit removes it. Paired-with: Jesse Wolfe
| * | | (6911) Refactor to localize eval_generate dependency assumptionsMarkus Roberts2011-03-314-89/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To implement #6911 we will need to be able to make incremental descisions about order of application based only on the contents of the resource graph and local "working data." This commit begins to pull the needed structure into a method (visit_resources) while, for the moment, maintaining the original semantic. Paired-with: Jesse Wolfe
| * | | (maint) Fix for require order issueMarkus Roberts2011-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The recent AIX work added a dependency on Puppet::Parameter::Keyvalue in the group type, but didn't add the requisite require, causing failures under some load orders.
| * | | (6911) Use normal methods to implement "depthfirst?" testMarkus Roberts2011-03-303-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a class instance variable that was used to determine if a resource types's children should be processed before or after the parent, to support the one type (tidy) which did this. Instead, we define a normal function in Type to return false and override it in Tidy to return true. Paired-with: Jesse Wolfe
* | | | (Maint) Fix uninitialized constant.Pieter van de Bruggen2011-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | err: Could not apply complete catalog: Could not autoload group: uninitialized constant Puppet::Property::KeyValue Encountered this while generating certificate requests via Puppet Strings/Faces, which doesn't load the full Puppet stack by default. Paired-With: Matt Robinson
* | | | Merge branch 'feature/master/5528-certificates_signing_api' into nextMax Martin2011-04-055-14/+161
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * feature/master/5528-certificates_signing_api: (#5528) Add REST API for signing, revoking, retrieving, cleaning certs
| * | | | (#5528) Add REST API for signing, revoking, retrieving, cleaning certsMax Martin2011-04-055-14/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new Indirector terminus, certificate_status, which allows for signing, revoking, listing, and cleaning SSL certificates over HTTP via REST. Documentation for these new features can be found in our REST API documentation on the docs site: http://docs.puppetlabs.com/guides/rest_api.html This documentation has not been updated as of the writing of this commit, but will be very soon. Puppet::SSL::Host is now fully integrated into the Indirector. Paired-with:Matt Robinson, Jacob Helwig, Jesse Wolfe, Richard Crowley, Luke Kanies
* | | | | (#6937) Document the recurse parameter of File type.Ben Hughes2011-04-011-1/+11
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Update the desc block with information gleaned from #1469 and the code about recurse => remote and other types of recursion. The auto generated documentation was sparse and this is an area that often comes up on the mailing list/IRC.
* | | | Merge branch '2.6.x' into nextMax Martin2011-03-303-3/+8
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | * 2.6.x: (#5908) Add support for new update-rc.d disable API (#6862) Add a default subject for the mail_patches rake task Fixed #6256 - Creation of rrd directory.
| * | | (#5908) Add support for new update-rc.d disable APIMax Martin2011-03-301-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for the new disable API to update-rc.d and added spec tests to check this functionality. This change was made because in versions of sysv-rc >= 2.88, 'update-rc.d stop' is broken and actually enables the service. We only changed the disable case as the enable case still works on systems which use sysv-rc 2.88 or greater (atm, only Debian Lenny). We wanted to change as little as possible because update-rc.d prints a message stating that the new enable/disable API is unstable and may change in the future. Paired-with:Matt Robinson, Jacob Helwig
| * | | Merge branch 'tickets/2.6.x/6256' into 2.6.nextJames Turnbull2011-03-262-1/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/6256: Fixed #6256 - Creation of rrd directory.
| | * | | Fixed #6256 - Creation of rrd directory.James Turnbull2011-03-262-1/+2
| | | |/ | | |/| | | | | | | | | Added :metrics to the settings used by the master
| * | | Merge branch 'ticket/2.6.next/5477' into 2.6.nextJesse Wolfe2011-03-255-10/+5
| |\ \ \
| | * | | (#5477) Allow watch_file to watch non-existent files, especially site.ppJesse Wolfe2011-03-255-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Backported this change to 2.6.x Paired-With: Jacob Helwig <jacob@puppetlabs.com>
* | | | | Merge branch 'tickets/master/6494' of https://github.com/domcleal/puppet ↵Jesse Wolfe2011-03-291-0/+21
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into next
| * | | | | (#6494) Add setm command to Augeas providerDominic Cleal2011-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Augeas setm command can set the value of multiple nodes in a single operation. Takes a base path, then a subnode path expression (relative to the base) and then the value itself.
| * | | | | (#6494) Add mv command to Augeas providerDominic Cleal2011-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves the first node to the position of the second, deleting it and its children if it already exists.
| * | | | | (#6494) Add defnode command to Augeas providerDominic Cleal2011-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses Augeas' defnode command which creates a variable pointing to a node, creating it with 'set' if it doesn't already exist.
| * | | | | (#6494) Add defvar command to Augeas providerDominic Cleal2011-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses Augeas' native defvar command to define variables for certain expressions that can then be referenced later with $variable.
* | | | | | Merge branch 'tickets/master/6324' of https://github.com/domcleal/puppet ↵Jesse Wolfe2011-03-291-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into next
| * | | | | | Fix non-existent method called in SMF manifest import exception message, ↵Dominic Cleal2011-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | updated spec
| * | | | | | (#6324) Always fall back to svcadm enable except for the maintenance stateDominic Cleal2011-02-151-2/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | If state is running, using svcadm enable is harmless and prevents errors with execute().