diff options
283 files changed, 9119 insertions, 5524 deletions
@@ -1,3 +1,261 @@ +2.6.7rc1 +======== +852fb97 (#5073) Download plugins even if you're filtering on tags +4f34dbf Fix #5610: Prevent unnecessary RAL lookups +9781032 Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next" +25926d1 (#6723) Fix withenv environment restoration bug +093f162 (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord +4c19299 Remove extra trailing whitespace from lib/puppet/resource.rb +ff9e242 (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs +0262633 (#6707) Fix typo in rest_authconfig.rb +8858e40 (#6689) Make inventory_active_record terminus search quickly +285c4cc (#5392) Give a better error when realizing a non-existant resource +cd5deda (#2645) Adding a less-stubby test to verify the "system" attribute's behavior +531e258 maint: Remove serialization of InventoryFact values +3489412 maint: Rename InventoryHost to InventoryNode +4bd5493 Fixed #2645 - Added support for creating system users +a3f2357 maint: Remove spec run noise +7764412 maint:Refactor of mount provider integration tests +880d0c6 (#6338) Support searching on metadata in InventoryActiveRecord terminus +f836366 (#6338) Implement search for InventoryActiveRecord facts terminus +8ce30c8 (#6338) Add an InventoryActiveRecord terminus for Facts +1ef83cb Added integration tests for the mount provider +64440e5 (#6513) Propagate the environment when doing variable lookup in settings +92dffb2 (#6513) Adjust P::U::Settings test name to reflect what it tests +5ef1031 (#6632) Adding a new mount no longer causes error with umount +bd5517d Adjust Darwin mount provider tests to pass on Linux +9d2fceb Maint: Begin adding integration tests for the mount provider +23d1c03 Maint: Added the ability to replace the behavior of Puppet::Util.execute with an arbitrary code block for ease in spec testing. +455a891 (#5794) create reports directory when creating host specific directory +1b1e803 (5724) Prep for deprecation of DESTDIR +f4a0af1 Refactoring duplicate code and logic in prep for DESTDIR deprecation. +7a00d6b (#6606) Inline docs: Document all autorequire relationships +e3aec14 (#5148) Fix failing spec due to timezone +8bd80a9 (#5148) Add support for PSON to facts +c3baa28 (#6338) Remove inventory indirection, and move to facts indirection +6c53eb3 (#6445) Fix inline docs: puppet agent does not accept --mkusers +4e29f43 (#6541) maint: whitespace cleanup on the file integration spec +b907ba3 (#6541) Fix content with checksum truncation bug +422399b (#5466) Write specs for output of puppet resource +8cc390c (#5466) Monkey patch Symbol so that you can sort them +24eacb7 (#5466) Fixed puppet resource bug with trailing , +743e039 (#4922) Don't truncate remotely-sourced files on 404 +bb69011 (#6338) Remove unused version control tags +e2a5085 Maint: Align tabs in a code block in the Augeas type. +65a5496 (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type +ea9f1f0 Maint: Rewrite comments about symlinks to reflect best practice. +94f8ead (#6509) Inline docs: Fix broken lists in Launchd provider. +c80a77d (#6509) Inline docs: Fix broken code blocks in zpool type +27863c3 (#6509) Inline docs: Fix code blocks in service type. +f4034f7 (#6509) Inline docs: fix broken code blocks in schedule.rb. +6f6c4b5 (#6509) Inline docs: Fix broken code block in file type (content attribute) +a949a83 Revert "(#6309) Ensure the correct device is mounted when managing mounts" +23a510a (#4914) Improved stubbing in mount/parsed_spec tests. +ac2262d (#3999) Allow disabling of default SELinux context detection for files +23eb77d (#6322) --noop should not suppress error codes +439115e (#6499) Make puppet respond identically to -h and --help +23b7119 Maint: Add an assertion mechanism to Puppet +e3dfe41 (#6418) Recursive files shouldn't be audited +0e9858f (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testing +309b932 (#5552) Display help when no subcommand is given. +de6a205 (#5552) Clean up subcommand handling inside puppet cert. +bb31c3d (#6376) Add test case for facts find request +2ecf913 Revert "(#5935) Allow functions to accept negated values" +c57c508 (#4914) Improved parsed_spec for mount +ec33a09 (#4914) Remove mount specs +e854205 Remove pending tests from parsed mount provider +6cb365a (#6309) Ensure the correct device is mounted when managing mounts +d1f1858 (#6376) Add support and testing for _search GET requests +3b41d44 Clean up whitespace, and commented out code in parsed mount provider +a7cebf8 (#6337) Fix Ruby warning on 1.8.6 about "future compatibility" +8a48560 (#5150) Make fact REST terminus configurable to connect to inventory service +e6870f6 (#5166) Inventory service is now searchable by timestamp. +2d2f9ab Maint: backport timestamp accessor for facts from 2.7 branch +fa0ed63 Refactored Puppet::Node::Inventory::Yaml tests in preparation for adding freshness check +67f24e4 Refactor Puppet::Node::Inventory::Yaml in preparation for adding freshness +23fc4db (#5132) Provide a query REST interface for inventory +e3c59df (#5935) Allow functions to accept negated values +7cb884e (#6346) Move the trap calls onto Signal so they're easier to stub +b5bae9f (#6331) Remove final special :trac: link from the file content property +4d25d90 (#6331) Inline documentation: Fix rotted links pointing at the Trac wiki +b25d9e4 maint: make rspec exit with status 1 when there are failures +5c26f68 (#5516) Rebuild parser.rb after merge. +e512e3e (#5977) fix spec test failure when new applications are introduced. +b5b5923 misc: ast_context has two arguments, not one. +414e3a5 Fix #5516 - Hashes can't be used in selectors +c373b62 Fix #6269 - Hashes only work with two levels of access +9090507 Fix #6267 - puppetdoc embedded links to puppet entities are not hyperlinked +b4a171e Fix #5720 - puppetdoc misses some class comments +cfa0c32 Fix #6281 - Make sure puppetdoc analyzes all files +48bc7d0 Fix #6280 - puppetdoc crashing on string interpolation +0b7faa6 (#6270) Fix formatting in split function's doc string +637e139 (#6270) Fix formatting in regsubst function's doc string +e9ee621 (6130) Change header level on metaparameter reference +d6e4ffe (#4914) Specs for mounted? match new behaviour +f534470 (#4914) Add specs for modified mount provider +b753038 (#4914) Add specs for modified mount type +9f40608 (#4914) Update property blocks +fd111f2 (#4914) Query property_hash for mountstate +2884660 (#4914) Prefetch mountstate +ade951a (#4914) Join lines for better readability +8b98526 (#5662) Fixed tests that didnt stub key_attributes +02b3111 (#5605) Prefetch doesnt work with composite keys +2a0c970 (#5662) Parsedfile doesnt work with mult keyattr +35dd070 (#5661) Creating types dont work with >1 namevar + +2.6.6 +===== +d24e32a Update CHANGELOG and version for 2.6.6rc1 +7c2a980 (#6541) Fix content with checksum truncation bug +63e911f (#6418) Recursive files shouldn't be audited + +2.6.5 +===== +30fa41d Updated CHANGELOG for 2.6.5rc5 +b481321 (#6337) Fix Ruby warning on 1.8.6 about "future compatibility" +dcce45c (#6353) Restore the ability to store paths in the filebucket +0450197 (#6126) Puppet inspect now reports status after run completes. +960890f (#6364) Adjust mis-translated regex in mount provider for AIX +9e0f9c5 Updated CHANGELOG for 2.6.5rc4 +664ef67 (#3646) Fix the documentation fix for `puppet apply --apply` +4b6519a Updated CHANGELOG for 2.6.5rc3 +7ef2fbf Updated fix for #3646 - apply / compile documentation +193016d (#5977) fix spec test failure when new applications are introduced. +c08fc1b Updated CHANGELOG for 2.6.5rc2 +1f89906 (#6257) Speed up PUT and POST requests under rack +70a43c4 Updated CHANGELOG and version for 2.6.5rc1 +f108f03 (#6018) Nick F's --help text for puppet inspect. +04ea826 (#5823) document the not-an-API status of set_run_mode +4ff5769 (#5823) run mode can now be set dynamically... +bddfa1e (6114) Update the audit metaparameter for 2.6.5. +ac8d316 Fix for #5755 -- making zaml serialization robust over projected objects +c912a2a (#4139) hook log autoflush into global defaults +f9e2e2b Augmentation of tests for prior commit +392504a Fix to fix for #5755 -- backref serialization issues in zaml +a732a15 Fixed #5564 - Added some more fqdn_rand documentation +f279f2c Fixed #4968 - Updated list of options turned on by --test in documentation +ce5a2bf (#5061) - allow special hostclass/define variables to be evaluated as defaults. +fd73874 (#6107) Fix an error when auditing a file with empty content +530496b Remove already initialized constant warning from file_spec.rb tests +76788f8 (#5566) Treat source only File checksums as syntax errors when used with content +d657292 Rename variable used in File type validation to be more clear +3398139 Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types. +6c93eb2 Remove order dependency when specifying source and checksum on File type +3a125d4 Bug #5755 -- ZAML generates extra newline in some hash backreferences. +50c12e5 bug #5681 -- code fix to handle AIX mount output +139760b Bug #5681 -- parse AIX mount command output. +2f74d83 Spec for #5681 to allow parsing of AIX mount output in mount provider +878f266 Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes +eb97aa5 Bug #6091 -- test leading double-slash in filenames are allowed. +1bfc9a0 Fixed #6071 - Fixed typo and improved exec path error message +c50a48e Fixed #6061 - Allowed -1 as password min/max age +bf44e72 Bug #6061 -- verify that negative {min,max}_password_age are accepted. +af1c1fe Feature #5855 -- fix withenv call in freebsd package provider +d871641 Feature #5855 -- undefined method 'withenv' in FreeBSD package provider. +f1ab588 Fixed #6009 - nested member list vs directory service group provider +86a2a00 (#5944) Remove documentation of define() when used on nodes, as it is not a supported use of this function. +2b9f653 (#5944) Further edits of inline defined() documentation. +5d108e8 (#5944) Improve documentation of defined() function +7d38ab2 (#5594) Update documentation of exec resource type. +67e1bba (#5931) Prevent errors when calling insync? on audited properties +0f9d236 Maint: Removed dead code from resource harness. +0765afb Maint: Rename misleading insync? method in file provider +0084b08 (#5548) Specify return values of manual status commands in service type description. +dd332f6 Fixed #6002 - Added note about function execution +3cfbd07 (#5045) Cleaning up some tests and code +a2036ea (#5045) External node classifiers should be able to specify params for classes +18ca97b (#5045) Adds support to resource/type to also accept a param hash +70630b9 Fix #3165 Ralsh (bin/puppet resource) can't manage files +1fd3600 Fixed #3646 - Added documentation for compile and apply to man page +ae48634 Fixed #5914 Removed genconfig = true from genconfig output +7e7f342 Fixed #1657 - Added note about target file +069f29b Fixed #2096 - clarified option modification and tested it is working +66b442b Fixes #5916 - Cleanup of unused doc methods and documentation +9b74968 Modified rubydoc in lib/puppet/util/command_line/puppetca to fix inaccurate description of --clean. +e58f5dc Fixed #5742 - Removed legacy fqdn option from documentation +4d1b51f Fixed #5167 - misleading documentation in the defaults of [main] +c1b5c7f (#5913) Fix Puppet::Application.find constant lookup behavior +7b3b56e (5977) Puppet::Applications can be loaded from multiple paths. +f9bfb96 (#5900) Include ResourceStatus#failed in serialized reports +79b6332 (#5882) Added error-handling for bucketing files in puppet inspect +17843d5 (#5882) Added error-handling to puppet inspect when auditing +1a6fab2 (#5171) Made "puppet inspect" upload audited files to a file bucket +a7cd185 Prep for #5171: Added a missing require to inspect application. +71ac9cf Locked Puppet license to GPLv2 +abc6256 (#5838) Support paths as part of file bucket requests. +002f9f1 (#5838) Improve the quality of file bucket specs. +94d7179 (#5838) Make file bucket dipper efficient when saving a file that already exists +89f5692 (#5838) Implemented the "head" method for FileBucketFile::File terminus. +9cfd3d5 (#5838) Reworked file dipper spec to perform less stubbing. +c514c64 (#5838) Added support for HEAD requests to the indirector. +2b9b7a5 (#5838) Refactored error handling logic into find_in_cache. +08561b2 (#5838) Refactored Puppet::Network::Rights#fail_on_deny +87c5c30 (#5910) Improved logging when declared classes cannot be found: +4efc98a maint: Remove unused Rakefile in spec directory +a002231 (#5171) Made filebucket able to perform diffs +8f314f2 (#5710) Removed unnecessary calls to insync? +e270086 Prep for fixing #5710: Refactor stub provider in resource harness spec +c57a677 Maint: test partial resource failure +8aa8b9d (#5799) Simplify report dir creation +2d88844 maint: Add vim swap files to .gitignore +3d3baec maint: Remove rspec options from the Rakefile +df65304 maint: Inspect reports should have audited = true on events +4c9eca1 Maint: Added "skipped" to the YAML output for Puppet::Resource::Status +717670f (#5771): Fix spec failures associated with rspec upgrade +52760a4 (#5771) Upgrade rspec to version 2 +7603b05 maint: remove stray debug statement. +7661ba8 maint: Prune #inspect methods on various objects +80bfb54 (#5758) Verify that report events are correctly created +de85f8d Prep work for #5758: set audited=true on all audit events +e162da9 Prep work for #5758: clean up initializer for Puppet::Transaction::Event +06a8d1e Fix #5698 puppet inspect shouldn't report of attributes of deleted files +1f72c31 (#5715) Added attributes resource_type and title to Puppet::Resource::Status. +a6cd736 (#5715) Removed attribute source_description from the YAML representation of Puppet::Resource::Status. +98db2da (#5715) Removed unnecessary attributes from YAML of Puppet::Transaction::Event. +bd4a8a1 (#5715) Make certain report attributes always present. +716ee1c (#5715) Changed the type of metric names to always be strings. +037eac4 (#5715) Add status attribute to reports. +e4a2e04 (#5715) Made the report "calculate" methods strictly functional. +71db5be (#5715) Made the changes/total and events/total metrics always present +a4e40f4 (#5715) Refactor in preparation for adding a status attribute to reports. +15dda94 (#5715) Added total time to inspect reports and made inspect metrics more consistent. +d1bcdec (#5715) Removed Puppet::Transaction::Report#external_times from YAML output. +1550bbb (#5715) Added total time metric to apply reports. +4cc42cd (#5715) Removed redundant attribute Transaction::Event#version +1907650 (#5715) Removed redundant attribute Resource::Status#version +e596a57 (#5715) Removed Puppet::Util::Log#version. +908e0e0 (#5715) Removed the unused attribute Puppet::Transaction::Event#node +0e39ec5 (#5715) Removed Resource::Status#skipped_reason. It was never used. +b765f0e (#5715) Prep work: Fixed add_statuses in report_spec. +8631709 (#5723) Fix failing type/package specs +76fe2b3 Implement #5168 and #5169 ctime and mtime are properties +d11ae78 [3782] Test isolation problem in test/ral/providers/cron/crontab.rb +4d3030c Modified the behavior of Puppet::Resource::Status as follows: +7fff780 (#5408) Reworked ResourceHarness so that code is clearer and all behaviors are tested +d516f63 (#5493) Add report_format, puppet_version, and configuration_version to Reports +093c45f (#5375) Rework puppet apply to use configurer.run +e99a3ea Fix #5566 none, mtime, and ctime checksum types can write file contents +d74e8e1 maint: Fix ActiveRecord confine issue +6daeb16 maint: Fix a test that was missing a require +5db696b maint: Fix tests that don't run on their own +7f4e058 (#4487) Fix environment column in hosts table +3ac50fa maint: restore plugin handler safety +f38c36c (#5408) Attributes can be both audited and managed +54a1025 maint: missing stub +1d3192e maint: missing stub +1aa8157 maint: missing line and filename stubs +5e5ee97 maint: Fully stub partially stubbed test. +3d7c8d0 maint: remove Puppet.settings stubs +52fba89 maint: test was expecting Catalog.find too few times +8c134b6 maint: broken test not failing due to over-eager exception catching +3e59277 Fix #1757 Change file mode representation to octal +84bf02e Bug #5423: This moves the home directory property before the uid property, thus minimizing room for damage when usermod is in use. +1131ad7 (#4943) Add puppet inspect application +e005cc7 maint: Remove bogus mongrel test +c908fdb (#5261) Fix #5261 Don't escape Unicode characters in PSON +b27e9b4 [#5081] Revert "Fix #4349 - Parsing with ignoreimport=true was always loading site.pp" +af6e08c (#5304) Use internal_name rather than real_name for maillist provider + 2.6.4 ===== 76890a5 Revert "(#5304) Use internal_name rather than real_name for maillist provider" diff --git a/README.queueing b/README.queueing index 8c4a18029..83a8e19c0 100644 --- a/README.queueing +++ b/README.queueing @@ -8,7 +8,7 @@ Queue Daemon). Currently this is only supported for "Storeconfigs" which is documented at: -http://reductivelabs.com/trac/puppet/wiki/UsingStoredConfiguration +http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration In the future this feature can be extended to any new puppet data which involves storage in a database. @@ -44,10 +44,10 @@ task :puppetpackages => [:create_gem, :package] RSpec::Core::RakeTask.new do |t| t.pattern ='spec/{unit,integration}/**/*.rb' - t.fail_on_error = false + t.fail_on_error = true end desc "Run the unit tests" task :unit do - sh "cd test; rake" + Dir.chdir("test") { sh "rake" } end diff --git a/conf/solaris/smf/svc-puppetd b/conf/solaris/smf/svc-puppetd index b6cf05736..8acc19cfa 100755 --- a/conf/solaris/smf/svc-puppetd +++ b/conf/solaris/smf/svc-puppetd @@ -62,5 +62,3 @@ status) fi esac exit 0 - -# $Id$ diff --git a/conf/solaris/smf/svc-puppetmasterd b/conf/solaris/smf/svc-puppetmasterd index 80e3d464a..683324dec 100755 --- a/conf/solaris/smf/svc-puppetmasterd +++ b/conf/solaris/smf/svc-puppetmasterd @@ -58,5 +58,3 @@ status) fi esac exit 0 - -# $Id$ diff --git a/examples/etc/init.d/sleeper b/examples/etc/init.d/sleeper index 63f7e9c2e..c60a5555c 100755 --- a/examples/etc/init.d/sleeper +++ b/examples/etc/init.d/sleeper @@ -1,7 +1,5 @@ #!/bin/bash -# $Id$ - script=$0 path=`echo $script | sed 's/etc..*/bin/'` diff --git a/examples/modules/sample-module/README.txt b/examples/modules/sample-module/README.txt index cd35c83a1..233e54b8d 100644 --- a/examples/modules/sample-module/README.txt +++ b/examples/modules/sample-module/README.txt @@ -12,6 +12,6 @@ templates/sample.erb Note the consistent naming of files for Puppet::Util::Autoload Reference Documents: -http://reductivelabs.com/trac/puppet/wiki/ModuleOrganisation +http://docs.puppetlabs.com/guides/modules.html http://docs.puppetlabs.com/guides/custom_functions.html -http://reductivelabs.com/trac/puppet/wiki/FunctionReference +http://docs.puppetlabs.com/references/latest/function.html diff --git a/ext/puppetstoredconfigclean.rb b/ext/puppetstoredconfigclean.rb index 16f39efa1..dcbefa816 100644 --- a/ext/puppetstoredconfigclean.rb +++ b/ext/puppetstoredconfigclean.rb @@ -3,7 +3,7 @@ # Script to clean up stored configs for (a) given host(s) # # Credits: -# Script was taken from http://reductivelabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb +# Script was taken from http://reductivelabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb (link no longer valid), # which haven been initially posted by James Turnbull # duritong adapted and improved the script a bit. diff --git a/install.rb b/install.rb index 7627a8d11..6854363ca 100755 --- a/install.rb +++ b/install.rb @@ -53,18 +53,6 @@ rescue LoadError $haverdoc = false end -begin - if $haverdoc - ronn = %x{which ronn} - $haveman = true - else - $haveman = false - end -rescue - puts "Missing ronn; skipping man page creation" - $haveman = false -end - PREREQS = %w{openssl facter xmlrpc/client xmlrpc/server cgi} MIN_FACTER_VERSION = 1.5 @@ -178,15 +166,6 @@ def prepare_installation end - if $haveman - InstallOptions.man = true - if $operatingsystem == "windows" - InstallOptions.man = false - end - else - InstallOptions.man = false - end - InstallOptions.tests = true ARGV.options do |opts| @@ -198,9 +177,6 @@ def prepare_installation opts.on('--[no-]ri', 'Prevents the creation of RI output.', 'Default off on mswin32.') do |onri| InstallOptions.ri = onri end - opts.on('--[no-]man', 'Prevents the creation of man pages.', 'Default on.') do |onman| - InstallOptions.man = onman - end opts.on('--[no-]tests', 'Prevents the execution of unit tests.', 'Default on.') do |ontest| InstallOptions.tests = ontest end @@ -233,7 +209,6 @@ def prepare_installation end opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full| InstallOptions.rdoc = true - InstallOptions.man = true InstallOptions.ri = true InstallOptions.tests = true InstallOptions.configs = true @@ -300,34 +275,29 @@ def prepare_installation mandir = Config::CONFIG['mandir'] end - # To be deprecated once people move over to using --destdir option - if (destdir = ENV['DESTDIR']) - configdir = "#{destdir}#{configdir}" - bindir = "#{destdir}#{bindir}" - sbindir = "#{destdir}#{sbindir}" - mandir = "#{destdir}#{mandir}" - sitelibdir = "#{destdir}#{sitelibdir}" - - FileUtils.makedirs(configdir) if InstallOptions.configs - FileUtils.makedirs(bindir) - FileUtils.makedirs(sbindir) - FileUtils.makedirs(mandir) - FileUtils.makedirs(sitelibdir) # This is the new way forward - elsif (destdir = InstallOptions.destdir) - configdir = "#{destdir}#{configdir}" - bindir = "#{destdir}#{bindir}" - sbindir = "#{destdir}#{sbindir}" - mandir = "#{destdir}#{mandir}" - sitelibdir = "#{destdir}#{sitelibdir}" - - FileUtils.makedirs(configdir) if InstallOptions.configs - FileUtils.makedirs(bindir) - FileUtils.makedirs(sbindir) - FileUtils.makedirs(mandir) - FileUtils.makedirs(sitelibdir) + if not InstallOptions.destdir.nil? + destdir = InstallOptions.destdir + # To be deprecated once people move over to using --destdir option + elsif ENV['DESTDIR'] != nil? + destdir = ENV['DESTDIR'] + warn "DESTDIR is deprecated. Use --destdir instead." + else + destdir = '' end + configdir = "#{destdir}#{configdir}" + bindir = "#{destdir}#{bindir}" + sbindir = "#{destdir}#{sbindir}" + mandir = "#{destdir}#{mandir}" + sitelibdir = "#{destdir}#{sitelibdir}" + + FileUtils.makedirs(configdir) if InstallOptions.configs + FileUtils.makedirs(bindir) + FileUtils.makedirs(sbindir) + FileUtils.makedirs(mandir) + FileUtils.makedirs(sitelibdir) + tmpdirs << bindir InstallOptions.tmp_dirs = tmpdirs.compact @@ -368,33 +338,6 @@ def build_ri(files) end end -def build_man(bins, sbins) - return unless $haveman - begin - # Locate ronn - ronn = %x{which ronn} - ronn.chomp! - # Create puppet.conf.5 man page - %x{bin/puppetdoc --reference configuration > ./man/man5/puppetconf.5.ronn} - %x{#{ronn} -r ./man/man5/puppetconf.5.ronn} - File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5") - File.unlink("./man/man5/puppetconf.5.ronn") - - # Create binary man pages - binary = bins + sbins - binary.each do |bin| - b = bin.gsub( /(bin|sbin)\//, "") - %x{#{bin} --help > ./man/man8/#{b}.8.ronn} - %x{#{ronn} -r ./man/man8/#{b}.8.ronn} - File.unlink("./man/man8/#{b}.8.ronn") - end - -rescue SystemCallError - $stderr.puts "Couldn't build man pages: " + $ERROR_INFO - $stderr.puts "Continuing with install..." - end -end - def run_tests(test_list) require 'test/unit/ui/console/testrunner' $LOAD_PATH.unshift "lib" @@ -488,7 +431,6 @@ prepare_installation #run_tests(tests) if InstallOptions.tests #build_rdoc(rdoc) if InstallOptions.rdoc #build_ri(ri) if InstallOptions.ri -#build_man(bins, sbins) if InstallOptions.man do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs do_bins(sbins, InstallOptions.sbin_dir) do_bins(bins, InstallOptions.bin_dir) diff --git a/lib/puppet.rb b/lib/puppet.rb index a58d3c801..ef5fb7f06 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -24,7 +24,7 @@ require 'puppet/util/run_mode' # it's also a place to find top-level commands like 'debug' module Puppet - PUPPETVERSION = '2.6.4' + PUPPETVERSION = '2.6.7' def Puppet.version PUPPETVERSION diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 17ad69cee..7ef71bc81 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -250,7 +250,8 @@ class Application # Every app responds to --help option("--help", "-h") do |v| - help + puts help + exit end def should_parse_config? @@ -264,9 +265,21 @@ class Application def initialize(command_line = nil) require 'puppet/util/command_line' @command_line = command_line || Puppet::Util::CommandLine.new - @run_mode = self.class.run_mode + set_run_mode self.class.run_mode @options = {} + require 'puppet' + end + + # WARNING: This is a totally scary, frightening, and nasty internal API. We + # strongly advise that you do not use this, and if you insist, we will + # politely allow you to keep both pieces of your broken code. + # + # We plan to provide a supported, long-term API to deliver this in a way + # that you can use. Please make sure that you let us know if you do require + # this, and this message is still present in the code. --daniel 2011-02-03 + def set_run_mode(mode) + @run_mode = mode $puppet_application_mode = @run_mode $puppet_application_name = name @@ -281,8 +294,6 @@ class Application Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults) Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults) end - - require 'puppet' end # This is the main application entry point @@ -375,23 +386,7 @@ class Application end def help - if Puppet.features.usage? - # RH:FIXME: My goodness, this is ugly. - ::RDoc.const_set("PuppetSourceFile", name) - #:stopdoc: # Issue #4161 - def (::RDoc).caller - docfile = `grep -l 'Puppet::Application\\[:#{::RDoc::PuppetSourceFile}\\]' #{DOCPATTERN}`.chomp - super << "#{docfile}:0" - end - #:startdoc: - ::RDoc::usage && exit - else - puts "No help available unless you have RDoc::usage installed" - exit - end - rescue Errno::ENOENT - puts "No help available for puppet #{name}" - exit + "No help available for puppet #{name}" end private diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb index 96f33296f..2ee40227e 100644 --- a/lib/puppet/application/agent.rb +++ b/lib/puppet/application/agent.rb @@ -9,7 +9,7 @@ class Puppet::Application::Agent < Puppet::Application def preinit # Do an initial trap, so that cancels don't get a stack trace. - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Cancelling startup" exit(0) end @@ -83,6 +83,217 @@ class Puppet::Application::Agent < Puppet::Application @args[:Port] = arg end + def help + <<-HELP + +puppet-agent(8) -- The puppet agent daemon +======== + +SYNOPSIS +-------- +Retrieves the client configuration from the puppet master and applies it to +the local host. + +This service may be run as a daemon, run periodically using cron (or something +similar), or run interactively for testing purposes. + + +USAGE +----- +puppet agent [-D|--daemonize|--no-daemonize] [-d|--debug] + [--detailed-exitcodes] [--disable] [--enable] [-h|--help] + [--certname <host name>] [-l|--logdest syslog|<file>|console] + [-o|--onetime] [--serve <handler>] [-t|--test] [--noop] + [--digest <digest>] [--fingerprint] [-V|--version] + [-v|--verbose] [-w|--waitforcert <seconds>] + + +DESCRIPTION +----------- +This is the main puppet client. Its job is to retrieve the local +machine's configuration from a remote server and apply it. In order to +successfully communicate with the remote server, the client must have a +certificate signed by a certificate authority that the server trusts; +the recommended method for this, at the moment, is to run a certificate +authority as part of the puppet server (which is the default). The +client will connect and request a signed certificate, and will continue +connecting until it receives one. + +Once the client has a signed certificate, it will retrieve its +configuration and apply it. + + +USAGE NOTES +----------- +'puppet agent' does its best to find a compromise between interactive +use and daemon use. Run with no arguments and no configuration, it will +go into the background, attempt to get a signed certificate, and retrieve +and apply its configuration every 30 minutes. + +Some flags are meant specifically for interactive use -- in particular, +'test', 'tags' or 'fingerprint' are useful. 'test' enables verbose +logging, causes the daemon to stay in the foreground, exits if the +server's configuration is invalid (this happens if, for instance, you've +left a syntax error on the server), and exits after running the +configuration once (rather than hanging around as a long-running +process). + +'tags' allows you to specify what portions of a configuration you want +to apply. Puppet elements are tagged with all of the class or definition +names that contain them, and you can use the 'tags' flag to specify one +of these names, causing only configuration elements contained within +that class or definition to be applied. This is very useful when you are +testing new configurations -- for instance, if you are just starting to +manage 'ntpd', you would put all of the new elements into an 'ntpd' +class, and call puppet with '--tags ntpd', which would only apply that +small portion of the configuration during your testing, rather than +applying the whole thing. + +'fingerprint' is a one-time flag. In this mode 'puppet agent' will run +once and display on the console (and in the log) the current certificate +(or certificate request) fingerprint. Providing the '--digest' option +allows to use a different digest algorithm to generate the fingerprint. +The main use is to verify that before signing a certificate request on +the master, the certificate request the master received is the same as +the one the client sent (to prevent against man-in-the-middle attacks +when signing certificates). + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'server' is a valid +configuration parameter, so you can specify '--server <servername>' as +an argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet agent with +'--genconfig'. + +* --daemonize: + Send the process into the background. This is the default. + +* --no-daemonize: + Do not send the process into the background. + +* --debug: + Enable full debugging. + +* --digest: + Change the certificate fingerprinting digest algorithm. The default is + MD5. Valid values depends on the version of OpenSSL installed, but + should always at least contain MD5, MD2, SHA1 and SHA256. + +* --detailed-exitcodes: + Provide transaction information via exit codes. If this is enabled, an + exit code of '2' means there were changes, and an exit code of '4' + means that there were failures during the transaction. This option + only makes sense in conjunction with --onetime. + +* --disable: + Disable working on the local system. This puts a lock file in place, + causing 'puppet agent' not to work on the system until the lock file + is removed. This is useful if you are testing a configuration and do + not want the central configuration to override the local state until + everything is tested and committed. + + 'puppet agent' uses the same lock file while it is running, so no more + than one 'puppet agent' process is working at a time. + + 'puppet agent' exits after executing this. + +* --enable: + Enable working on the local system. This removes any lock file, + causing 'puppet agent' to start managing the local system again + (although it will continue to use its normal scheduling, so it might + not start for another half hour). + + 'puppet agent' exits after executing this. + +* --certname: + Set the certname (unique ID) of the client. The master reads this + unique identifying string, which is usually set to the node's + fully-qualified domain name, to determine which configurations the + node will receive. Use this option to debug setup problems or + implement unusual node identification schemes. + +* --help: + Print this help message + +* --logdest: + Where to send messages. Choose between syslog, the console, and a log + file. Defaults to sending messages to syslog, or the console if + debugging or verbosity is enabled. + +* --no-client: + Do not create a config client. This will cause the daemon to run + without ever checking for its configuration automatically, and only + makes sense + +* --onetime: + Run the configuration once. Runs a single (normally daemonized) Puppet + run. Useful for interactively running puppet agent when used in + conjunction with the --no-daemonize option. + +* --fingerprint: + Display the current certificate or certificate signing request + fingerprint and then exit. Use the '--digest' option to change the + digest algorithm used. + +* --serve: + Start another type of server. By default, 'puppet agent' will start a + service handler that allows authenticated and authorized remote nodes + to trigger the configuration to be pulled down and applied. You can + specify any handler here that does not require configuration, e.g., + filebucket, ca, or resource. The handlers are in + 'lib/puppet/network/handler', and the names must match exactly, both + in the call to 'serve' and in 'namespaceauth.conf'. + +* --test: + Enable the most common options used for testing. These are 'onetime', + 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', + 'detailed-exit-codes', 'no-splay', and 'show_diff'. + +* --noop: + Use 'noop' mode where the daemon runs in a no-op or dry-run mode. This + is useful for seeing what changes Puppet will make without actually + executing the changes. + +* --verbose: + Turn on verbose reporting. + +* --version: + Print the puppet version number and exit. + +* --waitforcert: + This option only matters for daemons that do not yet have certificates + and it is enabled by default, with a value of 120 (seconds). This + causes 'puppet agent' to connect to the server every 2 minutes and ask + it to sign a certificate request. This is useful for the initial setup + of a puppet client. You can turn off waiting for certificates by + specifying a time of 0. + + +EXAMPLE +------- + $ puppet agent --server puppet.domain.com + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005, 2006 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def run_command return fingerprint if options[:fingerprint] return onetime if Puppet[:onetime] @@ -119,7 +330,7 @@ class Puppet::Application::Agent < Puppet::Application if not report exit(1) - elsif not Puppet[:noop] and options[:detailed_exitcodes] then + elsif options[:detailed_exitcodes] then exit(report.exit_status) else exit(0) diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb index e5b4bb5b7..2b7c9f8fb 100644 --- a/lib/puppet/application/apply.rb +++ b/lib/puppet/application/apply.rb @@ -26,6 +26,103 @@ class Puppet::Application::Apply < Puppet::Application end end + def help + <<-HELP + +puppet-apply(8) -- Apply Puppet manifests locally +======== + +SYNOPSIS +-------- +Applies a standalone Puppet manifest to the local system. + + +USAGE +----- +puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] + [-e|--execute] [--detailed-exitcodes] [-l|--logdest <file>] + [--apply <catalog>] <file> + + +DESCRIPTION +----------- +This is the standalone puppet execution tool; use it to apply +individual manifests. + +When provided with a modulepath, via command line or config file, puppet +apply can effectively mimic the catalog that would be served by puppet +master with access to the same modules, although there are some subtle +differences. When combined with scheduling and an automated system for +pushing manifests, this can be used to implement a serverless Puppet +site. + +Most users should use 'puppet agent' and 'puppet master' for site-wide +manifests. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'modulepath' is a +valid configuration parameter, so you can specify '--tags <class>,<tag>' +as an argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet with +'--genconfig'. + +* --debug: + Enable full debugging. + +* --detailed-exitcodes: + Provide transaction information via exit codes. If this is enabled, an + exit code of '2' means there were changes, and an exit code of '4' + means that there were failures during the transaction. + +* --help: + Print this help message + +* --loadclasses: + Load any stored classes. 'puppet agent' caches configured classes + (usually at /etc/puppet/classes.txt), and setting this option causes + all of those classes to be set in your puppet manifest. + +* --logdest: + Where to send messages. Choose between syslog, the console, and a log + file. Defaults to sending messages to the console. + +* --execute: + Execute a specific piece of Puppet code + +* --verbose: + Print extra information. + +* --apply: + Apply a JSON catalog (such as one generated with 'puppet master --compile'). You can + either specify a JSON file or pipe in JSON from standard input. + + +EXAMPLE +------- + $ puppet apply -l /tmp/manifest.log manifest.pp + $ puppet apply --modulepath=/root/dev/modules -e "include ntpd::server" + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def run_command if options[:catalog] apply @@ -125,7 +222,7 @@ class Puppet::Application::Apply < Puppet::Application configurer = Puppet::Configurer.new report = configurer.run(:skip_plugin_download => true, :catalog => catalog) - exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? report.exit_status : 0 ) + exit( options[:detailed_exitcodes] ? report.exit_status : 0 ) rescue => detail puts detail.backtrace if Puppet[:trace] $stderr.puts detail.message @@ -143,7 +240,7 @@ class Puppet::Application::Apply < Puppet::Application client = nil server = nil - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Exiting" exit(1) end diff --git a/lib/puppet/application/cert.rb b/lib/puppet/application/cert.rb index 467b0c859..f02fc893c 100644 --- a/lib/puppet/application/cert.rb +++ b/lib/puppet/application/cert.rb @@ -5,17 +5,19 @@ class Puppet::Application::Cert < Puppet::Application should_parse_config run_mode :master - attr_accessor :cert_mode, :all, :ca, :digest, :signed + attr_accessor :all, :ca, :digest, :signed - def find_mode(opt) - require 'puppet/ssl/certificate_authority' - modes = Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS - tmp = opt.sub("--", '').to_sym - @cert_mode = modes.include?(tmp) ? tmp : nil + def subcommand + @subcommand + end + def subcommand=(name) + # Handle the nasty, legacy mapping of "clean" to "destroy". + sub = name.to_sym + @subcommand = (sub == :clean ? :destroy : sub) end option("--clean", "-c") do - @cert_mode = :destroy + self.subcommand = "destroy" end option("--all", "-a") do @@ -37,7 +39,7 @@ class Puppet::Application::Cert < Puppet::Application require 'puppet/ssl/certificate_authority/interface' Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject {|m| m == :destroy }.each do |method| option("--#{method}", "-#{method.to_s[0,1]}") do - find_mode("--#{method}") + self.subcommand = method end end @@ -45,6 +47,129 @@ class Puppet::Application::Cert < Puppet::Application Puppet::Util::Log.level = :info end + def help + puts <<-HELP + +puppet-cert(8) -- Manage certificates and requests +======== + +SYNOPSIS +-------- +Standalone certificate authority. Capable of generating certificates, +but mostly used for signing certificate requests from puppet clients. + + +USAGE +----- +puppet cert [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] + [-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke] [-p|--print] + [-c|--clean] [--verify] [--digest <digest>] [--fingerprint] [host] + + +DESCRIPTION +----------- +Because the puppet master service defaults to not signing client +certificate requests, this script is available for signing outstanding +requests. It can be used to list outstanding requests and then either +sign them individually or sign all of them. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'ssldir' is a valid +configuration parameter, so you can specify '--ssldir <directory>' as an +argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet cert with +'--genconfig'. + +* --all: + Operate on all items. Currently only makes sense with '--sign', + '--clean', or '--list'. + +* --digest: + Set the digest for fingerprinting (defaults to md5). Valid values + depends on your openssl and openssl ruby extension version, but should + contain at least md5, sha1, md2, sha256. + +* --clean: + Remove all files related to a host from puppet cert's storage. This is + useful when rebuilding hosts, since new certificate signing requests + will only be honored if puppet cert does not have a copy of a signed + certificate for that host. The certificate of the host is also + revoked. If '--all' is specified then all host certificates, both + signed and unsigned, will be removed. + +* --debug: + Enable full debugging. + +* --generate: + Generate a certificate for a named client. A certificate/keypair will + be generated for each client named on the command line. + +* --help: + Print this help message + +* --list: + List outstanding certificate requests. If '--all' is specified, signed + certificates are also listed, prefixed by '+', and revoked or invalid + certificates are prefixed by '-' (the verification outcome is printed + in parenthesis). + +* --print: + Print the full-text version of a host's certificate. + +* --fingerprint: + Print the DIGEST (defaults to md5) fingerprint of a host's + certificate. + +* --revoke: + Revoke the certificate of a client. The certificate can be specified + either by its serial number, given as a decimal number or a + hexadecimal number prefixed by '0x', or by its hostname. The + certificate is revoked by adding it to the Certificate Revocation List + given by the 'cacrl' config parameter. Note that the puppetmasterd + needs to be restarted after revoking certificates. + +* --sign: + Sign an outstanding certificate request. Unless '--all' is specified, + hosts must be listed after all flags. + +* --verbose: + Enable verbosity. + +* --version: + Print the puppet version number and exit. + +* --verify: + Verify the named certificate against the local CA certificate. + + +EXAMPLE +------- + $ puppet cert -l + culain.madstop.com + $ puppet cert -s culain.madstop.com + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + exit + end + def main if @all hosts = :all @@ -54,8 +179,8 @@ class Puppet::Application::Cert < Puppet::Application hosts = command_line.args.collect { |h| h.downcase } end begin - @ca.apply(:revoke, :to => hosts) if @cert_mode == :destroy - @ca.apply(@cert_mode, :to => hosts, :digest => @digest) + @ca.apply(:revoke, :to => hosts) if subcommand == :destroy + @ca.apply(subcommand, :to => hosts, :digest => @digest) rescue => detail puts detail.backtrace if Puppet[:trace] puts detail.to_s @@ -64,11 +189,12 @@ class Puppet::Application::Cert < Puppet::Application end def setup + require 'puppet/ssl/certificate_authority' exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? Puppet::Util::Log.newdestination :console - if [:generate, :destroy].include? @cert_mode + if [:generate, :destroy].include? subcommand Puppet::SSL::Host.ca_location = :local else Puppet::SSL::Host.ca_location = :only @@ -82,4 +208,17 @@ class Puppet::Application::Cert < Puppet::Application exit(23) end end + + def parse_options + # handle the bareword subcommand pattern. + result = super + unless self.subcommand then + if sub = self.command_line.args.shift then + self.subcommand = sub + else + help + end + end + result + end end diff --git a/lib/puppet/application/describe.rb b/lib/puppet/application/describe.rb index e76b347f6..79643159e 100644 --- a/lib/puppet/application/describe.rb +++ b/lib/puppet/application/describe.rb @@ -180,6 +180,60 @@ class Puppet::Application::Describe < Puppet::Application option("--list", "-l") option("--meta","-m") + def help + <<-HELP + +puppet-describe(8) -- Display help about resource types +======== + +SYNOPSIS +-------- +Prints help about Puppet resource types, providers, and metaparameters. + + +USAGE +----- +puppet describe [-h|--help] [-s|--short] [-p|--providers] [-l|--list] [-m|--meta] + + +OPTIONS +------- +* --help: + Print this help text + +* --providers: + Describe providers in detail for each type + +* --list: + List all types + +* --meta: + List all metaparameters + +* --short: + List only parameters without detail + + +EXAMPLE +------- + $ puppet describe --list + $ puppet describe file --providers + $ puppet describe user -s -m + + +AUTHOR +------ +David Lutterkort + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def preinit options[:parameters] = true end diff --git a/lib/puppet/application/doc.rb b/lib/puppet/application/doc.rb index aaefd6e75..74811919e 100644 --- a/lib/puppet/application/doc.rb +++ b/lib/puppet/application/doc.rb @@ -1,7 +1,6 @@ require 'puppet/application' class Puppet::Application::Doc < Puppet::Application - should_not_parse_config run_mode :master @@ -50,6 +49,99 @@ class Puppet::Application::Doc < Puppet::Application options[:references] << arg.intern end + def help + <<-HELP + +puppet-doc(8) -- Generate Puppet documentation and references +======== + +SYNOPSIS +-------- +Generates a reference for all Puppet types. Largely meant for internal +Puppet Labs use. + + +USAGE +----- +puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc-outputdir>] + [-m|--mode text|pdf|rdoc] [-r|--reference <reference-name>] + [--charset <charset>] [<manifest-file>] + + +DESCRIPTION +----------- +If mode is not 'rdoc', then this command generates a Markdown document +describing all installed Puppet types or all allowable arguments to +puppet executables. It is largely meant for internal use and is used to +generate the reference document available on the Puppet Labs web site. + +In 'rdoc' mode, this command generates an html RDoc hierarchy describing +the manifests that are in 'manifestdir' and 'modulepath' configuration +directives. The generated documentation directory is doc by default but +can be changed with the 'outputdir' option. + +If the command is run with the name of a manifest file as an argument, +puppet doc will output a single manifest's documentation on stdout. + + +OPTIONS +------- +* --all: + Output the docs for all of the reference types. In 'rdoc' + modes, this also outputs documentation for all resources + +* --help: + Print this help message + +* --outputdir: + Specifies the directory where to output the rdoc + documentation in 'rdoc' mode. + +* --mode: + Determine the output mode. Valid modes are 'text', 'pdf' and + 'rdoc'. The 'pdf' mode creates PDF formatted files in the + /tmp directory. The default mode is 'text'. In 'rdoc' mode + you must provide 'manifests-path' + +* --reference: + Build a particular reference. Get a list of references by + running 'puppet doc --list'. + +* --charset: + Used only in 'rdoc' mode. It sets the charset used in the + html files produced. + + +EXAMPLE +------- + $ puppet doc -r type > /tmp/type_reference.markdown + +or + + $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests + +or + + $ puppet doc /etc/puppet/manifests/site.pp + +or + + $ puppet doc -m pdf -r configuration + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005-2007 Puppet Labs, LLC Licensed under the GNU Public +License + +HELP + end + def handle_unknown( opt, arg ) @unknown_args << {:opt => opt, :arg => arg } true @@ -70,11 +162,6 @@ class Puppet::Application::Doc < Puppet::Application files += command_line.args Puppet.info "scanning: #{files.inspect}" - Puppet.settings.setdefaults( - "puppetdoc", - - "document_all" => [false, "Document all resources"] - ) Puppet.settings[:document_all] = options[:all] || false begin require 'puppet/util/rdoc' diff --git a/lib/puppet/application/filebucket.rb b/lib/puppet/application/filebucket.rb index 9c3c79bc3..063d97db8 100644 --- a/lib/puppet/application/filebucket.rb +++ b/lib/puppet/application/filebucket.rb @@ -12,6 +12,109 @@ class Puppet::Application::Filebucket < Puppet::Application attr :args + def help + <<-HELP + +puppet-filebucket(8) -- Store and retrieve files in a filebucket +======== + +SYNOPSIS +-------- +A stand-alone Puppet filebucket client. + + +USAGE +----- +puppet filebucket <mode> [-h|--help] [-V|--version] [-d|--debug] + [-v|--verbose] [-l|--local] [-r|--remote] [-s|--server <server>] + [-b|--bucket <directory>] <file> <file> ... + +Puppet filebucket can operate in three modes, with only one mode per call: + +backup: + Send one or more files to the specified file bucket. Each sent file is + printed with its resulting md5 sum. + +get: + Return the text associated with an md5 sum. The text is printed to + stdout, and only one file can be retrieved at a time. + +restore: + Given a file path and an md5 sum, store the content associated with + the sum into the specified file path. You can specify an entirely new + path to this argument; you are not restricted to restoring the content + to its original location. + + +DESCRIPTION +----------- +This is a stand-alone filebucket client for sending files to a local or +central filebucket. + +Note that 'filebucket' defaults to using a network-based filebucket +available on the server named 'puppet'. To use this, you'll have to be +running as a user with valid Puppet certificates. Alternatively, you can +use your local file bucket by specifying '--local'. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'ssldir' is a valid +configuration parameter, so you can specify '--ssldir <directory>' as an +argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet with +'--genconfig'. + +* --debug: + Enable full debugging. + +* --help: + Print this help message + +* --local: + Use the local filebucket. This will use the default configuration + information. + +* --remote: + Use a remote filebucket. This will use the default configuration + information. + +* --server: + The server to send the file to, instead of locally. + +* --verbose: + Print extra information. + +* --version: + Print version information. + + +EXAMPLE +------- + $ puppet filebucket backup /etc/passwd + /etc/passwd: 429b225650b912a2ee067b0a4cf1e949 + $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + + def run_command @args = command_line.args command = args.shift @@ -52,7 +155,7 @@ class Puppet::Application::Filebucket < Puppet::Application @client = nil @server = nil - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Cancelling" exit(1) end diff --git a/lib/puppet/application/inspect.rb b/lib/puppet/application/inspect.rb index 19324e285..e448cb9e8 100644 --- a/lib/puppet/application/inspect.rb +++ b/lib/puppet/application/inspect.rb @@ -19,6 +19,62 @@ class Puppet::Application::Inspect < Puppet::Application end end + def help + <<-HELP + +puppet-inspect(8) -- Send an inspection report +======== + +SYNOPSIS +-------- + +Prepares and submits an inspection report to the puppet master. + + +USAGE +----- +puppet inspect + + +DESCRIPTION +----------- + +This command uses the cached catalog from the previous run of 'puppet +agent' to determine which attributes of which resources have been +marked as auditable with the 'audit' metaparameter. It then examines +the current state of the system, writes the state of the specified +resource attributes to a report, and submits the report to the puppet +master. + +Puppet inspect does not run as a daemon, and must be run manually or +from cron. + + +OPTIONS +------- + +Any configuration setting which is valid in the configuration file is +also a valid long argument, e.g. '--server=master.domain.com'. See the +configuration file documentation at +http://docs.puppetlabs.com/references/latest/configuration.html for +the full list of acceptable settings. + + +AUTHOR +------ + +Puppet Labs + + +COPYRIGHT +--------- + +Copyright (c) 2011 Puppet Labs, LLC +Licensed under the GNU General Public License version 2 + + HELP + end + def setup exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? @@ -29,7 +85,7 @@ class Puppet::Application::Inspect < Puppet::Application Puppet::Util::Log.newdestination(@report) Puppet::Util::Log.newdestination(:console) unless options[:logset] - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Exiting" exit(1) end @@ -45,79 +101,81 @@ class Puppet::Application::Inspect < Puppet::Application end def run_command - retrieval_starttime = Time.now + benchmark(:notice, "Finished inspection") do + retrieval_starttime = Time.now - unless catalog = Puppet::Resource::Catalog.indirection.find(Puppet[:certname]) - raise "Could not find catalog for #{Puppet[:certname]}" - end + unless catalog = Puppet::Resource::Catalog.indirection.find(Puppet[:certname]) + raise "Could not find catalog for #{Puppet[:certname]}" + end - @report.configuration_version = catalog.version + @report.configuration_version = catalog.version - inspect_starttime = Time.now - @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime) + inspect_starttime = Time.now + @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime) - if Puppet[:archive_files] - dipper = Puppet::FileBucket::Dipper.new(:Server => Puppet[:archive_file_server]) - end + if Puppet[:archive_files] + dipper = Puppet::FileBucket::Dipper.new(:Server => Puppet[:archive_file_server]) + end - catalog.to_ral.resources.each do |ral_resource| - audited_attributes = ral_resource[:audit] - next unless audited_attributes + catalog.to_ral.resources.each do |ral_resource| + audited_attributes = ral_resource[:audit] + next unless audited_attributes - status = Puppet::Resource::Status.new(ral_resource) + status = Puppet::Resource::Status.new(ral_resource) - begin - audited_resource = ral_resource.to_resource - rescue StandardError => detail - puts detail.backtrace if Puppet[:trace] - ral_resource.err "Could not inspect #{ral_resource}; skipping: #{detail}" - audited_attributes.each do |name| - event = ral_resource.event( - :property => name, - :status => "failure", - :audited => true, - :message => "failed to inspect #{name}" - ) - status.add_event(event) - end - else - audited_attributes.each do |name| - next if audited_resource[name].nil? - # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW - if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent + begin + audited_resource = ral_resource.to_resource + rescue StandardError => detail + puts detail.backtrace if Puppet[:trace] + ral_resource.err "Could not inspect #{ral_resource}; skipping: #{detail}" + audited_attributes.each do |name| event = ral_resource.event( - :previous_value => audited_resource[name], - :property => name, - :status => "audit", - :audited => true, - :message => "inspected value is #{audited_resource[name].inspect}" - ) + :property => name, + :status => "failure", + :audited => true, + :message => "failed to inspect #{name}" + ) status.add_event(event) end + else + audited_attributes.each do |name| + next if audited_resource[name].nil? + # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW + if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent + event = ral_resource.event( + :previous_value => audited_resource[name], + :property => name, + :status => "audit", + :audited => true, + :message => "inspected value is #{audited_resource[name].inspect}" + ) + status.add_event(event) + end + end end - end - if Puppet[:archive_files] and ral_resource.type == :file and audited_attributes.include?(:content) - path = ral_resource[:path] - if File.readable?(path) - begin - dipper.backup(path) - rescue StandardError => detail - Puppet.warning detail + if Puppet[:archive_files] and ral_resource.type == :file and audited_attributes.include?(:content) + path = ral_resource[:path] + if File.readable?(path) + begin + dipper.backup(path) + rescue StandardError => detail + Puppet.warning detail + end end end + @report.add_resource_status(status) end - @report.add_resource_status(status) - end - finishtime = Time.now - @report.add_times("inspect", finishtime - inspect_starttime) - @report.finalize_report + finishtime = Time.now + @report.add_times("inspect", finishtime - inspect_starttime) + @report.finalize_report - begin - Puppet::Transaction::Report.indirection.save(@report) - rescue => detail - puts detail.backtrace if Puppet[:trace] - Puppet.err "Could not send report: #{detail}" + begin + Puppet::Transaction::Report.indirection.save(@report) + rescue => detail + puts detail.backtrace if Puppet[:trace] + Puppet.err "Could not send report: #{detail}" + end end end end diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb index 12dad653a..604132818 100644 --- a/lib/puppet/application/kick.rb +++ b/lib/puppet/application/kick.rb @@ -37,6 +37,147 @@ class Puppet::Application::Kick < Puppet::Application end end + def help + <<-HELP + +puppet-kick(8) -- Remotely control puppet agent +======== + +SYNOPSIS +-------- +Trigger a puppet agent run on a set of hosts. + + +USAGE +----- +puppet kick [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground] + [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules] + [-t|--tag <tag>] [--test] [-p|--ping] <host> [<host> [...]] + + +DESCRIPTION +----------- +This script can be used to connect to a set of machines running 'puppet +agent' and trigger them to run their configurations. The most common +usage would be to specify a class of hosts and a set of tags, and +'puppet kick' would look up in LDAP all of the hosts matching that +class, then connect to each host and trigger a run of all of the objects +with the specified tags. + +If you are not storing your host configurations in LDAP, you can specify +hosts manually. + +You will most likely have to run 'puppet kick' as root to get access to +the SSL certificates. + +'puppet kick' reads 'puppet master''s configuration file, so that it can +copy things like LDAP settings. + + +USAGE NOTES +----------- +'puppet kick' is useless unless 'puppet agent' is listening. See its +documentation for more information, but the gist is that you must enable +'listen' on the 'puppet agent' daemon, either using '--listen' on the +command line or adding 'listen = true' in its config file. In addition, +you need to set the daemons up to specifically allow connections by +creating the 'namespaceauth' file, normally at +'/etc/puppet/namespaceauth.conf'. This file specifies who has access to +each namespace; if you create the file you must add every namespace you +want any Puppet daemon to allow -- it is currently global to all Puppet +daemons. + +An example file looks like this: + + [fileserver] + allow *.madstop.com + + [puppetmaster] + allow *.madstop.com + + [puppetrunner] + allow culain.madstop.com + +This is what you would install on your Puppet master; non-master hosts +could leave off the 'fileserver' and 'puppetmaster' namespaces. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'ssldir' is a valid +configuration parameter, so you can specify '--ssldir <directory>' as an +argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/latest/configuration.html for +the full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet master +with '--genconfig'. + +* --all: + Connect to all available hosts. Requires LDAP support at this point. + +* --class: + Specify a class of machines to which to connect. This only works if + you have LDAP configured, at the moment. + +* --debug: + Enable full debugging. + +* --foreground: + Run each configuration in the foreground; that is, when connecting to + a host, do not return until the host has finished its run. The default + is false. + +* --help: + Print this help message + +* --host: + A specific host to which to connect. This flag can be specified more + than once. + +* --ignoreschedules: + Whether the client should ignore schedules when running its + configuration. This can be used to force the client to perform work it + would not normally perform so soon. The default is false. + +* --parallel: + How parallel to make the connections. Parallelization is provided by + forking for each client to which to connect. The default is 1, meaning + serial execution. + +* --tag: + Specify a tag for selecting the objects to apply. Does not work with + the --test option. + +* --test: + Print the hosts you would connect to but do not actually connect. This + option requires LDAP support at this point. + +* --ping: + Do a ICMP echo against the target host. Skip hosts that don't respond + to ping. + + +EXAMPLE +------- + $ sudo puppet kick -p 10 -t remotefile -t webserver host1 host2 + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def run_command @hosts += command_line.args options[:test] ? test : main @@ -151,7 +292,7 @@ class Puppet::Application::Kick < Puppet::Application def preinit [:INT, :TERM].each do |signal| - trap(signal) do + Signal.trap(signal) do $stderr.puts "Cancelling" exit(1) end @@ -195,7 +336,7 @@ class Puppet::Application::Kick < Puppet::Application # If we get a signal, then kill all of our children and get out. [:INT, :TERM].each do |signal| - trap(signal) do + Signal.trap(signal) do Puppet.notice "Caught #{signal}; shutting down" @children.each do |pid, host| Process.kill("INT", pid) diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb index 879b66c67..3bfad89f4 100644 --- a/lib/puppet/application/master.rb +++ b/lib/puppet/application/master.rb @@ -25,8 +25,94 @@ class Puppet::Application::Master < Puppet::Application end end + def help + <<-HELP + +puppet-master(8) -- The puppet master daemon +======== + +SYNOPSIS +-------- +The central puppet server. Functions as a certificate authority by +default. + + +USAGE +----- +puppet master [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help] + [-l|--logdest <file>|console|syslog] [-v|--verbose] [-V|--version] + [--compile <node-name>] + + +DESCRIPTION +----------- +This command starts an instance of puppet master, running as a daemon +and using Ruby's built-in Webrick webserver. Puppet master can also be +managed by other application servers; when this is the case, this +executable is not used. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'ssldir' is a valid +configuration parameter, so you can specify '--ssldir <directory>' as an +argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet master +with '--genconfig'. + +* --daemonize: + Send the process into the background. This is the default. + +* --no-daemonize: + Do not send the process into the background. + +* --debug: + Enable full debugging. + +* --help: + Print this help message. + +* --logdest: + Where to send messages. Choose between syslog, the console, and a log + file. Defaults to sending messages to syslog, or the console if + debugging or verbosity is enabled. + +* --verbose: + Enable verbosity. + +* --version: + Print the puppet version number and exit. + +* --compile: + Compile a catalogue and output it in JSON from the puppet master. Uses + facts contained in the $vardir/yaml/ directory to compile the catalog. + + +EXAMPLE +------- + puppet master + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def preinit - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Cancelling startup" exit(0) end diff --git a/lib/puppet/application/queue.rb b/lib/puppet/application/queue.rb index b9e8ca4ca..de8aea32a 100644 --- a/lib/puppet/application/queue.rb +++ b/lib/puppet/application/queue.rb @@ -15,13 +15,13 @@ class Puppet::Application::Queue < Puppet::Application # Do an initial trap, so that cancels don't get a stack trace. # This exits with exit code 1 - trap(:INT) do + Signal.trap(:INT) do $stderr.puts "Caught SIGINT; shutting down" exit(1) end # This is a normal shutdown, so code 0 - trap(:TERM) do + Signal.trap(:TERM) do $stderr.puts "Caught SIGTERM; shutting down" exit(0) end @@ -37,6 +37,79 @@ class Puppet::Application::Queue < Puppet::Application option("--debug","-d") option("--verbose","-v") + def help + <<-HELP + +puppet-queue(8) -- Queuing daemon for asynchronous storeconfigs +======== + +SYNOPSIS +-------- +Retrieves serialized storeconfigs records from a queue and processes +them in order. + + +USAGE +----- +puppet queue [-d|--debug] [-v|--verbose] + + +DESCRIPTION +----------- +This application runs as a daemon and processes storeconfigs data, +retrieving the data from a stomp server message queue and writing it to +a database. + +For more information, including instructions for properly setting up +your puppet master and message queue, see the documentation on setting +up asynchronous storeconfigs at: +http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'server' is a valid +configuration parameter, so you can specify '--server <servername>' as +an argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet queue with +'--genconfig'. + +* --debug: + Enable full debugging. + +* --help: + Print this help message + +* --verbose: + Turn on verbose reporting. + +* --version: + Print the puppet version number and exit. + + +EXAMPLE +------- + $ puppet queue + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2009 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def main require 'puppet/indirector/catalog/queue' # provides Puppet::Indirector::Queue.subscribe Puppet.notice "Starting puppetqd #{Puppet.version}" diff --git a/lib/puppet/application/resource.rb b/lib/puppet/application/resource.rb index c7c1c28be..3995c285b 100644 --- a/lib/puppet/application/resource.rb +++ b/lib/puppet/application/resource.rb @@ -35,6 +35,109 @@ class Puppet::Application::Resource < Puppet::Application @extra_params << arg.to_sym end + def help + <<-HELP + +puppet-resource(8) -- The resource abstraction layer shell +======== + +SYNOPSIS +-------- +Uses the Puppet RAL to directly interact with the system. + + +USAGE +----- +puppet resource [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit] + [-H|--host <host>] [-p|--param <parameter>] [-t|--types] <type> + [<name>] [<attribute>=<value> ...] + + +DESCRIPTION +----------- +This command provides simple facilities for converting current system +state into Puppet code, along with some ability to modify the current +state using Puppet's RAL. + +By default, you must at least provide a type to list, in which case +puppet resource will tell you everything it knows about all resources of +that type. You can optionally specify an instance name, and puppet +resource will only describe that single instance. + +If given a type, a name, and a series of <attribute>=<value> pairs, +puppet resource will modify the state of the specified resource. +Alternately, if given a type, a name, and the '--edit' flag, puppet +resource will write its output to a file, open that file in an editor, +and then apply the saved file as a Puppet transaction. + + +OPTIONS +------- +Note that any configuration parameter that's valid in the configuration +file is also a valid long argument. For example, 'ssldir' is a valid +configuration parameter, so you can specify '--ssldir <directory>' as an +argument. + +See the configuration file documentation at +http://docs.puppetlabs.com/references/stable/configuration.html for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppet with +'--genconfig'. + +* --debug: + Enable full debugging. + +* --edit: + Write the results of the query to a file, open the file in an editor, + and read the file back in as an executable Puppet manifest. + +* --host: + When specified, connect to the resource server on the named host + and retrieve the list of resouces of the type specified. + +* --help: + Print this help message. + +* --param: + Add more parameters to be outputted from queries. + +* --types: + List all available types. + +* --verbose: + Print extra information. + + +EXAMPLE +------- +This example uses `puppet resource` to return a Puppet configuration for +the user `luke`: + + $ puppet resource user luke + user { 'luke': + home => '/home/luke', + uid => '100', + ensure => 'present', + comment => 'Luke Kanies,,,', + gid => '1000', + shell => '/bin/bash', + groups => ['sysadmin','audio','video','puppet'] + } + + +AUTHOR +------ +Luke Kanies + + +COPYRIGHT +--------- +Copyright (c) 2005-2007 Puppet Labs, LLC Licensed under the GNU Public +License + + HELP + end + def main args = command_line.args type = args.shift or raise "You must specify the type to display" diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb index 1b587ed4b..b3696201a 100644 --- a/lib/puppet/configurer/downloader.rb +++ b/lib/puppet/configurer/downloader.rb @@ -50,6 +50,7 @@ class Puppet::Configurer::Downloader def catalog catalog = Puppet::Resource::Catalog.new + catalog.host_config = false catalog.add_resource(file) catalog end diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb index cfc6b5a0b..ae088f26f 100644 --- a/lib/puppet/configurer/plugin_handler.rb +++ b/lib/puppet/configurer/plugin_handler.rb @@ -9,7 +9,14 @@ module Puppet::Configurer::PluginHandler # Retrieve facts from the central server. def download_plugins return nil unless download_plugins? - Puppet::Configurer::Downloader.new("plugin", Puppet[:plugindest], Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) } + plugin_downloader = Puppet::Configurer::Downloader.new( + "plugin", + Puppet[:plugindest], + Puppet[:pluginsource], + Puppet[:pluginsignore] + ) + + plugin_downloader.evaluate.each { |file| load_plugin(file) } end def load_plugin(file) diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb index c76d63a54..22630ffb8 100755 --- a/lib/puppet/daemon.rb +++ b/lib/puppet/daemon.rb @@ -95,7 +95,7 @@ class Puppet::Daemon # extended signals not supported under windows signals.update({:HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs }) unless Puppet.features.microsoft_windows? signals.each do |signal, method| - trap(signal) do + Signal.trap(signal) do Puppet.notice "Caught #{signal}; calling #{method}" send(method) end diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index e3b86bca4..f308d4476 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -14,7 +14,11 @@ module Puppet setdefaults(:main, :trace => [false, "Whether to print stack traces on some errors"], - :autoflush => [false, "Whether log files should always flush to disk."], + :autoflush => { + :default => false, + :desc => "Whether log files should always flush to disk.", + :hook => proc { |value| Log.autoflush = value } + }, :syslogfacility => ["daemon", "What syslog facility to use when logging to syslog. Syslog has a fixed list of valid facilities, and you must choose one of those; you cannot just make one up."], @@ -818,4 +822,8 @@ module Puppet directories." ] ) + setdefaults( + :puppetdoc, + :document_all => [false, "Document all resources"] + ) end diff --git a/lib/puppet/external/nagios.rb b/lib/puppet/external/nagios.rb index 6b8852ee5..2ed829198 100755 --- a/lib/puppet/external/nagios.rb +++ b/lib/puppet/external/nagios.rb @@ -3,8 +3,6 @@ #-------------------- # A script to retrieve hosts from ldap and create an importable # cfservd file from them -# -# $Id: nagios.rb,v 1.3 2004/06/09 20:32:46 luke Exp $ require 'digest/md5' #require 'ldap' diff --git a/lib/puppet/external/nagios/base.rb b/lib/puppet/external/nagios/base.rb index ac1d25e2e..e98760e01 100755 --- a/lib/puppet/external/nagios/base.rb +++ b/lib/puppet/external/nagios/base.rb @@ -470,5 +470,3 @@ class Nagios::Base end end - -# $Id$ diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb index be487d83f..d6f6a3747 100644 --- a/lib/puppet/file_bucket/dipper.rb +++ b/lib/puppet/file_bucket/dipper.rb @@ -34,11 +34,12 @@ class Puppet::FileBucket::Dipper contents = ::File.read(file) begin file_bucket_file = Puppet::FileBucket::File.new(contents, :bucket_path => @local_path) - dest_path = "#{@rest_path}#{file_bucket_file.name}" + files_original_path = absolutize_path(file) + dest_path = "#{@rest_path}#{file_bucket_file.name}#{files_original_path}" # Make a HEAD request for the file so that we don't waste time # uploading it if it already exists in the bucket. - unless Puppet::FileBucket::File.indirection.head("#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}") + unless Puppet::FileBucket::File.indirection.head("#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}#{files_original_path}") Puppet::FileBucket::File.indirection.save(file_bucket_file, dest_path) end diff --git a/lib/puppet/indirector/facts/inventory_active_record.rb b/lib/puppet/indirector/facts/inventory_active_record.rb new file mode 100644 index 000000000..db4c63f00 --- /dev/null +++ b/lib/puppet/indirector/facts/inventory_active_record.rb @@ -0,0 +1,97 @@ +require 'puppet/rails' +require 'puppet/rails/inventory_node' +require 'puppet/rails/inventory_fact' +require 'puppet/indirector/active_record' + +class Puppet::Node::Facts::InventoryActiveRecord < Puppet::Indirector::ActiveRecord + def find(request) + node = Puppet::Rails::InventoryNode.find_by_name(request.key) + return nil unless node + facts = Puppet::Node::Facts.new(node.name, node.facts_to_hash) + facts.timestamp = node.timestamp + facts + end + + def save(request) + facts = request.instance + node = Puppet::Rails::InventoryNode.find_by_name(request.key) || Puppet::Rails::InventoryNode.create(:name => request.key, :timestamp => facts.timestamp) + node.timestamp = facts.timestamp + + ActiveRecord::Base.transaction do + Puppet::Rails::InventoryFact.delete_all(:node_id => node.id) + # We don't want to save internal values as facts, because those are + # metadata that belong on the node + facts.values.each do |name,value| + next if name.to_s =~ /^_/ + node.facts.build(:name => name, :value => value) + end + node.save + end + end + + def search(request) + return [] unless request.options + matching_nodes = [] + fact_names = [] + fact_filters = Hash.new {|h,k| h[k] = []} + meta_filters = Hash.new {|h,k| h[k] = []} + request.options.each do |key,value| + type, name, operator = key.to_s.split(".") + operator ||= "eq" + if type == "facts" + fact_filters[operator] << [name,value] + elsif type == "meta" and name == "timestamp" + meta_filters[operator] << [name,value] + end + end + + matching_nodes = nodes_matching_fact_filters(fact_filters) + nodes_matching_meta_filters(meta_filters) + + # to_a because [].inject == nil + matching_nodes.inject {|nodes,this_set| nodes & this_set}.to_a.sort + end + + private + + def nodes_matching_fact_filters(fact_filters) + node_sets = [] + fact_filters['eq'].each do |name,value| + node_sets << Puppet::Rails::InventoryNode.has_fact_with_value(name,value).map {|node| node.name} + end + fact_filters['ne'].each do |name,value| + node_sets << Puppet::Rails::InventoryNode.has_fact_without_value(name,value).map {|node| node.name} + end + { + 'gt' => '>', + 'lt' => '<', + 'ge' => '>=', + 'le' => '<=' + }.each do |operator_name,operator| + fact_filters[operator_name].each do |name,value| + facts = Puppet::Rails::InventoryFact.find_by_sql(["SELECT inventory_facts.value, inventory_nodes.name AS node_name + FROM inventory_facts INNER JOIN inventory_nodes + ON inventory_facts.node_id = inventory_nodes.id + WHERE inventory_facts.name = ?", name]) + node_sets << facts.select {|fact| fact.value.to_f.send(operator, value.to_f)}.map {|fact| fact.node_name} + end + end + node_sets + end + + def nodes_matching_meta_filters(meta_filters) + node_sets = [] + { + 'eq' => '=', + 'ne' => '!=', + 'gt' => '>', + 'lt' => '<', + 'ge' => '>=', + 'le' => '<=' + }.each do |operator_name,operator| + meta_filters[operator_name].each do |name,value| + node_sets << Puppet::Rails::InventoryNode.find(:all, :select => "name", :conditions => ["timestamp #{operator} ?", value]).map {|node| node.name} + end + end + node_sets + end +end diff --git a/lib/puppet/indirector/facts/yaml.rb b/lib/puppet/indirector/facts/yaml.rb index 89feaf2ab..65bd78354 100644 --- a/lib/puppet/indirector/facts/yaml.rb +++ b/lib/puppet/indirector/facts/yaml.rb @@ -4,4 +4,79 @@ require 'puppet/indirector/yaml' class Puppet::Node::Facts::Yaml < Puppet::Indirector::Yaml desc "Store client facts as flat files, serialized using YAML, or return deserialized facts from disk." + + def search(request) + node_names = [] + Dir.glob(yaml_dir_path).each do |file| + facts = YAML.load_file(file) + node_names << facts.name if node_matches?(facts, request.options) + end + node_names + end + + private + + # Return the path to a given node's file. + def yaml_dir_path + base = Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir] + File.join(base, 'facts', '*.yaml') + end + + def node_matches?(facts, options) + options.each do |key, value| + type, name, operator = key.to_s.split(".") + operator ||= 'eq' + + return false unless node_matches_option?(type, name, operator, value, facts) + end + return true + end + + def node_matches_option?(type, name, operator, value, facts) + case type + when "meta" + case name + when "timestamp" + compare_timestamp(operator, facts.timestamp, Time.parse(value)) + end + when "facts" + compare_facts(operator, facts.values[name], value) + end + end + + def compare_facts(operator, value1, value2) + return false unless value1 + + case operator + when "eq" + value1.to_s == value2.to_s + when "le" + value1.to_f <= value2.to_f + when "ge" + value1.to_f >= value2.to_f + when "lt" + value1.to_f < value2.to_f + when "gt" + value1.to_f > value2.to_f + when "ne" + value1.to_s != value2.to_s + end + end + + def compare_timestamp(operator, value1, value2) + case operator + when "eq" + value1 == value2 + when "le" + value1 <= value2 + when "ge" + value1 >= value2 + when "lt" + value1 < value2 + when "gt" + value1 > value2 + when "ne" + value1 != value2 + end + end end diff --git a/lib/puppet/indirector/file_bucket_file/file.rb b/lib/puppet/indirector/file_bucket_file/file.rb index 8bea2d767..0fd8a914f 100644 --- a/lib/puppet/indirector/file_bucket_file/file.rb +++ b/lib/puppet/indirector/file_bucket_file/file.rb @@ -14,10 +14,12 @@ module Puppet::FileBucketFile end def find( request ) - checksum = request_to_checksum( request ) - file_path = path_for(request.options[:bucket_path], checksum, 'contents') + checksum, files_original_path = request_to_checksum_and_path( request ) + dir_path = path_for(request.options[:bucket_path], checksum) + file_path = ::File.join(dir_path, 'contents') return nil unless ::File.exists?(file_path) + return nil unless path_match(dir_path, files_original_path) if request.options[:diff_with] hash_protocol = sumtype(checksum) @@ -32,32 +34,47 @@ module Puppet::FileBucketFile end def head(request) - checksum = request_to_checksum(request) - file_path = path_for(request.options[:bucket_path], checksum, 'contents') - ::File.exists?(file_path) + checksum, files_original_path = request_to_checksum_and_path(request) + dir_path = path_for(request.options[:bucket_path], checksum) + + ::File.exists?(::File.join(dir_path, 'contents')) and path_match(dir_path, files_original_path) end def save( request ) instance = request.instance + checksum, files_original_path = request_to_checksum_and_path(request) - save_to_disk(instance) + save_to_disk(instance, files_original_path) instance.to_s end private - def save_to_disk( bucket_file ) + def path_match(dir_path, files_original_path) + return true unless files_original_path # if no path was provided, it's a match + paths_path = ::File.join(dir_path, 'paths') + return false unless ::File.exists?(paths_path) + ::File.open(paths_path) do |f| + f.each do |line| + return true if line.chomp == files_original_path + end + end + return false + end + + def save_to_disk( bucket_file, files_original_path ) filename = path_for(bucket_file.bucket_path, bucket_file.checksum_data, 'contents') - dirname = path_for(bucket_file.bucket_path, bucket_file.checksum_data) + dir_path = path_for(bucket_file.bucket_path, bucket_file.checksum_data) + paths_path = ::File.join(dir_path, 'paths') # If the file already exists, do nothing. if ::File.exist?(filename) verify_identical_file!(bucket_file) else # Make the directories if necessary. - unless ::File.directory?(dirname) + unless ::File.directory?(dir_path) Puppet::Util.withumask(0007) do - ::FileUtils.mkdir_p(dirname) + ::FileUtils.mkdir_p(dir_path) end end @@ -68,15 +85,27 @@ module Puppet::FileBucketFile ::File.open(filename, ::File::WRONLY|::File::CREAT, 0440) do |of| of.print bucket_file.contents end + ::File.open(paths_path, ::File::WRONLY|::File::CREAT, 0640) do |of| + # path will be written below + end + end + end + + unless path_match(dir_path, files_original_path) + ::File.open(paths_path, 'a') do |f| + f.puts(files_original_path) end end end - def request_to_checksum( request ) - checksum_type, checksum, path = request.key.split(/\//, 3) # Note: we ignore path if present. + def request_to_checksum_and_path( request ) + checksum_type, checksum, path = request.key.split(/\//, 3) + if path == '' # Treat "md5/<checksum>/" like "md5/<checksum>" + path = nil + end raise "Unsupported checksum type #{checksum_type.inspect}" if checksum_type != 'md5' raise "Invalid checksum #{checksum.inspect}" if checksum !~ /^[0-9a-f]{32}$/ - checksum + [checksum, path] end def path_for(bucket_path, digest, subfile = nil) diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index 8da19c2ce..43266b2b5 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -191,7 +191,7 @@ class Puppet::Module def backward_compatible_plugins_dir if dir = File.join(path, "plugins") and FileTest.exist?(dir) - warning "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" + Puppet.warning "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" return dir else return File.join(path, "lib") diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb index 4b7c15a36..dcb0e0a22 100644 --- a/lib/puppet/network/http/api/v1.rb +++ b/lib/puppet/network/http/api/v1.rb @@ -63,9 +63,9 @@ module Puppet::Network::HTTP::API::V1 return :singular if indirection == "status" return :plural if indirection == "inventory" - result = (indirection =~ /s$/) ? :plural : :singular + result = (indirection =~ /s$|_search$/) ? :plural : :singular - indirection.sub!(/s$/, '') if result + indirection.sub!(/s$|_search$|es$/, '') result end diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb index d9b56f184..c8d001169 100644 --- a/lib/puppet/network/http/compression.rb +++ b/lib/puppet/network/http/compression.rb @@ -75,7 +75,10 @@ module Puppet::Network::HTTP::Compression # in this case, we try with a verbatim (no header) # deflater. @uncompressor = Zlib::Inflate.new - retry if @first + if @first then + @first = false + retry + end raise end diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb index b7e1d9709..602927a78 100644 --- a/lib/puppet/network/http/rack/rest.rb +++ b/lib/puppet/network/http/rack/rest.rb @@ -76,9 +76,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler # request.body has some limitiations, so we need to concat it back # into a regular string, which is something puppet can use. def body(request) - body = '' - request.body.each { |part| body += part } - body + request.body.read end def extract_client_info(request) diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb index 9e3632499..cf76978fe 100644 --- a/lib/puppet/network/rest_authconfig.rb +++ b/lib/puppet/network/rest_authconfig.rb @@ -61,7 +61,7 @@ module Puppet def insert_default_acl DEFAULT_ACL.each do |acl| unless rights[acl[:acl]] - Puppet.info "Inserting default '#{acl[:acl]}'(#{acl[:authenticated] ? "auth" : "non-auth"}) acl because #{( !exists? ? "#{Puppet[:rest_authconfig]} doesn't exist" : "none where found in '#{@file}'")}" + Puppet.info "Inserting default '#{acl[:acl]}'(#{acl[:authenticated] ? "auth" : "non-auth"}) ACL because #{( !exists? ? "#{Puppet[:rest_authconfig]} doesn't exist" : "none were found in '#{@file}'")}" mk_acl(acl) end end diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb index 56af53983..6fde181c9 100755 --- a/lib/puppet/network/rights.rb +++ b/lib/puppet/network/rights.rb @@ -83,7 +83,7 @@ class Rights else # there were no rights allowing/denying name # if name is not a path, let's throw - raise ArgumentError.new "Unknown namespace right '#{name}'" + raise ArgumentError, "Unknown namespace right '#{name}'" end error end diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb index 451813f7d..577b62b62 100755 --- a/lib/puppet/node/facts.rb +++ b/lib/puppet/node/facts.rb @@ -61,7 +61,7 @@ class Puppet::Node::Facts def self.from_pson(data) result = new(data['name'], data['values']) - result.values[:_timestamp] = Time.parse(data['timestamp']) + result.timestamp = Time.parse(data['timestamp']) result.expiration = Time.parse(data['expiration']) result end @@ -70,8 +70,8 @@ class Puppet::Node::Facts { 'expiration' => expiration, 'name' => name, - 'timestamp' => values[:_timestamp], - 'values' => values.reject {|k,v| k == :_timestamp}, + 'timestamp' => timestamp, + 'values' => strip_internal, }.to_pson(*args) end diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb index ef36b7143..565b83195 100644 --- a/lib/puppet/parser/ast/collection.rb +++ b/lib/puppet/parser/ast/collection.rb @@ -16,6 +16,7 @@ class Puppet::Parser::AST str, code = query && query.safeevaluate(scope) resource_type = scope.find_resource_type(@type) + fail "Resource type #{@type} doesn't exist" unless resource_type newcoll = Puppet::Parser::Collector.new(scope, resource_type.name, str, code, self.form) scope.compiler.add_collection(newcoll) @@ -26,10 +27,10 @@ class Puppet::Parser::AST params = @override.collect { |param| param.safeevaluate(scope) } newcoll.add_override( :parameters => params, - :file => @file, - :line => @line, - :source => scope.source, - :scope => scope + :file => @file, + :line => @line, + :source => scope.source, + :scope => scope ) end diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index fcdd219d7..77617e992 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -67,7 +67,7 @@ class Puppet::Parser::AST end def to_s - "concat(#{@value.join(',')})" + "#{@value.map { |s| s.to_s.gsub(/^"(.*)"$/, '\1') }.join}" end end diff --git a/lib/puppet/parser/functions/regsubst.rb b/lib/puppet/parser/functions/regsubst.rb index f655db7b3..b6bb5afcf 100644 --- a/lib/puppet/parser/functions/regsubst.rb +++ b/lib/puppet/parser/functions/regsubst.rb @@ -4,25 +4,18 @@ module Puppet::Parser::Functions :regsubst, :type => :rvalue, :doc => " - Perform regexp replacement on a string or array of strings. +Perform regexp replacement on a string or array of strings. * *Parameters* (in order): - - _target_ The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array. - - _regexp_ The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself. - - _replacement_ Replacement string. Can contain back references to what was matched using \\0, \\1, and so on. - - _flags_ Optional. String of single letter flags for how the regexp is interpreted: - + * _target_ The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array. + * _regexp_ The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself. + * _replacement_ Replacement string. Can contain backreferences to what was matched using \\0 (whole match), \\1 (first set of parentheses), and so on. + * _flags_ Optional. String of single letter flags for how the regexp is interpreted: - *E* Extended regexps - *I* Ignore case in regexps - *M* Multiline regexps - *G* Global replacement; all occurrences of the regexp in each target string will be replaced. Without this, only the first occurrence will be replaced. - - _lang_ Optional. How to handle multibyte characters. A single-character string with the following values: - + * _encoding_ Optional. How to handle multibyte characters. A single-character string with the following values: - *N* None - *E* EUC - *S* SJIS @@ -32,7 +25,7 @@ module Puppet::Parser::Functions Get the third octet from the node's IP address: - $i3 = regsubst($ipaddress,'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$','\\3') + $i3 = regsubst($ipaddress,'^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$','\\3') Put angle brackets around each octet in the node's IP address: diff --git a/lib/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb index 52394095a..ad027865b 100644 --- a/lib/puppet/parser/functions/split.rb +++ b/lib/puppet/parser/functions/split.rb @@ -6,21 +6,21 @@ module Puppet::Parser::Functions :doc => "\ Split a string variable into an array using the specified split regexp. - Usage: +*Example:* $string = 'v1.v2:v3.v4' $array_var1 = split($string, ':') $array_var2 = split($string, '[.]') $array_var3 = split($string, '[.:]') -$array_var1 now holds the result ['v1.v2', 'v3.v4'], -while $array_var2 holds ['v1', 'v2:v3', 'v4'], and -$array_var3 holds ['v1', 'v2', 'v3', 'v4']. +`$array_var1` now holds the result `['v1.v2', 'v3.v4']`, +while `$array_var2` holds `['v1', 'v2:v3', 'v4']`, and +`$array_var3` holds `['v1', 'v2', 'v3', 'v4']`. -Note that in the second example, we split on a string that contains -a regexp meta-character (.), and that needs protection. A simple +Note that in the second example, we split on a literal string that contains +a regexp meta-character (.), which must be escaped. A simple way to do that for a single character is to enclose it in square -brackets.") do |args| +brackets; a backslash will also escape a single character.") do |args| raise Puppet::ParseError, ("split(): wrong number of arguments (#{args.length}; must be 2)") if args.length != 2 diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index ecb27f363..8339c51b7 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -574,6 +574,7 @@ selectlhand: name | funcrvalue | boolean | undef + | hasharrayaccess | DEFAULT { result = ast AST::Default, :value => val[0][:value], :line => val[0][:line] } @@ -767,7 +768,7 @@ hasharrayaccess: VARIABLE LBRACK rvalue RBRACK { } hasharrayaccesses: hasharrayaccess - | hasharrayaccess LBRACK rvalue RBRACK { + | hasharrayaccesses LBRACK rvalue RBRACK { result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2] } @@ -793,6 +794,3 @@ require 'puppet/parser/parser_support' # Local Variables: # mode: ruby # End: - -# $Id$ - diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 31d39ae2f..9a25263f6 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -476,9 +476,12 @@ class Puppet::Parser::Lexer @expected.pop end - if final_token.name == :LBRACE + if final_token.name == :LBRACE or final_token.name == :LPAREN commentpush end + if final_token.name == :RPAREN + commentpop + end yield [final_token.name, token_value] diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index 60b272e76..300ddddd6 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -1,11 +1,10 @@ # # DO NOT MODIFY!!!! -# This file is automatically generated by racc 1.4.5 -# from racc grammer file "grammar.ra". +# This file is automatically generated by Racc 1.4.6 +# from Racc grammer file "". # -require 'racc/parser' - +require 'racc/parser.rb' require 'puppet' require 'puppet/util/loadedfile' @@ -18,14 +17,11 @@ module Puppet class AlreadyImportedError < ImportError; end end - module Puppet - module Parser - class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id6362f948d9', 'grammar.ra', 788 +module_eval(<<'...end grammar.ra/module_eval...', 'grammar.ra', 789) # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -34,1328 +30,1341 @@ require 'puppet/parser/parser_support' # Local Variables: # mode: ruby # End: - -# $Id$ - -..end grammar.ra modeval..id6362f948d9 - -##### racc 1.4.5 generates ### - -racc_reduce_table = [ - 0, 0, :racc_error, - 1, 70, :_reduce_none, - 1, 70, :_reduce_none, - 1, 71, :_reduce_3, - 2, 71, :_reduce_4, - 1, 74, :_reduce_5, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 1, 73, :_reduce_none, - 3, 88, :_reduce_20, - 3, 88, :_reduce_21, - 1, 89, :_reduce_none, - 1, 89, :_reduce_none, - 1, 89, :_reduce_none, - 1, 90, :_reduce_none, - 1, 90, :_reduce_none, - 1, 90, :_reduce_none, - 1, 90, :_reduce_none, - 4, 82, :_reduce_29, - 5, 82, :_reduce_30, - 3, 82, :_reduce_31, - 2, 82, :_reduce_32, - 1, 92, :_reduce_33, - 1, 92, :_reduce_34, - 3, 92, :_reduce_35, - 3, 92, :_reduce_36, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_none, - 1, 93, :_reduce_45, - 5, 75, :_reduce_46, - 5, 75, :_reduce_47, - 5, 75, :_reduce_48, - 5, 86, :_reduce_49, - 2, 76, :_reduce_50, - 1, 109, :_reduce_51, - 2, 109, :_reduce_52, - 6, 77, :_reduce_53, - 2, 77, :_reduce_54, - 3, 110, :_reduce_55, - 3, 110, :_reduce_56, - 1, 111, :_reduce_none, - 1, 111, :_reduce_none, - 3, 111, :_reduce_59, - 1, 112, :_reduce_none, - 3, 112, :_reduce_61, - 1, 113, :_reduce_62, - 1, 113, :_reduce_63, - 3, 114, :_reduce_64, - 3, 114, :_reduce_65, - 1, 115, :_reduce_none, - 1, 115, :_reduce_none, - 4, 117, :_reduce_68, - 1, 103, :_reduce_69, - 3, 103, :_reduce_70, - 0, 104, :_reduce_none, - 1, 104, :_reduce_none, - 1, 119, :_reduce_73, - 1, 94, :_reduce_74, - 1, 96, :_reduce_75, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 1, 118, :_reduce_none, - 3, 78, :_reduce_83, - 3, 78, :_reduce_84, - 3, 87, :_reduce_85, - 0, 105, :_reduce_86, - 1, 105, :_reduce_87, - 3, 105, :_reduce_88, - 3, 123, :_reduce_89, - 3, 125, :_reduce_90, - 1, 126, :_reduce_none, - 1, 126, :_reduce_none, - 0, 108, :_reduce_93, - 1, 108, :_reduce_94, - 3, 108, :_reduce_95, - 1, 127, :_reduce_96, - 3, 127, :_reduce_97, - 1, 116, :_reduce_none, - 1, 116, :_reduce_none, - 1, 116, :_reduce_none, - 1, 116, :_reduce_none, - 1, 116, :_reduce_none, - 1, 116, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 1, 124, :_reduce_none, - 4, 98, :_reduce_116, - 3, 98, :_reduce_117, - 1, 100, :_reduce_118, - 2, 100, :_reduce_119, - 2, 130, :_reduce_120, - 1, 131, :_reduce_121, - 2, 131, :_reduce_122, - 1, 97, :_reduce_123, - 4, 91, :_reduce_124, - 4, 91, :_reduce_125, - 2, 80, :_reduce_126, - 5, 132, :_reduce_127, - 4, 132, :_reduce_128, - 0, 133, :_reduce_none, - 2, 133, :_reduce_130, - 4, 133, :_reduce_131, - 3, 133, :_reduce_132, - 1, 121, :_reduce_none, - 3, 121, :_reduce_134, - 3, 121, :_reduce_135, - 3, 121, :_reduce_136, - 3, 121, :_reduce_137, - 3, 121, :_reduce_138, - 3, 121, :_reduce_139, - 3, 121, :_reduce_140, - 3, 121, :_reduce_141, - 3, 121, :_reduce_142, - 2, 121, :_reduce_143, - 3, 121, :_reduce_144, - 3, 121, :_reduce_145, - 3, 121, :_reduce_146, - 3, 121, :_reduce_147, - 3, 121, :_reduce_148, - 3, 121, :_reduce_149, - 2, 121, :_reduce_150, - 3, 121, :_reduce_151, - 3, 121, :_reduce_152, - 3, 121, :_reduce_153, - 5, 79, :_reduce_154, - 1, 135, :_reduce_155, - 2, 135, :_reduce_156, - 5, 136, :_reduce_157, - 4, 136, :_reduce_158, - 1, 137, :_reduce_159, - 3, 137, :_reduce_160, - 3, 99, :_reduce_161, - 1, 139, :_reduce_none, - 4, 139, :_reduce_163, - 1, 141, :_reduce_none, - 3, 141, :_reduce_165, - 3, 140, :_reduce_166, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_none, - 1, 138, :_reduce_174, - 1, 138, :_reduce_none, - 1, 142, :_reduce_176, - 1, 143, :_reduce_none, - 3, 143, :_reduce_178, - 2, 81, :_reduce_179, - 6, 83, :_reduce_180, - 5, 83, :_reduce_181, - 7, 84, :_reduce_182, - 6, 84, :_reduce_183, - 6, 85, :_reduce_184, - 5, 85, :_reduce_185, - 1, 107, :_reduce_186, - 1, 102, :_reduce_187, - 1, 102, :_reduce_188, - 1, 102, :_reduce_189, - 1, 146, :_reduce_190, - 3, 146, :_reduce_191, - 1, 148, :_reduce_192, - 1, 149, :_reduce_193, - 1, 149, :_reduce_194, - 1, 149, :_reduce_195, - 1, 149, :_reduce_none, - 0, 72, :_reduce_197, - 0, 150, :_reduce_198, - 1, 144, :_reduce_none, - 3, 144, :_reduce_200, - 3, 144, :_reduce_201, - 1, 151, :_reduce_none, - 3, 151, :_reduce_203, - 3, 152, :_reduce_204, - 1, 152, :_reduce_205, - 3, 152, :_reduce_206, - 1, 152, :_reduce_207, - 1, 147, :_reduce_none, - 2, 147, :_reduce_209, - 1, 145, :_reduce_none, - 2, 145, :_reduce_211, - 1, 153, :_reduce_none, - 1, 153, :_reduce_none, - 1, 95, :_reduce_214, - 3, 120, :_reduce_215, - 4, 120, :_reduce_216, - 2, 120, :_reduce_217, - 1, 128, :_reduce_none, - 1, 128, :_reduce_none, - 0, 106, :_reduce_none, - 1, 106, :_reduce_221, - 1, 134, :_reduce_222, - 3, 129, :_reduce_223, - 4, 129, :_reduce_224, - 2, 129, :_reduce_225, - 1, 154, :_reduce_none, - 3, 154, :_reduce_227, - 3, 155, :_reduce_228, - 1, 156, :_reduce_229, - 1, 156, :_reduce_230, - 4, 122, :_reduce_231, - 1, 101, :_reduce_none, - 4, 101, :_reduce_233 ] - -racc_reduce_n = 234 - -racc_shift_n = 385 +...end grammar.ra/module_eval... +##### State transition tables begin ### racc_action_table = [ - 242, 243, 55, 231, 356, 112, 157, 113, 78, 298, - 68, 71, 357, 181, 186, 326, 344, 340, 55, 295, - 114, 231, 177, 179, 182, 185, 170, 294, 68, 71, - 286, 158, 100, 285, 103, 68, 71, 291, 292, 55, - 59, 291, 292, 61, 111, 233, 180, 184, 198, 231, - 189, 172, 173, 174, 176, 178, 59, 183, 187, 61, - -168, 66, 170, 60, 175, 79, 81, 186, 202, 88, - 112, 166, 79, 252, 74, 177, 88, 59, 84, 60, - 61, 139, 68, 71, 333, 84, 100, 117, 103, 60, - 36, -170, 68, 71, 38, 306, 60, 307, 203, 240, - 60, 10, 203, 189, 172, 173, 174, 176, 178, 202, - 183, 187, 241, 202, 209, 66, 218, 175, 209, 79, - 81, 219, 284, 88, 309, 202, 256, 283, 74, 79, - 252, 308, 84, 88, 203, 68, 71, 310, 139, 100, - 203, 103, 84, 60, 218, 202, 256, 367, 36, 219, - 209, 202, 38, 60, 68, 71, 209, 95, 100, 10, - 103, 68, 71, 68, 71, 100, 337, 103, 66, 335, - 199, 154, 79, 81, 173, 174, 88, 183, 187, 183, - 187, 74, 99, 95, 175, 84, 175, 66, 90, 311, - 337, 79, 81, 335, 66, 88, 60, 287, 79, 81, - 74, 198, 88, 315, 84, 68, 71, 74, 99, -172, - 213, 84, 68, 71, 90, 60, 100, 36, 103, 68, - 71, 38, 60, 100, 318, 103, 68, 71, 10, 15, - 36, -167, 213, 355, 38, 167, 36, 313, 202, 154, - 127, 10, 79, 252, 323, 66, 88, 10, 15, 79, - 81, 139, 66, 88, 166, 84, 79, 81, 74, 202, - 88, 229, 84, 79, 252, 74, 60, 88, 49, 84, - 68, 71, 139, 60, 78, -186, 84, 47, 48, 49, - 60, 329, 36, 170, 183, 187, 127, 60, -169, 68, - 71, 175, 70, 10, 15, 68, 71, 161, -171, 100, - 289, 103, -169, 66, 291, 292, 60, 79, 81, 258, - -167, 88, -170, 256, 257, 72, 74, 95, -168, 60, - 84, 156, 66, 154, 68, 71, 79, 81, 66, 122, - 88, 60, 79, 81, 72, 74, 88, -170, -173, 84, - -172, 74, 99, 68, 71, 84, -171, 100, 90, 103, - 60, 200, 334, 68, 71, 213, 60, 202, 215, 254, - 338, 79, 252, 173, 174, 88, 122, 296, 183, 187, - 139, 256, 257, 216, 84, 175, 66, 234, 68, 71, - 79, 81, 113, 117, 88, 60, 202, 217, 78, 74, - 79, 252, 353, 84, 88, 53, 68, 71, 223, 139, - 100, 260, 103, 84, 60, 43, 44, 40, 41, 358, - 52, 66, 51, 225, 60, 79, 81, -169, 229, 88, - 365, 68, 71, 72, 74, 100, 238, 103, 84, 66, - 228, -167, 234, 79, 81, 372, 373, 88, -169, 60, - -167, -170, 74, 95, -168, -172, 84, 68, 71, 45, - 375, 100, 229, 103, 66, -221, 232, 60, 79, 81, - 378, 39, 88, -24, -24, -24, -24, 74, 99, 95, - -168, 84, 383, 384, 90, nil, nil, 68, 71, nil, - 66, 100, 60, 103, 79, 81, nil, nil, 88, -22, - -22, -22, -22, 74, 99, nil, nil, 84, nil, 95, - 90, nil, nil, 68, 71, nil, nil, 100, 60, 103, - 66, nil, nil, nil, 79, 81, nil, nil, 88, 43, - 44, 40, 41, 74, 99, 95, nil, 84, nil, nil, - 90, nil, nil, 68, 71, nil, 66, 100, 60, 103, - 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, - 99, nil, nil, 84, nil, 95, 90, nil, nil, 68, - 71, nil, nil, 100, 60, 103, 66, nil, nil, nil, - 79, 81, nil, nil, 88, nil, nil, 68, 71, 74, - 99, 100, nil, 84, 68, 71, 90, nil, 100, nil, - 103, nil, 66, nil, 60, nil, 79, 81, nil, nil, - 88, nil, nil, nil, nil, 74, 95, nil, nil, 84, - 66, nil, nil, nil, 79, 144, nil, 66, 88, nil, - 60, 79, 81, 139, nil, 88, nil, 84, nil, nil, - 74, 99, nil, nil, 84, 68, 71, 90, 60, 100, - nil, 103, nil, nil, nil, 60, nil, nil, nil, nil, - nil, nil, nil, nil, 68, 71, nil, 95, 100, nil, - 103, 68, 71, nil, nil, 100, nil, 103, 66, nil, - nil, nil, 79, 81, nil, nil, 88, nil, nil, 68, - 71, 74, 99, nil, nil, 84, nil, 66, 90, nil, - nil, 79, 81, nil, 66, 88, 60, nil, 79, 81, - 74, nil, 88, nil, 84, 68, 71, 74, nil, nil, - nil, 84, 202, nil, nil, 60, 79, 252, nil, nil, - 88, nil, 60, nil, nil, 139, 68, 71, 162, 84, - 100, nil, 103, nil, nil, nil, nil, nil, 66, nil, - 60, nil, 79, 81, nil, nil, 88, nil, 95, nil, - 72, 74, 68, 71, nil, 84, 100, nil, 103, 66, - nil, nil, nil, 79, 81, nil, 60, 88, nil, nil, - nil, nil, 74, 99, 95, nil, 84, 68, 71, 90, - nil, nil, nil, nil, nil, 66, nil, 60, nil, 79, + 242, 243, 55, 68, 71, 299, 157, 55, 78, 117, + 199, 68, 71, 181, 186, -169, 36, 112, 341, 113, + 38, 55, 177, 179, 182, 185, 170, 10, 68, 71, + 231, 158, 114, 292, 293, 356, 257, 368, 68, 71, + 59, 198, 100, 61, 103, 59, 180, 184, 61, 198, + 189, 172, 173, 174, 176, 178, 111, 183, 187, 59, + 95, 66, 61, 60, 175, 79, 253, 154, 60, 88, + 345, 66, 233, 229, 139, 79, 81, 231, 84, 88, + 68, 71, 60, 225, 74, 99, 68, 71, 84, 60, + 100, 90, 103, 203, 203, 292, 293, 223, 296, 60, + 203, 117, 231, 78, 202, 202, 295, 240, 95, 209, + 209, 202, 166, 66, 186, 170, 209, 79, 253, 66, + 241, 88, 177, 79, 81, 334, 139, 88, 68, 71, + 84, 310, 74, 99, 68, 71, 84, 357, 100, 90, + 103, 60, 183, 187, 311, 358, 307, 60, 308, 175, + 189, 172, 173, 174, 176, 178, 95, 183, 187, 36, + 309, 66, 288, 38, 175, 79, 253, 66, 218, 88, + 10, 79, 81, 219, 139, 88, 338, 312, 84, 336, + 74, 99, 68, 71, 84, 218, 100, 90, 103, 60, + 219, 173, 174, 217, 285, 60, 183, 187, 257, 284, + 203, 68, 71, 175, 95, 100, 36, 103, 68, 71, + 127, 202, 100, 316, 103, 66, 209, 10, 15, 79, + 81, 173, 174, 88, 183, 187, 183, 187, 74, 99, + 95, 175, 84, 175, 66, 90, 113, 338, 79, 81, + 336, 66, 88, 60, 213, 79, 81, 74, 319, 88, + 216, 84, 68, 71, 74, 99, 213, 49, 84, 68, + 71, 90, 60, 100, 215, 103, 47, 48, 287, 60, + 154, 286, 189, 172, 173, 174, 324, 68, 71, 183, + 187, 100, 213, 103, 36, 66, 175, 327, 38, 79, + 253, 314, 66, 88, 200, 10, 79, 81, 139, 95, + 88, -171, 84, 68, 71, 74, 330, 78, 170, 84, + 66, -172, 259, 60, 79, 81, 257, 258, 88, -173, + 60, -168, -170, 74, 99, 70, 228, 84, 68, 71, + 90, 36, 100, -167, 103, 127, 66, -167, 60, 161, + 79, 81, 10, 15, 88, -169, -171, 297, 72, 74, + 95, 257, 258, 84, 68, 71, 36, -172, 100, -168, + 38, 66, 112, -170, 60, 79, 81, 10, 15, 88, + -22, -22, -22, -22, 74, 99, 68, 71, 84, 290, + 100, 90, 103, 292, 293, -167, 167, 66, 166, 60, + 335, 79, 253, 229, -187, 88, 339, 68, 71, 161, + 139, 100, 49, 103, 84, 43, 44, 40, 41, 66, + 234, -169, -174, 79, 81, 60, 156, 88, 154, 68, + 71, 354, 74, 100, 122, 103, 84, 122, 359, 161, + 66, 60, -170, 53, 79, 81, 229, 60, 88, 366, + 68, 71, 52, 74, 100, -168, 103, 84, 43, 44, + 40, 41, 66, 232, 51, 373, 79, 81, 60, 374, + 88, -169, 95, -167, -170, 74, 68, 71, -168, 84, + 100, -172, 103, 66, 60, 376, 45, 79, 81, -222, + 60, 88, -24, -24, -24, -24, 74, 99, 95, 234, + 84, 379, 238, 90, 39, 384, 68, 71, 385, 66, + 100, 60, 103, 79, 81, nil, nil, 88, nil, nil, + nil, nil, 74, 99, nil, nil, 84, nil, 95, 90, + nil, nil, 68, 71, nil, nil, 100, 60, 103, 66, + nil, nil, nil, 79, 81, nil, nil, 88, nil, nil, + nil, nil, 74, 99, 95, nil, 84, nil, nil, 90, + nil, nil, 68, 71, nil, 66, 100, 60, 103, 79, + 81, nil, nil, 88, nil, nil, nil, nil, 74, 99, + nil, nil, 84, nil, 95, 90, nil, nil, 68, 71, + nil, nil, 100, 60, 103, 66, nil, nil, nil, 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, 99, - 327, nil, 84, 68, 71, 90, nil, 100, nil, 103, - 66, nil, nil, 60, 79, 81, nil, nil, 88, nil, - nil, nil, 72, 74, nil, 95, nil, 84, 68, 71, - nil, nil, 100, nil, 103, nil, 66, nil, 60, nil, - 79, 81, 68, 71, 88, nil, 100, nil, 103, 74, - 99, nil, nil, 84, nil, nil, 90, nil, nil, nil, - nil, 66, nil, nil, 60, 79, 81, 68, 71, 88, - nil, 100, nil, 103, 74, 66, nil, nil, 84, 79, - 81, 68, 71, 88, nil, 100, nil, nil, 74, 60, - nil, nil, 84, nil, nil, nil, nil, nil, nil, nil, - 66, nil, nil, 60, 79, 81, nil, nil, 88, nil, - nil, 68, 71, 74, 66, nil, nil, 84, 79, 252, - nil, nil, 88, nil, nil, nil, nil, 139, 60, 68, - 71, 84, nil, 100, nil, 103, nil, nil, nil, nil, - nil, nil, 60, nil, 202, nil, nil, nil, 79, 252, - nil, 95, 88, nil, nil, nil, nil, 139, nil, 68, - 71, 84, 66, 100, nil, 103, 79, 81, nil, nil, - 88, nil, 60, nil, nil, 74, 99, nil, nil, 84, - nil, 95, 90, nil, nil, 68, 71, nil, nil, 100, - 60, 103, 66, nil, nil, nil, 79, 81, nil, nil, + 95, nil, 84, nil, nil, 90, nil, nil, 68, 71, + nil, 66, 100, 60, 103, 79, 81, nil, nil, 88, + nil, nil, nil, nil, 74, 99, nil, nil, 84, nil, + 95, 90, nil, nil, 68, 71, nil, nil, 100, 60, + 103, 66, nil, nil, nil, 79, 81, nil, nil, 88, + 68, 71, nil, nil, 74, 99, 68, 71, 84, nil, + 100, 90, 103, nil, nil, nil, nil, 66, nil, 60, + nil, 79, 81, nil, nil, 88, nil, nil, 95, nil, + 74, 68, 71, 66, 84, 100, nil, 79, 253, 66, + nil, 88, nil, 79, 81, 60, 139, 88, nil, nil, + 84, nil, 74, 99, nil, nil, 84, 68, 71, 90, + nil, 60, nil, nil, 66, nil, nil, 60, 79, 144, + nil, nil, 88, nil, nil, nil, nil, 139, 68, 71, + nil, 84, 100, nil, 103, nil, nil, nil, nil, nil, + 66, nil, 60, nil, 79, 253, 68, 71, 88, nil, + 100, nil, 103, 139, nil, nil, nil, 84, nil, nil, + nil, 66, nil, nil, nil, 79, 81, nil, 60, 88, + nil, 68, 71, nil, 74, nil, nil, nil, 84, 66, + nil, nil, nil, 79, 81, nil, nil, 88, nil, 60, + nil, nil, 74, nil, 261, nil, 84, 68, 71, nil, + nil, 100, nil, 103, 66, nil, nil, 60, 79, 81, + nil, nil, 88, nil, nil, nil, 72, 74, 68, 71, + nil, 84, 100, nil, 103, nil, nil, nil, nil, nil, + 66, nil, 60, nil, 79, 81, nil, nil, 88, nil, + 95, nil, nil, 74, 68, 71, nil, 84, nil, nil, + nil, 66, nil, nil, nil, 79, 81, nil, 60, 88, + nil, nil, nil, nil, 74, 99, nil, 162, 84, 68, + 71, 90, nil, 100, nil, 103, nil, 66, nil, 60, + nil, 79, 81, nil, nil, 88, nil, nil, nil, 72, + 74, 95, nil, nil, 84, 68, 71, nil, nil, 100, + nil, 103, 66, nil, nil, 60, 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, 99, 95, nil, 84, - nil, nil, 90, nil, nil, 68, 71, nil, 66, 100, - 60, 103, 79, 81, nil, nil, 88, nil, nil, nil, - nil, 74, 99, nil, nil, 84, nil, 95, 90, nil, - nil, 68, 71, nil, nil, 100, 60, 103, 66, nil, - nil, nil, 79, 81, nil, nil, 88, nil, nil, nil, - nil, 74, 99, 95, nil, 84, nil, nil, 90, nil, - nil, 68, 71, nil, 66, 100, 60, 103, 79, 81, - nil, nil, 88, nil, nil, nil, nil, 74, 99, nil, - nil, 84, nil, 95, 90, nil, nil, 68, 71, nil, - nil, 100, 60, 103, 66, nil, nil, nil, 79, 81, + 68, 71, 90, nil, 100, nil, 103, nil, 66, nil, + 60, nil, 79, 81, 68, 71, 88, nil, nil, nil, + 255, 74, 99, nil, nil, 84, nil, nil, 90, nil, + nil, nil, nil, 66, nil, nil, 60, 79, 81, 68, + 71, 88, nil, 100, nil, 103, 74, 66, nil, nil, + 84, 79, 253, nil, nil, 88, nil, nil, 68, 71, + 139, 60, nil, nil, 84, nil, nil, nil, nil, nil, + nil, nil, 66, nil, nil, 60, 79, 81, nil, nil, + 88, 328, nil, 68, 71, 74, nil, nil, nil, 84, + nil, 66, nil, nil, nil, 79, 81, nil, nil, 88, + 60, 68, 71, 72, 74, 100, 193, 103, 84, nil, + nil, nil, nil, nil, nil, nil, 66, nil, nil, 60, + 79, 253, 68, 71, 88, nil, 100, nil, 103, 139, + nil, nil, nil, 84, 66, nil, nil, nil, 79, 81, + nil, nil, 88, nil, 60, nil, nil, 74, 68, 71, + nil, 84, 100, nil, 103, 66, nil, nil, nil, 79, + 81, nil, 60, 88, nil, nil, nil, nil, 74, nil, + 95, nil, 84, nil, 68, 71, nil, nil, 100, nil, + 103, 66, nil, 60, nil, 79, 81, nil, nil, 88, + nil, nil, nil, nil, 74, 99, 95, nil, 84, 68, + 71, 90, nil, 100, nil, 103, nil, 66, nil, 60, + nil, 79, 81, 68, 71, 88, nil, nil, nil, nil, + 74, 99, nil, nil, 84, nil, nil, 90, nil, nil, + nil, nil, 66, nil, nil, 60, 79, 81, nil, nil, + 88, nil, nil, nil, nil, 74, 66, nil, nil, 84, + 79, 81, nil, nil, 88, nil, nil, nil, 72, 74, + 60, 68, 71, 84, nil, 100, nil, 103, 189, 172, + 173, 174, 176, 178, 60, 183, 187, nil, 189, 172, + 173, 174, 175, 95, nil, 183, 187, 68, 71, nil, + nil, 100, 175, 103, 66, nil, nil, nil, 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, 99, 95, nil, 84, nil, nil, 90, nil, nil, 68, 71, nil, 66, 100, 60, 103, 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, 99, nil, nil, 84, nil, 95, 90, nil, nil, 68, 71, nil, nil, 100, 60, 103, 66, nil, nil, nil, 79, 81, nil, nil, 88, nil, - nil, nil, nil, 74, 99, 95, nil, 84, 68, 71, - 90, nil, 100, 193, 103, nil, 66, nil, 60, nil, - 79, 81, nil, nil, 88, nil, nil, nil, nil, 74, - 99, nil, nil, 84, 68, 71, 90, nil, 100, nil, - 103, 66, nil, nil, 60, 79, 81, nil, nil, 88, - nil, nil, nil, nil, 74, nil, 95, nil, 84, nil, - 68, 71, nil, nil, 100, nil, 103, 66, nil, 60, - nil, 79, 81, nil, nil, 88, nil, nil, nil, nil, - 74, 99, 95, nil, 84, nil, nil, 90, nil, nil, - nil, nil, nil, 66, nil, 60, nil, 79, 81, 188, - nil, 88, nil, nil, nil, nil, 74, 99, 181, 186, - 84, nil, nil, 90, nil, nil, nil, 177, 179, 182, - 185, 60, nil, 181, 186, nil, nil, nil, nil, nil, - nil, 282, 177, 179, 182, 185, nil, nil, nil, nil, - nil, 180, 184, nil, nil, 189, 172, 173, 174, 176, - 178, nil, 183, 187, nil, nil, 180, 184, nil, 175, - 189, 172, 173, 174, 176, 178, nil, 183, 187, 181, - 186, nil, nil, nil, 175, nil, nil, nil, 177, 179, - 182, 185, nil, nil, 181, 186, nil, nil, nil, nil, - nil, nil, nil, 177, 179, 182, 185, nil, nil, nil, - nil, nil, nil, nil, nil, nil, 189, 172, 173, 174, - 176, 178, nil, 183, 187, nil, nil, 180, 184, nil, - 175, 189, 172, 173, 174, 176, 178, nil, 183, 187, - 181, 186, nil, nil, nil, 175, nil, nil, nil, 177, - 179, 182, 185, nil, nil, 181, 186, nil, nil, nil, - nil, nil, nil, nil, 177, 179, 182, 185, nil, nil, - nil, nil, nil, 180, 184, nil, nil, 189, 172, 173, - 174, 176, 178, nil, 183, 187, nil, nil, nil, 184, - nil, 175, 189, 172, 173, 174, 176, 178, nil, 183, - 187, 181, 186, nil, nil, nil, 175, nil, nil, nil, - 177, 179, 182, 185, nil, nil, nil, 186, nil, 189, - 172, 173, 174, 176, 178, 177, 183, 187, nil, nil, - nil, nil, nil, 175, 180, 184, 186, nil, 189, 172, - 173, 174, 176, 178, 177, 183, 187, nil, nil, nil, - nil, 186, 175, 189, 172, 173, 174, 176, 178, 177, - 183, 187, nil, nil, nil, nil, nil, 175, nil, nil, - nil, nil, 189, 172, 173, 174, 176, 178, nil, 183, - 187, 280, nil, nil, nil, nil, 175, 189, 172, 173, - 174, 176, 178, nil, 183, 187, nil, nil, nil, nil, - 325, 175, 26, nil, 32, 1, nil, 8, 11, nil, - 18, nil, 23, nil, 29, nil, 2, nil, nil, 10, - 15, 26, 363, 32, 1, nil, 8, 11, nil, 18, - nil, 23, nil, 29, nil, 2, nil, nil, 10, 15, - nil, 382, nil, 26, nil, 32, 1, nil, 8, 11, - nil, 18, nil, 23, nil, 29, nil, 2, nil, nil, - 10, 15, 26, 380, 32, 1, nil, 8, 11, nil, - 18, nil, 23, nil, 29, nil, 2, nil, nil, 10, - 15, nil, 376, nil, 26, nil, 32, 1, nil, 8, - 11, nil, 18, nil, 23, nil, 29, nil, 2, nil, - nil, 10, 15, 26, 305, 32, 1, nil, 8, 11, - nil, 18, nil, 23, nil, 29, nil, 2, nil, nil, - 10, 15, nil, nil, nil, 26, nil, 32, 1, nil, + nil, nil, nil, 74, 99, 95, nil, 84, nil, nil, + 90, nil, nil, nil, nil, nil, 66, nil, 60, nil, + 79, 81, 188, nil, 88, nil, nil, nil, nil, 74, + 99, 181, 186, 84, nil, nil, 90, nil, nil, nil, + 177, 179, 182, 185, 60, nil, 181, 186, nil, nil, + nil, nil, nil, nil, nil, 177, 179, 182, 185, nil, + nil, nil, nil, nil, 180, 184, nil, nil, 189, 172, + 173, 174, 176, 178, nil, 183, 187, nil, nil, 180, + 184, nil, 175, 189, 172, 173, 174, 176, 178, nil, + 183, 187, 181, 186, nil, nil, nil, 175, nil, nil, + 283, 177, 179, 182, 185, nil, nil, 181, 186, nil, + nil, nil, nil, nil, nil, nil, 177, 179, 182, 185, + nil, nil, nil, nil, nil, 180, 184, nil, nil, 189, + 172, 173, 174, 176, 178, nil, 183, 187, nil, nil, + nil, 184, nil, 175, 189, 172, 173, 174, 176, 178, + nil, 183, 187, 181, 186, nil, nil, nil, 175, nil, + nil, nil, 177, 179, 182, 185, nil, nil, 181, 186, + nil, nil, nil, nil, nil, nil, nil, 177, 179, 182, + 185, nil, nil, nil, nil, nil, 180, 184, nil, nil, + 189, 172, 173, 174, 176, 178, nil, 183, 187, nil, + nil, 180, 184, nil, 175, 189, 172, 173, 174, 176, + 178, nil, 183, 187, 181, 186, nil, nil, nil, 175, + nil, nil, nil, 177, 179, 182, 185, nil, nil, 26, + 186, 32, 1, nil, 8, 11, nil, 18, 177, 23, + nil, 29, nil, 2, nil, nil, 10, 15, nil, 186, + nil, 189, 172, 173, 174, 176, 178, 177, 183, 187, + nil, nil, nil, nil, 186, 175, 189, 172, 173, 174, + 176, 178, 177, 183, 187, nil, nil, nil, nil, nil, + 175, nil, nil, nil, nil, 189, 172, 173, 174, 176, + 178, nil, 183, 187, 281, nil, nil, nil, nil, 175, + 189, 172, 173, 174, 176, 178, nil, 183, 187, nil, + nil, nil, nil, 377, 175, 26, nil, 32, 1, nil, 8, 11, nil, 18, nil, 23, nil, 29, nil, 2, - nil, nil, 10, 15, 26, nil, 32, 1, nil, 8, + nil, nil, 10, 15, 26, 364, 32, 1, nil, 8, 11, nil, 18, nil, 23, nil, 29, nil, 2, nil, - nil, 10, 15, 26, nil, 32, 1, nil, 8, 11, - nil, 18, nil, 23, nil, 29, nil, 2, nil, nil, - 10, 15, 26, nil, 32, 1, nil, 8, 11, nil, - 18, nil, 23, nil, 29, nil, 2, nil, nil, 10, - 15, 189, 172, 173, 174, 176, 178, nil, 183, 187, - 189, 172, 173, 174, nil, 175, nil, 183, 187, 189, - 172, 173, 174, nil, 175, nil, 183, 187, nil, nil, - nil, nil, nil, 175 ] + nil, 10, 15, nil, 383, nil, 26, nil, 32, 1, + nil, 8, 11, nil, 18, nil, 23, nil, 29, nil, + 2, nil, nil, 10, 15, 26, 306, 32, 1, nil, + 8, 11, nil, 18, nil, 23, nil, 29, nil, 2, + nil, nil, 10, 15, nil, 381, nil, 26, nil, 32, + 1, nil, 8, 11, nil, 18, nil, 23, nil, 29, + nil, 2, nil, nil, 10, 15, 26, 326, 32, 1, + nil, 8, 11, nil, 18, nil, 23, nil, 29, nil, + 2, nil, nil, 10, 15, nil, nil, nil, 26, nil, + 32, 1, nil, 8, 11, nil, 18, nil, 23, nil, + 29, nil, 2, nil, nil, 10, 15, 26, nil, 32, + 1, nil, 8, 11, nil, 18, nil, 23, nil, 29, + nil, 2, nil, nil, 10, 15, 26, nil, 32, 1, + nil, 8, 11, nil, 18, nil, 23, nil, 29, nil, + 2, nil, nil, 10, 15, 189, 172, 173, 174, 176, + 178, nil, 183, 187, nil, nil, nil, nil, nil, 175 ] racc_action_check = [ - 164, 164, 158, 154, 301, 27, 56, 27, 81, 214, - 285, 285, 301, 164, 164, 239, 293, 285, 18, 206, - 27, 213, 164, 164, 164, 164, 81, 206, 175, 175, - 194, 56, 175, 194, 175, 368, 368, 214, 214, 157, - 158, 293, 293, 158, 27, 154, 164, 164, 285, 144, - 164, 164, 164, 164, 164, 164, 18, 164, 164, 18, - 85, 175, 144, 158, 164, 175, 175, 272, 368, 175, - 83, 261, 368, 368, 175, 272, 368, 157, 175, 18, - 157, 368, 161, 161, 261, 368, 161, 216, 161, 175, - 1, 82, 356, 356, 1, 218, 368, 219, 203, 163, - 157, 1, 114, 272, 272, 272, 272, 272, 272, 203, - 272, 272, 163, 114, 203, 161, 122, 272, 114, 161, - 161, 122, 192, 161, 221, 356, 192, 192, 161, 356, - 356, 220, 161, 356, 290, 335, 335, 221, 356, 335, - 111, 335, 356, 161, 309, 290, 331, 331, 11, 309, - 290, 111, 11, 356, 329, 329, 111, 335, 329, 11, - 329, 48, 48, 103, 103, 48, 334, 48, 335, 334, - 103, 200, 335, 335, 262, 262, 335, 263, 263, 262, - 262, 335, 335, 48, 263, 335, 262, 329, 335, 224, - 280, 329, 329, 280, 48, 329, 335, 197, 48, 48, - 329, 103, 48, 227, 329, 295, 295, 48, 48, 87, - 229, 48, 307, 307, 48, 329, 307, 33, 307, 306, - 306, 33, 48, 306, 230, 306, 299, 299, 33, 33, - 225, 80, 232, 299, 225, 77, 46, 225, 295, 234, - 46, 225, 295, 295, 235, 307, 295, 46, 46, 307, - 307, 295, 306, 307, 75, 295, 306, 306, 307, 299, - 306, 212, 307, 299, 299, 306, 295, 299, 8, 306, - 23, 23, 299, 307, 23, 74, 299, 8, 8, 66, - 306, 249, 42, 252, 264, 264, 42, 299, 65, 166, - 166, 264, 23, 42, 42, 26, 26, 64, 89, 26, - 201, 26, 94, 23, 201, 201, 187, 23, 23, 169, - 101, 23, 102, 169, 169, 23, 23, 26, 105, 183, - 23, 53, 166, 52, 294, 294, 166, 166, 26, 50, - 166, 23, 26, 26, 166, 166, 26, 143, 106, 166, - 107, 26, 26, 29, 29, 26, 108, 29, 26, 29, - 166, 110, 279, 167, 167, 113, 26, 294, 115, 167, - 283, 294, 294, 281, 281, 294, 37, 211, 281, 281, - 294, 211, 211, 116, 294, 281, 29, 288, 170, 170, - 29, 29, 119, 32, 29, 294, 167, 121, 127, 29, - 167, 167, 297, 29, 167, 17, 287, 287, 133, 167, - 287, 170, 287, 167, 29, 3, 3, 3, 3, 304, - 13, 170, 12, 134, 167, 170, 170, 136, 320, 170, - 324, 172, 172, 170, 170, 172, 159, 172, 170, 287, - 140, 141, 155, 287, 287, 337, 342, 287, 346, 170, - 347, 349, 287, 172, 350, 351, 287, 45, 45, 5, - 357, 45, 142, 45, 172, 367, 147, 287, 172, 172, - 369, 2, 172, 4, 4, 4, 4, 172, 172, 45, - 146, 172, 379, 381, 172, nil, nil, 173, 173, nil, - 45, 173, 172, 173, 45, 45, nil, nil, 45, 31, - 31, 31, 31, 45, 45, nil, nil, 45, nil, 173, - 45, nil, nil, 47, 47, nil, nil, 47, 45, 47, - 173, nil, nil, nil, 173, 173, nil, nil, 173, 6, - 6, 6, 6, 173, 173, 47, nil, 173, nil, nil, - 173, nil, nil, 174, 174, nil, 47, 174, 173, 174, - 47, 47, nil, nil, 47, nil, nil, nil, nil, 47, - 47, nil, nil, 47, nil, 174, 47, nil, nil, 49, - 49, nil, nil, 49, 47, 49, 174, nil, nil, nil, - 174, 174, nil, nil, 174, nil, nil, 51, 51, 174, - 174, 51, nil, 174, 176, 176, 174, nil, 176, nil, - 176, nil, 49, nil, 174, nil, 49, 49, nil, nil, - 49, nil, nil, nil, nil, 49, 176, nil, nil, 49, - 51, nil, nil, nil, 51, 51, nil, 176, 51, nil, - 49, 176, 176, 51, nil, 176, nil, 51, nil, nil, - 176, 176, nil, nil, 176, 177, 177, 176, 51, 177, - nil, 177, nil, nil, nil, 176, nil, nil, nil, nil, - nil, nil, nil, nil, 112, 112, nil, 177, 112, nil, - 112, 259, 259, nil, nil, 259, nil, 259, 177, nil, - nil, nil, 177, 177, nil, nil, 177, nil, nil, 254, - 254, 177, 177, nil, nil, 177, nil, 112, 177, nil, - nil, 112, 112, nil, 259, 112, 177, nil, 259, 259, - 112, nil, 259, nil, 112, 70, 70, 259, nil, nil, - nil, 259, 254, nil, nil, 112, 254, 254, nil, nil, - 254, nil, 259, nil, nil, 254, 242, 242, 70, 254, - 242, nil, 242, nil, nil, nil, nil, nil, 70, nil, - 254, nil, 70, 70, nil, nil, 70, nil, 242, nil, - 70, 70, 71, 71, nil, 70, 71, nil, 71, 242, - nil, nil, nil, 242, 242, nil, 70, 242, nil, nil, - nil, nil, 242, 242, 71, nil, 242, 240, 240, 242, - nil, nil, nil, nil, nil, 71, nil, 242, nil, 71, - 71, nil, nil, 71, nil, nil, nil, nil, 71, 71, - 240, nil, 71, 178, 178, 71, nil, 178, nil, 178, - 240, nil, nil, 71, 240, 240, nil, nil, 240, nil, - nil, nil, 240, 240, nil, 178, nil, 240, 233, 233, - nil, nil, 233, nil, 233, nil, 178, nil, 240, nil, - 178, 178, 78, 78, 178, nil, 78, nil, 78, 178, - 178, nil, nil, 178, nil, nil, 178, nil, nil, nil, - nil, 233, nil, nil, 178, 233, 233, 231, 231, 233, - nil, 231, nil, 231, 233, 78, nil, nil, 233, 78, - 78, 228, 228, 78, nil, 228, nil, nil, 78, 233, - nil, nil, 78, nil, nil, nil, nil, nil, nil, nil, - 231, nil, nil, 78, 231, 231, nil, nil, 231, nil, - nil, 215, 215, 231, 228, nil, nil, 231, 228, 228, - nil, nil, 228, nil, nil, nil, nil, 228, 231, 179, - 179, 228, nil, 179, nil, 179, nil, nil, nil, nil, - nil, nil, 228, nil, 215, nil, nil, nil, 215, 215, - nil, 179, 215, nil, nil, nil, nil, 215, nil, 185, - 185, 215, 179, 185, nil, 185, 179, 179, nil, nil, - 179, nil, 215, nil, nil, 179, 179, nil, nil, 179, - nil, 185, 179, nil, nil, 181, 181, nil, nil, 181, - 179, 181, 185, nil, nil, nil, 185, 185, nil, nil, - 185, nil, nil, nil, nil, 185, 185, 181, nil, 185, - nil, nil, 185, nil, nil, 189, 189, nil, 181, 189, - 185, 189, 181, 181, nil, nil, 181, nil, nil, nil, - nil, 181, 181, nil, nil, 181, nil, 189, 181, nil, - nil, 90, 90, nil, nil, 90, 181, 90, 189, nil, - nil, nil, 189, 189, nil, nil, 189, nil, nil, nil, - nil, 189, 189, 90, nil, 189, nil, nil, 189, nil, - nil, 182, 182, nil, 90, 182, 189, 182, 90, 90, - nil, nil, 90, nil, nil, nil, nil, 90, 90, nil, - nil, 90, nil, 182, 90, nil, nil, 184, 184, nil, - nil, 184, 90, 184, 182, nil, nil, nil, 182, 182, - nil, nil, 182, nil, nil, nil, nil, 182, 182, 184, - nil, 182, nil, nil, 182, nil, nil, 95, 95, nil, - 184, 95, 182, 95, 184, 184, nil, nil, 184, nil, - nil, nil, nil, 184, 184, nil, nil, 184, nil, 95, - 184, nil, nil, 99, 99, nil, nil, 99, 184, 99, - 95, nil, nil, nil, 95, 95, nil, nil, 95, nil, - nil, nil, nil, 95, 95, 99, nil, 95, 100, 100, - 95, nil, 100, 100, 100, nil, 99, nil, 95, nil, - 99, 99, nil, nil, 99, nil, nil, nil, nil, 99, - 99, nil, nil, 99, 186, 186, 99, nil, 186, nil, - 186, 100, nil, nil, 99, 100, 100, nil, nil, 100, - nil, nil, nil, nil, 100, nil, 186, nil, 100, nil, - 180, 180, nil, nil, 180, nil, 180, 186, nil, 100, - nil, 186, 186, nil, nil, 186, nil, nil, nil, nil, - 186, 186, 180, nil, 186, nil, nil, 186, nil, nil, - nil, nil, nil, 180, nil, 186, nil, 180, 180, 91, - nil, 180, nil, nil, nil, nil, 180, 180, 91, 91, - 180, nil, nil, 180, nil, nil, nil, 91, 91, 91, - 91, 180, nil, 190, 190, nil, nil, nil, nil, nil, - nil, 190, 190, 190, 190, 190, nil, nil, nil, nil, - nil, 91, 91, nil, nil, 91, 91, 91, 91, 91, - 91, nil, 91, 91, nil, nil, 190, 190, nil, 91, - 190, 190, 190, 190, 190, 190, nil, 190, 190, 274, - 274, nil, nil, nil, 190, nil, nil, nil, 274, 274, - 274, 274, nil, nil, 132, 132, nil, nil, nil, nil, - nil, nil, nil, 132, 132, 132, 132, nil, nil, nil, - nil, nil, nil, nil, nil, nil, 274, 274, 274, 274, - 274, 274, nil, 274, 274, nil, nil, 132, 132, nil, - 274, 132, 132, 132, 132, 132, 132, nil, 132, 132, - 131, 131, nil, nil, nil, 132, nil, nil, nil, 131, - 131, 131, 131, nil, nil, 270, 270, nil, nil, nil, - nil, nil, nil, nil, 270, 270, 270, 270, nil, nil, - nil, nil, nil, 131, 131, nil, nil, 131, 131, 131, - 131, 131, 131, nil, 131, 131, nil, nil, nil, 270, - nil, 131, 270, 270, 270, 270, 270, 270, nil, 270, - 270, 129, 129, nil, nil, nil, 270, nil, nil, nil, - 129, 129, 129, 129, nil, nil, nil, 269, nil, 276, - 276, 276, 276, 276, 276, 269, 276, 276, nil, nil, - nil, nil, nil, 276, 129, 129, 275, nil, 129, 129, - 129, 129, 129, 129, 275, 129, 129, nil, nil, nil, - nil, 271, 129, 269, 269, 269, 269, 269, 269, 271, - 269, 269, nil, nil, nil, nil, nil, 269, nil, nil, - nil, nil, 275, 275, 275, 275, 275, 275, nil, 275, - 275, 188, nil, nil, nil, nil, 275, 271, 271, 271, - 271, 271, 271, nil, 271, 271, nil, nil, nil, nil, - 238, 271, 188, nil, 188, 188, nil, 188, 188, nil, - 188, nil, 188, nil, 188, nil, 188, nil, nil, 188, - 188, 238, 311, 238, 238, nil, 238, 238, nil, 238, - nil, 238, nil, 238, nil, 238, nil, nil, 238, 238, - nil, 375, nil, 311, nil, 311, 311, nil, 311, 311, - nil, 311, nil, 311, nil, 311, nil, 311, nil, nil, - 311, 311, 375, 372, 375, 375, nil, 375, 375, nil, - 375, nil, 375, nil, 375, nil, 375, nil, nil, 375, - 375, nil, 362, nil, 372, nil, 372, 372, nil, 372, - 372, nil, 372, nil, 372, nil, 372, nil, 372, nil, - nil, 372, 372, 362, 217, 362, 362, nil, 362, 362, - nil, 362, nil, 362, nil, 362, nil, 362, nil, nil, - 362, 362, nil, nil, nil, 217, nil, 217, 217, nil, - 217, 217, nil, 217, nil, 217, nil, 217, nil, 217, - nil, nil, 217, 217, 0, nil, 0, 0, nil, 0, - 0, nil, 0, nil, 0, nil, 0, nil, 0, nil, - nil, 0, 0, 20, nil, 20, 20, nil, 20, 20, - nil, 20, nil, 20, nil, 20, nil, 20, nil, nil, - 20, 20, 278, nil, 278, 278, nil, 278, 278, nil, - 278, nil, 278, nil, 278, nil, 278, nil, nil, 278, - 278, 267, 267, 267, 267, 267, 267, nil, 267, 267, - 266, 266, 266, 266, nil, 267, nil, 266, 266, 268, - 268, 268, 268, nil, 266, nil, 268, 268, nil, nil, - nil, nil, nil, 268 ] + 164, 164, 18, 103, 103, 214, 56, 157, 81, 32, + 103, 286, 286, 164, 164, 136, 11, 27, 286, 27, + 11, 158, 164, 164, 164, 164, 81, 11, 300, 300, + 154, 56, 27, 214, 214, 300, 332, 332, 189, 189, + 18, 103, 189, 18, 189, 157, 164, 164, 157, 286, + 164, 164, 164, 164, 164, 164, 27, 164, 164, 158, + 189, 300, 158, 18, 164, 300, 300, 200, 157, 300, + 294, 189, 154, 212, 300, 189, 189, 213, 300, 189, + 369, 369, 158, 134, 189, 189, 186, 186, 189, 300, + 186, 189, 186, 203, 291, 294, 294, 133, 206, 189, + 111, 216, 144, 127, 203, 291, 206, 163, 186, 203, + 291, 111, 262, 369, 273, 144, 111, 369, 369, 186, + 163, 369, 273, 186, 186, 262, 369, 186, 357, 357, + 369, 221, 186, 186, 185, 185, 186, 302, 185, 186, + 185, 369, 264, 264, 221, 302, 218, 186, 219, 264, + 273, 273, 273, 273, 273, 273, 185, 273, 273, 1, + 220, 357, 197, 1, 273, 357, 357, 185, 122, 357, + 1, 185, 185, 122, 357, 185, 281, 224, 357, 281, + 185, 185, 176, 176, 185, 310, 176, 185, 176, 357, + 310, 282, 282, 121, 192, 185, 282, 282, 192, 192, + 114, 175, 175, 282, 176, 175, 46, 175, 336, 336, + 46, 114, 336, 227, 336, 176, 114, 46, 46, 176, + 176, 263, 263, 176, 265, 265, 263, 263, 176, 176, + 336, 265, 176, 263, 175, 176, 119, 335, 175, 175, + 335, 336, 175, 176, 229, 336, 336, 175, 230, 336, + 116, 175, 215, 215, 336, 336, 232, 8, 336, 330, + 330, 336, 175, 330, 115, 330, 8, 8, 194, 336, + 234, 194, 267, 267, 267, 267, 235, 184, 184, 267, + 267, 184, 113, 184, 225, 215, 267, 239, 225, 215, + 215, 225, 330, 215, 110, 225, 330, 330, 215, 184, + 330, 108, 215, 23, 23, 330, 250, 23, 253, 330, + 184, 107, 169, 215, 184, 184, 169, 169, 184, 106, + 330, 105, 102, 184, 184, 23, 140, 184, 26, 26, + 184, 42, 26, 141, 26, 42, 23, 101, 184, 96, + 23, 23, 42, 42, 23, 94, 89, 211, 23, 23, + 26, 211, 211, 23, 228, 228, 33, 87, 228, 85, + 33, 26, 83, 82, 23, 26, 26, 33, 33, 26, + 31, 31, 31, 31, 26, 26, 29, 29, 26, 201, + 29, 26, 29, 201, 201, 80, 77, 228, 75, 26, + 280, 228, 228, 142, 74, 228, 284, 308, 308, 69, + 228, 308, 66, 308, 228, 6, 6, 6, 6, 29, + 289, 65, 64, 29, 29, 228, 53, 29, 52, 307, + 307, 298, 29, 307, 50, 307, 29, 37, 305, 138, + 308, 187, 143, 17, 308, 308, 321, 29, 308, 325, + 174, 174, 13, 308, 174, 146, 174, 308, 3, 3, + 3, 3, 307, 147, 12, 338, 307, 307, 308, 343, + 307, 347, 174, 348, 350, 307, 179, 179, 351, 307, + 179, 352, 179, 174, 183, 358, 5, 174, 174, 368, + 307, 174, 4, 4, 4, 4, 174, 174, 179, 155, + 174, 370, 159, 174, 2, 380, 173, 173, 382, 179, + 173, 174, 173, 179, 179, nil, nil, 179, nil, nil, + nil, nil, 179, 179, nil, nil, 179, nil, 173, 179, + nil, nil, 45, 45, nil, nil, 45, 179, 45, 173, + nil, nil, nil, 173, 173, nil, nil, 173, nil, nil, + nil, nil, 173, 173, 45, nil, 173, nil, nil, 173, + nil, nil, 172, 172, nil, 45, 172, 173, 172, 45, + 45, nil, nil, 45, nil, nil, nil, nil, 45, 45, + nil, nil, 45, nil, 172, 45, nil, nil, 47, 47, + nil, nil, 47, 45, 47, 172, nil, nil, nil, 172, + 172, nil, nil, 172, nil, nil, nil, nil, 172, 172, + 47, nil, 172, nil, nil, 172, nil, nil, 48, 48, + nil, 47, 48, 172, 48, 47, 47, nil, nil, 47, + nil, nil, nil, nil, 47, 47, nil, nil, 47, nil, + 48, 47, nil, nil, 49, 49, nil, nil, 49, 47, + 49, 48, nil, nil, nil, 48, 48, nil, nil, 48, + 296, 296, nil, nil, 48, 48, 177, 177, 48, nil, + 177, 48, 177, nil, nil, nil, nil, 49, nil, 48, + nil, 49, 49, nil, nil, 49, nil, nil, 177, nil, + 49, 51, 51, 296, 49, 51, nil, 296, 296, 177, + nil, 296, nil, 177, 177, 49, 296, 177, nil, nil, + 296, nil, 177, 177, nil, nil, 177, 295, 295, 177, + nil, 296, nil, nil, 51, nil, nil, 177, 51, 51, + nil, nil, 51, nil, nil, nil, nil, 51, 231, 231, + nil, 51, 231, nil, 231, nil, nil, nil, nil, nil, + 295, nil, 51, nil, 295, 295, 233, 233, 295, nil, + 233, nil, 233, 295, nil, nil, nil, 295, nil, nil, + nil, 231, nil, nil, nil, 231, 231, nil, 295, 231, + nil, 170, 170, nil, 231, nil, nil, nil, 231, 233, + nil, nil, nil, 233, 233, nil, nil, 233, nil, 231, + nil, nil, 233, nil, 170, nil, 233, 288, 288, nil, + nil, 288, nil, 288, 170, nil, nil, 233, 170, 170, + nil, nil, 170, nil, nil, nil, 170, 170, 182, 182, + nil, 170, 182, nil, 182, nil, nil, nil, nil, nil, + 288, nil, 170, nil, 288, 288, nil, nil, 288, nil, + 182, nil, nil, 288, 70, 70, nil, 288, nil, nil, + nil, 182, nil, nil, nil, 182, 182, nil, 288, 182, + nil, nil, nil, nil, 182, 182, nil, 70, 182, 71, + 71, 182, nil, 71, nil, 71, nil, 70, nil, 182, + nil, 70, 70, nil, nil, 70, nil, nil, nil, 70, + 70, 71, nil, nil, 70, 180, 180, nil, nil, 180, + nil, 180, 71, nil, nil, 70, 71, 71, nil, nil, + 71, nil, nil, nil, nil, 71, 71, 180, nil, 71, + 112, 112, 71, nil, 112, nil, 112, nil, 180, nil, + 71, nil, 180, 180, 167, 167, 180, nil, nil, nil, + 167, 180, 180, nil, nil, 180, nil, nil, 180, nil, + nil, nil, nil, 112, nil, nil, 180, 112, 112, 78, + 78, 112, nil, 78, nil, 78, 112, 167, nil, nil, + 112, 167, 167, nil, nil, 167, nil, nil, 240, 240, + 167, 112, nil, nil, 167, nil, nil, nil, nil, nil, + nil, nil, 78, nil, nil, 167, 78, 78, nil, nil, + 78, 240, nil, 255, 255, 78, nil, nil, nil, 78, + nil, 240, nil, nil, nil, 240, 240, nil, nil, 240, + 78, 100, 100, 240, 240, 100, 100, 100, 240, nil, + nil, nil, nil, nil, nil, nil, 255, nil, nil, 240, + 255, 255, 260, 260, 255, nil, 260, nil, 260, 255, + nil, nil, nil, 255, 100, nil, nil, nil, 100, 100, + nil, nil, 100, nil, 255, nil, nil, 100, 181, 181, + nil, 100, 181, nil, 181, 260, nil, nil, nil, 260, + 260, nil, 100, 260, nil, nil, nil, nil, 260, nil, + 181, nil, 260, nil, 90, 90, nil, nil, 90, nil, + 90, 181, nil, 260, nil, 181, 181, nil, nil, 181, + nil, nil, nil, nil, 181, 181, 90, nil, 181, 161, + 161, 181, nil, 161, nil, 161, nil, 90, nil, 181, + nil, 90, 90, 166, 166, 90, nil, nil, nil, nil, + 90, 90, nil, nil, 90, nil, nil, 90, nil, nil, + nil, nil, 161, nil, nil, 90, 161, 161, nil, nil, + 161, nil, nil, nil, nil, 161, 166, nil, nil, 161, + 166, 166, nil, nil, 166, nil, nil, nil, 166, 166, + 161, 95, 95, 166, nil, 95, nil, 95, 277, 277, + 277, 277, 277, 277, 166, 277, 277, nil, 269, 269, + 269, 269, 277, 95, nil, 269, 269, 178, 178, nil, + nil, 178, 269, 178, 95, nil, nil, nil, 95, 95, + nil, nil, 95, nil, nil, nil, nil, 95, 95, 178, + nil, 95, nil, nil, 95, nil, nil, 99, 99, nil, + 178, 99, 95, 99, 178, 178, nil, nil, 178, nil, + nil, nil, nil, 178, 178, nil, nil, 178, nil, 99, + 178, nil, nil, 242, 242, nil, nil, 242, 178, 242, + 99, nil, nil, nil, 99, 99, nil, nil, 99, nil, + nil, nil, nil, 99, 99, 242, nil, 99, nil, nil, + 99, nil, nil, nil, nil, nil, 242, nil, 99, nil, + 242, 242, 91, nil, 242, nil, nil, nil, nil, 242, + 242, 91, 91, 242, nil, nil, 242, nil, nil, nil, + 91, 91, 91, 91, 242, nil, 129, 129, nil, nil, + nil, nil, nil, nil, nil, 129, 129, 129, 129, nil, + nil, nil, nil, nil, 91, 91, nil, nil, 91, 91, + 91, 91, 91, 91, nil, 91, 91, nil, nil, 129, + 129, nil, 91, 129, 129, 129, 129, 129, 129, nil, + 129, 129, 190, 190, nil, nil, nil, 129, nil, nil, + 190, 190, 190, 190, 190, nil, nil, 271, 271, nil, + nil, nil, nil, nil, nil, nil, 271, 271, 271, 271, + nil, nil, nil, nil, nil, 190, 190, nil, nil, 190, + 190, 190, 190, 190, 190, nil, 190, 190, nil, nil, + nil, 271, nil, 190, 271, 271, 271, 271, 271, 271, + nil, 271, 271, 131, 131, nil, nil, nil, 271, nil, + nil, nil, 131, 131, 131, 131, nil, nil, 132, 132, + nil, nil, nil, nil, nil, nil, nil, 132, 132, 132, + 132, nil, nil, nil, nil, nil, 131, 131, nil, nil, + 131, 131, 131, 131, 131, 131, nil, 131, 131, nil, + nil, 132, 132, nil, 131, 132, 132, 132, 132, 132, + 132, nil, 132, 132, 275, 275, nil, nil, nil, 132, + nil, nil, nil, 275, 275, 275, 275, nil, nil, 279, + 276, 279, 279, nil, 279, 279, nil, 279, 276, 279, + nil, 279, nil, 279, nil, nil, 279, 279, nil, 270, + nil, 275, 275, 275, 275, 275, 275, 270, 275, 275, + nil, nil, nil, nil, 272, 275, 276, 276, 276, 276, + 276, 276, 272, 276, 276, nil, nil, nil, nil, nil, + 276, nil, nil, nil, nil, 270, 270, 270, 270, 270, + 270, nil, 270, 270, 188, nil, nil, nil, nil, 270, + 272, 272, 272, 272, 272, 272, nil, 272, 272, nil, + nil, nil, nil, 363, 272, 188, nil, 188, 188, nil, + 188, 188, nil, 188, nil, 188, nil, 188, nil, 188, + nil, nil, 188, 188, 363, 312, 363, 363, nil, 363, + 363, nil, 363, nil, 363, nil, 363, nil, 363, nil, + nil, 363, 363, nil, 376, nil, 312, nil, 312, 312, + nil, 312, 312, nil, 312, nil, 312, nil, 312, nil, + 312, nil, nil, 312, 312, 376, 217, 376, 376, nil, + 376, 376, nil, 376, nil, 376, nil, 376, nil, 376, + nil, nil, 376, 376, nil, 373, nil, 217, nil, 217, + 217, nil, 217, 217, nil, 217, nil, 217, nil, 217, + nil, 217, nil, nil, 217, 217, 373, 238, 373, 373, + nil, 373, 373, nil, 373, nil, 373, nil, 373, nil, + 373, nil, nil, 373, 373, nil, nil, nil, 238, nil, + 238, 238, nil, 238, 238, nil, 238, nil, 238, nil, + 238, nil, 238, nil, nil, 238, 238, 20, nil, 20, + 20, nil, 20, 20, nil, 20, nil, 20, nil, 20, + nil, 20, nil, nil, 20, 20, 0, nil, 0, 0, + nil, 0, 0, nil, 0, nil, 0, nil, 0, nil, + 0, nil, nil, 0, 0, 268, 268, 268, 268, 268, + 268, nil, 268, 268, nil, nil, nil, nil, nil, 268 ] racc_action_pointer = [ - 1674, 54, 417, 341, 399, 434, 455, nil, 262, nil, - nil, 112, 404, 402, nil, nil, nil, 395, 16, nil, - 1693, nil, nil, 268, nil, nil, 293, -1, nil, 341, - nil, 425, 381, 181, nil, nil, nil, 342, nil, nil, - nil, nil, 246, nil, nil, 445, 200, 501, 159, 557, - 305, 575, 283, 321, nil, nil, -6, nil, nil, nil, - nil, nil, nil, nil, 291, 265, 273, nil, nil, nil, - 703, 750, nil, nil, 269, 242, nil, 212, 840, nil, - 208, 2, 68, 64, nil, 37, nil, 186, nil, 275, - 1039, 1261, nil, nil, 279, 1125, nil, nil, nil, 1151, - 1176, 287, 289, 161, nil, 295, 315, 317, 323, nil, - 343, 116, 652, 315, 78, 350, 361, nil, nil, 374, - nil, 379, 81, nil, nil, nil, nil, 382, nil, 1444, - nil, 1383, 1337, 391, 376, nil, 394, nil, nil, nil, - 389, 408, 440, 314, 38, nil, 447, 436, nil, nil, - nil, nil, nil, nil, -8, 420, nil, 37, 0, 418, - nil, 80, nil, 87, -4, nil, 287, 351, nil, 302, - 376, nil, 419, 475, 531, 26, 582, 633, 801, 927, - 1228, 983, 1069, 256, 1095, 957, 1202, 243, 1532, 1013, - 1276, nil, 115, nil, 21, nil, nil, 186, nil, nil, - 131, 254, nil, 74, nil, nil, 1, nil, nil, nil, - nil, 360, 249, 10, -13, 909, 85, 1655, 80, 82, - 106, 112, nil, nil, 181, 194, nil, 194, 879, 170, - 215, 865, 192, 826, 199, 235, nil, nil, 1551, 8, - 775, nil, 724, nil, nil, nil, nil, nil, nil, 270, - nil, nil, 259, nil, 677, nil, nil, nil, nil, 659, - nil, 59, 118, 116, 223, nil, 1716, 1707, 1725, 1459, - 1398, 1493, 49, nil, 1322, 1478, 1425, nil, 1712, 343, - 159, 307, nil, 353, nil, 8, nil, 394, 365, nil, - 110, nil, nil, -9, 322, 203, nil, 383, nil, 224, - nil, -8, nil, nil, 400, nil, 217, 210, nil, 109, - nil, 1573, nil, nil, nil, nil, nil, nil, nil, nil, - 406, nil, nil, nil, 411, nil, nil, nil, nil, 152, - nil, 135, nil, nil, 135, 133, nil, 427, nil, nil, - nil, nil, 427, nil, nil, nil, 415, 417, nil, 418, - 421, 422, nil, nil, nil, nil, 90, 442, nil, nil, - nil, nil, 1633, nil, nil, nil, nil, 446, 33, 451, - nil, nil, 1614, nil, nil, 1592, nil, nil, nil, 463, - nil, 464, nil, nil, nil ] + 1726, 123, 450, 384, 418, 461, 341, nil, 251, nil, + nil, -20, 446, 434, nil, nil, nil, 433, 0, nil, + 1707, nil, nil, 301, nil, nil, 326, 11, nil, 374, + nil, 306, 7, 320, nil, nil, nil, 403, nil, nil, + nil, nil, 295, nil, nil, 520, 170, 576, 606, 632, + 400, 679, 378, 416, nil, nil, -6, nil, nil, nil, + nil, nil, nil, nil, 389, 388, 396, nil, nil, 393, + 842, 867, nil, nil, 388, 376, nil, 363, 957, nil, + 362, 2, 340, 356, nil, 336, nil, 334, nil, 323, + 1092, 1294, nil, nil, 322, 1179, 333, nil, nil, 1235, + 1019, 314, 299, 1, nil, 298, 296, 288, 278, nil, + 286, 76, 918, 242, 176, 256, 238, nil, nil, 228, + nil, 185, 133, nil, nil, nil, nil, 97, nil, 1309, + nil, 1416, 1431, 90, 46, nil, -8, nil, 423, nil, + 285, 310, 381, 409, 91, nil, 422, 433, nil, nil, + nil, nil, nil, nil, 19, 477, nil, 5, 19, 484, + nil, 1117, nil, 95, -4, nil, 1131, 932, nil, 305, + 769, nil, 550, 494, 438, 199, 180, 654, 1205, 464, + 893, 1066, 816, 411, 275, 132, 84, 368, 1565, 36, + 1355, nil, 187, nil, 259, nil, nil, 151, nil, nil, + 27, 333, nil, 69, nil, nil, 80, nil, nil, nil, + nil, 340, 61, 66, -17, 250, 99, 1647, 131, 133, + 135, 119, nil, nil, 169, 248, nil, 204, 352, 204, + 239, 726, 216, 744, 230, 267, nil, nil, 1688, 280, + 976, nil, 1261, nil, nil, nil, nil, nil, nil, nil, + 295, nil, nil, 284, nil, 1001, nil, nil, nil, nil, + 1040, nil, 100, 165, 81, 163, nil, 218, 1721, 1144, + 1511, 1370, 1526, 96, nil, 1477, 1492, 1134, nil, 1479, + 381, 145, 135, nil, 389, nil, 9, nil, 795, 398, + nil, 70, nil, nil, 45, 705, 648, nil, 412, nil, + 26, nil, 125, nil, nil, 419, nil, 417, 395, nil, + 150, nil, 1606, nil, nil, nil, nil, nil, nil, nil, + nil, 424, nil, nil, nil, 430, nil, nil, nil, nil, + 257, nil, 25, nil, nil, 206, 206, nil, 447, nil, + nil, nil, nil, 450, nil, nil, nil, 438, 440, nil, + 441, 445, 448, nil, nil, nil, nil, 126, 467, nil, + nil, nil, nil, 1584, nil, nil, nil, nil, 470, 78, + 482, nil, nil, 1666, nil, nil, 1625, nil, nil, nil, + 486, nil, 489, nil, nil, nil ] racc_action_default = [ - -197, -234, -51, -19, -8, -234, -234, -9, -234, -10, - -188, -189, -234, -23, -11, -186, -12, -234, -234, -13, - -1, -14, -2, -187, -15, -3, -234, -234, -16, -234, - -17, -6, -234, -234, -18, -7, -189, -197, -187, -52, - -27, -28, -234, -25, -26, -234, -234, -234, -234, -234, - -197, -86, -93, -234, -196, -194, -197, -190, -192, -193, - -222, -195, -4, -42, -232, -43, -214, -175, -118, -44, - -234, -234, -45, -34, -75, -32, -33, -234, -234, -123, - -37, -74, -38, -234, -73, -39, -173, -40, -174, -41, - -234, -234, -126, -108, -104, -234, -112, -133, -113, -234, - -234, -105, -109, -234, -111, -106, -115, -107, -114, -110, - -54, -197, -234, -86, -197, -234, -179, -176, -177, -234, - -50, -234, -198, -199, -24, -21, -23, -187, -22, -84, - -20, -83, -85, -234, -197, -79, -76, -87, -82, -75, - -71, -77, -220, -80, -74, -69, -78, -234, -172, -171, - -81, -91, -92, -94, -234, -220, 385, -234, -234, -234, - -208, -234, -31, -234, -234, -119, -234, -234, -96, -234, - -234, -143, -234, -234, -234, -234, -234, -234, -234, -234, - -234, -234, -234, -234, -234, -234, -234, -234, -234, -234, - -234, -150, -234, -217, -234, -230, -226, -234, -229, -225, - -93, -234, -214, -197, -58, -60, -234, -67, -57, -74, - -66, -234, -220, -234, -234, -234, -234, -234, -207, -205, - -234, -234, -202, -231, -234, -234, -210, -234, -72, -221, - -234, -234, -86, -234, -221, -234, -191, -209, -234, -234, - -234, -29, -234, -121, -120, -36, -35, -169, -167, -234, - -170, -161, -74, -168, -234, -162, -218, -219, -124, -234, - -117, -234, -138, -140, -139, -134, -141, -145, -142, -147, - -152, -149, -146, -135, -151, -148, -144, -136, -5, -234, - -129, -137, -153, -219, -215, -234, -223, -234, -220, -55, - -234, -63, -62, -234, -234, -234, -125, -234, -56, -234, - -155, -234, -159, -178, -234, -181, -234, -234, -200, -234, - -201, -234, -212, -213, -211, -46, -70, -88, -47, -89, - -220, -90, -95, -49, -234, -185, -233, -30, -122, -234, - -164, -220, -97, -116, -129, -234, -128, -234, -216, -227, - -224, -228, -234, -59, -61, -102, -98, -99, -64, -103, - -100, -101, -65, -48, -156, -154, -234, -234, -180, -206, - -204, -203, -234, -183, -68, -184, -166, -219, -234, -234, - -127, -130, -234, -53, -160, -234, -182, -165, -163, -234, - -132, -234, -158, -131, -157 ] + -198, -235, -51, -19, -8, -235, -235, -9, -235, -10, + -189, -190, -235, -23, -11, -187, -12, -235, -235, -13, + -1, -14, -2, -188, -15, -3, -235, -235, -16, -235, + -17, -6, -235, -235, -18, -7, -190, -198, -188, -52, + -27, -28, -235, -25, -26, -235, -235, -235, -235, -235, + -198, -86, -93, -235, -197, -195, -198, -191, -193, -194, + -223, -196, -4, -42, -233, -43, -215, -176, -118, -44, + -235, -235, -45, -34, -75, -32, -33, -235, -235, -123, + -37, -74, -38, -235, -73, -39, -173, -40, -175, -41, + -235, -235, -126, -108, -104, -235, -112, -133, -113, -235, + -235, -105, -109, -235, -111, -106, -115, -107, -114, -110, + -54, -198, -235, -86, -198, -235, -180, -177, -178, -235, + -50, -235, -199, -200, -24, -21, -23, -188, -22, -84, + -20, -83, -85, -235, -198, -79, -76, -87, -82, -75, + -71, -77, -221, -80, -74, -69, -78, -235, -172, -171, + -81, -91, -92, -94, -235, -221, 386, -235, -235, -235, + -209, -235, -31, -235, -235, -119, -235, -235, -96, -235, + -235, -143, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -235, -235, -235, -235, -235, -235, -235, -235, -235, + -235, -150, -235, -218, -235, -231, -227, -235, -230, -226, + -93, -235, -215, -198, -58, -60, -235, -67, -57, -74, + -66, -235, -221, -235, -235, -235, -235, -235, -208, -206, + -235, -235, -203, -232, -235, -235, -211, -235, -72, -222, + -235, -235, -86, -235, -222, -235, -192, -210, -235, -235, + -235, -29, -235, -121, -120, -36, -35, -174, -169, -167, + -235, -170, -161, -74, -168, -235, -162, -219, -220, -124, + -235, -117, -235, -138, -140, -139, -134, -141, -145, -142, + -147, -152, -149, -146, -135, -151, -148, -144, -136, -5, + -235, -129, -137, -153, -220, -216, -235, -224, -235, -221, + -55, -235, -63, -62, -235, -235, -235, -125, -235, -56, + -235, -155, -235, -159, -179, -235, -182, -235, -235, -201, + -235, -202, -235, -213, -214, -212, -46, -70, -88, -47, + -89, -221, -90, -95, -49, -235, -186, -234, -30, -122, + -235, -164, -221, -97, -116, -129, -235, -128, -235, -217, + -228, -225, -229, -235, -59, -61, -102, -98, -99, -64, + -103, -100, -101, -65, -48, -156, -154, -235, -235, -181, + -207, -205, -204, -235, -184, -68, -185, -166, -220, -235, + -235, -127, -130, -235, -53, -160, -235, -183, -165, -163, + -235, -132, -235, -158, -131, -157 ] racc_goto_table = [ - 27, 13, 5, 37, 62, 255, 249, 20, 118, 196, - 92, 89, 142, 50, 155, 300, 69, 63, 222, 336, - 27, 13, 5, 165, 73, 75, 57, 279, 348, 352, - 246, 151, 145, 119, 343, 150, 121, 230, 65, 149, - 299, 22, 27, 126, 138, 135, 27, 126, 201, 134, - 235, 214, 120, 87, 302, 86, 304, 244, 89, 42, - 169, 128, 46, 69, 63, 128, 136, 251, 368, 331, - 322, 73, 163, 370, 212, 125, 124, 324, 123, 130, - 124, 148, 192, 86, 116, 65, 140, 224, 56, 159, - 227, 123, 330, 249, 211, 237, 220, 160, 221, 354, - 87, 110, 86, 115, 246, 314, 194, 297, 17, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 195, nil, - nil, nil, nil, 133, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 54, nil, nil, nil, 302, nil, - 293, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 168, nil, 89, 149, nil, nil, 89, 69, - 63, nil, 288, 69, 63, 236, nil, 245, nil, nil, - nil, 73, 261, 82, 168, 226, nil, nil, nil, 151, - nil, 65, 247, 342, nil, 65, 168, nil, 27, 13, - 5, 339, 303, 320, 328, 374, 87, 148, 86, 86, - 87, 143, 86, 149, 80, 361, 377, 249, 317, 316, - nil, 379, 150, 151, 381, 364, 149, 27, 13, 5, - 82, 138, 135, nil, nil, nil, 369, 312, 89, nil, - 247, nil, 141, 69, 63, 239, nil, nil, 27, 13, - 5, 245, 149, 136, nil, 148, nil, 86, nil, 265, - nil, 80, nil, nil, nil, 65, nil, nil, 148, nil, - 86, 210, 62, nil, 210, nil, nil, nil, 85, 247, - 87, nil, 86, 54, 54, nil, nil, nil, 27, 13, - 5, nil, 149, 149, 148, nil, 86, 149, 345, 345, - nil, nil, 207, nil, nil, 207, 146, nil, nil, 273, - 195, nil, nil, 277, nil, 319, nil, 321, nil, 346, - 346, 27, 13, 5, 247, 85, 82, 250, 362, 371, - 82, nil, nil, nil, 351, 351, 86, 86, nil, 148, - nil, 86, nil, 332, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 149, nil, 62, 80, 248, nil, - nil, 80, nil, 210, nil, nil, 149, nil, nil, nil, - nil, 341, 27, 13, 5, 250, nil, nil, nil, nil, - nil, 247, 27, 13, 5, 27, 13, 5, 143, nil, - 359, 360, nil, 247, 207, nil, 148, nil, 86, nil, - 82, nil, 129, nil, 131, 132, 248, nil, 148, nil, - 86, nil, nil, 366, 250, nil, nil, nil, nil, 141, - nil, 85, 253, nil, nil, 85, nil, nil, 164, nil, - nil, 80, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 248, nil, 171, nil, nil, - 210, nil, 190, nil, 349, 349, 191, nil, nil, 250, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 253, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 207, nil, 146, nil, 347, 347, nil, nil, nil, - 248, nil, nil, nil, nil, 85, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 253, - nil, nil, nil, nil, nil, nil, 250, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 250, 262, - 263, 264, nil, 266, 267, 268, 269, 270, 271, 272, - nil, 274, 275, 276, nil, nil, 281, 248, nil, 350, - 350, nil, nil, nil, 253, nil, nil, nil, nil, 248, + 27, 13, 20, 222, 89, 92, 115, 37, 62, 5, + 65, 196, 256, 145, 230, 150, 118, 50, 155, 301, + 27, 13, 246, 75, 73, 57, 133, 235, 201, 5, + 250, 214, 149, 119, 337, 165, 121, 344, 136, 69, + 169, 120, 27, 126, 142, 22, 27, 126, 300, 134, + 128, 89, 63, 151, 128, 168, 125, 65, 280, 124, + 130, 42, 192, 124, 46, 349, 353, 138, 244, 87, + 163, 73, 252, 369, 211, 332, 323, 168, 303, 116, + 135, 140, 123, 224, 298, 56, 69, 305, 371, 168, + 195, 159, 227, 237, 220, 123, 246, 148, 221, 63, + 331, 160, 110, 315, 355, 194, 212, 17, 325, nil, + nil, 86, nil, nil, nil, nil, 87, nil, 250, nil, + 294, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 239, 86, + nil, nil, nil, nil, nil, nil, nil, 89, 149, nil, + nil, 89, 266, 65, 248, nil, nil, 65, 86, nil, + nil, 343, nil, 303, 236, nil, 289, 245, nil, nil, + 262, 73, nil, nil, nil, 82, 247, nil, nil, 226, + nil, nil, 69, nil, nil, nil, 69, nil, 27, 13, + 317, 362, 150, 365, 340, 63, 149, 5, nil, 63, + 304, 151, 248, 143, 370, 85, 329, nil, 320, 149, + 322, nil, 87, 148, 378, 136, 87, 27, 13, nil, + 375, 89, 82, nil, 247, 321, 5, 65, nil, 54, + 318, 313, 250, 146, nil, 151, 149, 333, 27, 13, + nil, 245, 248, 380, 138, nil, 382, 5, nil, nil, + nil, nil, 85, nil, 86, 86, 69, 135, 86, nil, + nil, 148, nil, 210, 247, 342, 210, 62, nil, 63, + 80, nil, nil, 195, 148, nil, 149, 149, nil, 27, + 13, 149, 347, 347, 360, 361, 87, 248, 5, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 141, nil, + nil, 148, nil, 86, 247, 247, nil, 367, nil, 247, + nil, nil, 27, 13, 363, 372, 86, 80, 82, 251, + nil, 5, 82, nil, 346, 346, nil, nil, 86, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 149, nil, + nil, 352, 352, 86, 248, nil, 148, nil, 85, 254, + 149, 62, 85, nil, nil, 210, 248, nil, 207, nil, + nil, 207, nil, 27, 13, nil, 247, 251, 54, 54, + nil, nil, 5, 27, 13, nil, 27, 13, 247, nil, + 143, nil, 5, 86, 86, 5, nil, nil, 86, nil, + nil, nil, 82, nil, 274, nil, nil, 254, 278, nil, + nil, nil, nil, 148, nil, nil, nil, 251, nil, nil, + 146, nil, nil, 80, 249, 148, nil, 80, nil, nil, + nil, nil, 85, nil, nil, nil, nil, nil, nil, 129, + nil, 131, 132, nil, nil, nil, nil, 254, nil, nil, + nil, nil, nil, 210, nil, 86, nil, 350, 350, nil, + 207, nil, 251, nil, nil, 164, nil, 86, nil, nil, + nil, nil, 249, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, 171, 141, nil, 351, 351, 190, + nil, nil, 254, 191, nil, nil, nil, 80, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, 249, nil, nil, nil, nil, nil, nil, 251, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 251, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 207, 254, + nil, nil, 348, 348, nil, nil, nil, 249, nil, nil, + nil, 254, nil, nil, nil, nil, 263, 264, 265, nil, + 267, 268, 269, 270, 271, 272, 273, nil, 275, 276, + 277, nil, nil, 282, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 164, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 253, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 253 ] + nil, nil, nil, nil, 249, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 249, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 164 ] racc_goto_check = [ - 38, 22, 53, 33, 4, 71, 69, 2, 73, 86, - 63, 29, 36, 33, 39, 67, 32, 30, 83, 64, - 38, 22, 53, 61, 22, 23, 79, 5, 47, 47, - 24, 54, 48, 38, 43, 51, 75, 37, 31, 29, - 66, 3, 38, 22, 32, 30, 38, 22, 42, 75, - 37, 42, 6, 28, 69, 50, 5, 62, 29, 21, - 58, 6, 21, 32, 30, 6, 31, 70, 59, 72, - 57, 22, 23, 64, 36, 20, 8, 5, 3, 20, - 8, 28, 58, 50, 74, 31, 34, 76, 77, 78, - 35, 3, 71, 69, 58, 80, 81, 3, 82, 67, - 28, 41, 50, 55, 24, 84, 85, 37, 1, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 31, nil, - nil, nil, nil, 55, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 65, nil, nil, nil, 69, nil, + 38, 22, 2, 83, 29, 63, 55, 33, 4, 53, + 31, 86, 71, 48, 37, 51, 73, 33, 39, 67, + 38, 22, 24, 23, 22, 79, 55, 37, 42, 53, + 69, 42, 29, 38, 64, 61, 75, 43, 31, 32, + 58, 6, 38, 22, 36, 3, 38, 22, 66, 75, + 6, 29, 30, 54, 6, 55, 20, 31, 5, 8, + 20, 21, 58, 8, 21, 47, 47, 32, 62, 28, + 23, 22, 70, 59, 58, 72, 57, 55, 69, 74, + 30, 34, 3, 76, 37, 77, 32, 5, 64, 55, + 31, 78, 35, 80, 81, 3, 24, 28, 82, 30, + 71, 3, 41, 84, 67, 85, 36, 1, 5, nil, + nil, 50, nil, nil, nil, nil, 28, nil, 69, nil, 42, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, 55, nil, 29, 29, nil, nil, 29, 32, - 30, nil, 39, 32, 30, 79, nil, 22, nil, nil, - nil, 22, 23, 26, 55, 3, nil, nil, nil, 54, - nil, 31, 31, 37, nil, 31, 55, nil, 38, 22, - 53, 86, 73, 36, 61, 69, 28, 28, 50, 50, - 28, 26, 50, 29, 25, 83, 71, 69, 54, 48, - nil, 5, 51, 54, 5, 37, 29, 38, 22, 53, - 26, 32, 30, nil, nil, nil, 37, 33, 29, nil, - 31, nil, 25, 32, 30, 55, nil, nil, 38, 22, - 53, 22, 29, 31, nil, 28, nil, 50, nil, 55, - nil, 25, nil, nil, nil, 31, nil, nil, 28, nil, - 50, 26, 4, nil, 26, nil, nil, nil, 27, 31, - 28, nil, 50, 65, 65, nil, nil, nil, 38, 22, - 53, nil, 29, 29, 28, nil, 50, 29, 30, 30, - nil, nil, 25, nil, nil, 25, 27, nil, nil, 65, - 31, nil, nil, 65, nil, 55, nil, 55, nil, 31, - 31, 38, 22, 53, 31, 27, 26, 26, 2, 63, - 26, nil, nil, nil, 28, 28, 50, 50, nil, 28, - nil, 50, nil, 55, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 29, nil, 4, 25, 25, nil, - nil, 25, nil, 26, nil, nil, 29, nil, nil, nil, - nil, 55, 38, 22, 53, 26, nil, nil, nil, nil, - nil, 31, 38, 22, 53, 38, 22, 53, 26, nil, - 55, 55, nil, 31, 25, nil, 28, nil, 50, nil, - 26, nil, 52, nil, 52, 52, 25, nil, 28, nil, - 50, nil, nil, 55, 26, nil, nil, nil, nil, 25, - nil, 27, 27, nil, nil, 27, nil, nil, 52, nil, - nil, 25, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 25, nil, 52, nil, nil, - 26, nil, 52, nil, 26, 26, 52, nil, nil, 26, + nil, nil, nil, nil, nil, nil, nil, nil, 55, 50, + nil, nil, nil, nil, nil, nil, nil, 29, 29, nil, + nil, 29, 55, 31, 31, nil, nil, 31, 50, nil, + nil, 37, nil, 69, 79, nil, 39, 22, nil, nil, + 23, 22, nil, nil, nil, 26, 53, nil, nil, 3, + nil, nil, 32, nil, nil, nil, 32, nil, 38, 22, + 48, 83, 51, 37, 86, 30, 29, 53, nil, 30, + 73, 54, 31, 26, 37, 27, 61, nil, 55, 29, + 55, nil, 28, 28, 71, 31, 28, 38, 22, nil, + 69, 29, 26, nil, 53, 36, 53, 31, nil, 65, + 54, 33, 69, 27, nil, 54, 29, 55, 38, 22, + nil, 22, 31, 5, 32, nil, 5, 53, nil, nil, + nil, nil, 27, nil, 50, 50, 32, 30, 50, nil, + nil, 28, nil, 26, 53, 55, 26, 4, nil, 30, + 25, nil, nil, 31, 28, nil, 29, 29, nil, 38, + 22, 29, 31, 31, 55, 55, 28, 31, 53, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 25, nil, + nil, 28, nil, 50, 53, 53, nil, 55, nil, 53, + nil, nil, 38, 22, 2, 63, 50, 25, 26, 26, + nil, 53, 26, nil, 30, 30, nil, nil, 50, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 29, nil, + nil, 28, 28, 50, 31, nil, 28, nil, 27, 27, + 29, 4, 27, nil, nil, 26, 31, nil, 25, nil, + nil, 25, nil, 38, 22, nil, 53, 26, 65, 65, + nil, nil, 53, 38, 22, nil, 38, 22, 53, nil, + 26, nil, 53, 50, 50, 53, nil, nil, 50, nil, + nil, nil, 26, nil, 65, nil, nil, 27, 65, nil, + nil, nil, nil, 28, nil, nil, nil, 26, nil, nil, + 27, nil, nil, 25, 25, 28, nil, 25, nil, nil, + nil, nil, 27, nil, nil, nil, nil, nil, nil, 52, + nil, 52, 52, nil, nil, nil, nil, 27, nil, nil, + nil, nil, nil, 26, nil, 50, nil, 26, 26, nil, + 25, nil, 26, nil, nil, 52, nil, 50, nil, nil, + nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, 52, 25, nil, 27, 27, 52, + nil, nil, 27, 52, nil, nil, nil, 25, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 27, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 25, nil, 27, nil, 25, 25, nil, nil, nil, - 25, nil, nil, nil, nil, 27, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 27, - nil, nil, nil, nil, nil, nil, 26, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, 26, 52, - 52, 52, nil, 52, 52, 52, 52, 52, 52, 52, - nil, 52, 52, 52, nil, nil, 52, 25, nil, 27, - 27, nil, nil, nil, 27, nil, nil, nil, nil, 25, + nil, nil, 25, nil, nil, nil, nil, nil, nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 26, nil, nil, nil, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, nil, nil, 25, 27, + nil, nil, 25, 25, nil, nil, nil, 25, nil, nil, + nil, 27, nil, nil, nil, nil, 52, 52, 52, nil, + 52, 52, 52, 52, 52, 52, 52, nil, 52, 52, + 52, nil, nil, 52, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, nil, nil, 52, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 27, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, 27 ] + nil, nil, nil, nil, 25, nil, nil, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 25, nil, nil, nil, + nil, nil, nil, nil, nil, nil, 52 ] racc_goto_pointer = [ - nil, 108, 7, 41, -16, -161, 19, nil, 34, nil, + nil, 107, 2, 45, -12, -130, 8, nil, 17, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - 33, 56, 1, 2, -136, 181, 150, 245, 30, -12, - -6, 15, -7, 2, 35, -50, -39, -105, 0, -38, - nil, 74, -63, -256, nil, nil, nil, -266, -19, nil, - 32, -16, 347, 2, -21, 74, nil, -164, -18, -263, - nil, -48, -107, -16, -261, 116, -175, -200, nil, -161, - -100, -162, -185, -24, 52, -1, -47, 70, 33, 8, - -63, -26, -24, -104, -120, 3, -94, nil ] + 14, 58, 1, 0, -144, 247, 152, 182, 46, -19, + 29, -13, 16, 6, 30, -48, -7, -128, 0, -34, + nil, 75, -83, -254, nil, nil, nil, -230, -38, nil, + 88, -36, 384, 9, 1, -23, nil, -158, -38, -259, + nil, -36, -96, -21, -247, 211, -167, -196, nil, -137, + -95, -155, -180, -16, 47, -1, -51, 67, 35, 7, + -65, -28, -24, -119, -122, 2, -92, nil ] racc_goto_default = [ - nil, nil, 278, 208, 25, nil, 31, 35, 4, 7, + nil, nil, 279, 208, 25, nil, 31, 35, 4, 7, 9, 14, 16, 19, 21, 24, 28, 30, 34, 3, 6, nil, 98, nil, 76, 101, 102, 105, 107, 108, 93, 94, 96, 12, nil, nil, nil, nil, 83, nil, - 33, nil, nil, 204, 290, 205, 206, nil, nil, 147, - 106, 109, 91, 64, 137, 97, 152, 153, nil, 259, - 104, nil, nil, nil, nil, 67, nil, nil, 301, 77, + 33, nil, nil, 204, 291, 205, 206, nil, nil, 147, + 106, 109, 91, 64, 137, 97, 152, 153, nil, 260, + 104, nil, nil, nil, nil, 67, nil, nil, 302, 77, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 58, nil, nil, nil, nil, nil, nil, 197 ] -racc_token_table = { - false => 0, - Object.new => 1, - :STRING => 2, - :DQPRE => 3, - :DQMID => 4, - :DQPOST => 5, - :LBRACK => 6, - :RBRACK => 7, - :LBRACE => 8, - :RBRACE => 9, - :SYMBOL => 10, - :FARROW => 11, - :COMMA => 12, - :TRUE => 13, - :FALSE => 14, - :EQUALS => 15, - :APPENDS => 16, - :LESSEQUAL => 17, - :NOTEQUAL => 18, - :DOT => 19, - :COLON => 20, - :LLCOLLECT => 21, - :RRCOLLECT => 22, - :QMARK => 23, - :LPAREN => 24, - :RPAREN => 25, - :ISEQUAL => 26, - :GREATEREQUAL => 27, - :GREATERTHAN => 28, - :LESSTHAN => 29, - :IF => 30, - :ELSE => 31, - :IMPORT => 32, - :DEFINE => 33, - :ELSIF => 34, - :VARIABLE => 35, - :CLASS => 36, - :INHERITS => 37, - :NODE => 38, - :BOOLEAN => 39, - :NAME => 40, - :SEMIC => 41, - :CASE => 42, - :DEFAULT => 43, - :AT => 44, - :LCOLLECT => 45, - :RCOLLECT => 46, - :CLASSNAME => 47, - :CLASSREF => 48, - :NOT => 49, - :OR => 50, - :AND => 51, - :UNDEF => 52, - :PARROW => 53, - :PLUS => 54, - :MINUS => 55, - :TIMES => 56, - :DIV => 57, - :LSHIFT => 58, - :RSHIFT => 59, - :UMINUS => 60, - :MATCH => 61, - :NOMATCH => 62, - :REGEX => 63, - :IN_EDGE => 64, - :OUT_EDGE => 65, - :IN_EDGE_SUB => 66, - :OUT_EDGE_SUB => 67, - :IN => 68 } +racc_reduce_table = [ + 0, 0, :racc_error, + 1, 70, :_reduce_none, + 1, 70, :_reduce_none, + 1, 71, :_reduce_3, + 2, 71, :_reduce_4, + 1, 74, :_reduce_5, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 1, 73, :_reduce_none, + 3, 88, :_reduce_20, + 3, 88, :_reduce_21, + 1, 89, :_reduce_none, + 1, 89, :_reduce_none, + 1, 89, :_reduce_none, + 1, 90, :_reduce_none, + 1, 90, :_reduce_none, + 1, 90, :_reduce_none, + 1, 90, :_reduce_none, + 4, 82, :_reduce_29, + 5, 82, :_reduce_30, + 3, 82, :_reduce_31, + 2, 82, :_reduce_32, + 1, 92, :_reduce_33, + 1, 92, :_reduce_34, + 3, 92, :_reduce_35, + 3, 92, :_reduce_36, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_none, + 1, 93, :_reduce_45, + 5, 75, :_reduce_46, + 5, 75, :_reduce_47, + 5, 75, :_reduce_48, + 5, 86, :_reduce_49, + 2, 76, :_reduce_50, + 1, 109, :_reduce_51, + 2, 109, :_reduce_52, + 6, 77, :_reduce_53, + 2, 77, :_reduce_54, + 3, 110, :_reduce_55, + 3, 110, :_reduce_56, + 1, 111, :_reduce_none, + 1, 111, :_reduce_none, + 3, 111, :_reduce_59, + 1, 112, :_reduce_none, + 3, 112, :_reduce_61, + 1, 113, :_reduce_62, + 1, 113, :_reduce_63, + 3, 114, :_reduce_64, + 3, 114, :_reduce_65, + 1, 115, :_reduce_none, + 1, 115, :_reduce_none, + 4, 117, :_reduce_68, + 1, 103, :_reduce_69, + 3, 103, :_reduce_70, + 0, 104, :_reduce_none, + 1, 104, :_reduce_none, + 1, 119, :_reduce_73, + 1, 94, :_reduce_74, + 1, 96, :_reduce_75, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 1, 118, :_reduce_none, + 3, 78, :_reduce_83, + 3, 78, :_reduce_84, + 3, 87, :_reduce_85, + 0, 105, :_reduce_86, + 1, 105, :_reduce_87, + 3, 105, :_reduce_88, + 3, 123, :_reduce_89, + 3, 125, :_reduce_90, + 1, 126, :_reduce_none, + 1, 126, :_reduce_none, + 0, 108, :_reduce_93, + 1, 108, :_reduce_94, + 3, 108, :_reduce_95, + 1, 127, :_reduce_96, + 3, 127, :_reduce_97, + 1, 116, :_reduce_none, + 1, 116, :_reduce_none, + 1, 116, :_reduce_none, + 1, 116, :_reduce_none, + 1, 116, :_reduce_none, + 1, 116, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 1, 124, :_reduce_none, + 4, 98, :_reduce_116, + 3, 98, :_reduce_117, + 1, 100, :_reduce_118, + 2, 100, :_reduce_119, + 2, 130, :_reduce_120, + 1, 131, :_reduce_121, + 2, 131, :_reduce_122, + 1, 97, :_reduce_123, + 4, 91, :_reduce_124, + 4, 91, :_reduce_125, + 2, 80, :_reduce_126, + 5, 132, :_reduce_127, + 4, 132, :_reduce_128, + 0, 133, :_reduce_none, + 2, 133, :_reduce_130, + 4, 133, :_reduce_131, + 3, 133, :_reduce_132, + 1, 121, :_reduce_none, + 3, 121, :_reduce_134, + 3, 121, :_reduce_135, + 3, 121, :_reduce_136, + 3, 121, :_reduce_137, + 3, 121, :_reduce_138, + 3, 121, :_reduce_139, + 3, 121, :_reduce_140, + 3, 121, :_reduce_141, + 3, 121, :_reduce_142, + 2, 121, :_reduce_143, + 3, 121, :_reduce_144, + 3, 121, :_reduce_145, + 3, 121, :_reduce_146, + 3, 121, :_reduce_147, + 3, 121, :_reduce_148, + 3, 121, :_reduce_149, + 2, 121, :_reduce_150, + 3, 121, :_reduce_151, + 3, 121, :_reduce_152, + 3, 121, :_reduce_153, + 5, 79, :_reduce_154, + 1, 135, :_reduce_155, + 2, 135, :_reduce_156, + 5, 136, :_reduce_157, + 4, 136, :_reduce_158, + 1, 137, :_reduce_159, + 3, 137, :_reduce_160, + 3, 99, :_reduce_161, + 1, 139, :_reduce_none, + 4, 139, :_reduce_163, + 1, 141, :_reduce_none, + 3, 141, :_reduce_165, + 3, 140, :_reduce_166, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_none, + 1, 138, :_reduce_175, + 1, 138, :_reduce_none, + 1, 142, :_reduce_177, + 1, 143, :_reduce_none, + 3, 143, :_reduce_179, + 2, 81, :_reduce_180, + 6, 83, :_reduce_181, + 5, 83, :_reduce_182, + 7, 84, :_reduce_183, + 6, 84, :_reduce_184, + 6, 85, :_reduce_185, + 5, 85, :_reduce_186, + 1, 107, :_reduce_187, + 1, 102, :_reduce_188, + 1, 102, :_reduce_189, + 1, 102, :_reduce_190, + 1, 146, :_reduce_191, + 3, 146, :_reduce_192, + 1, 148, :_reduce_193, + 1, 149, :_reduce_194, + 1, 149, :_reduce_195, + 1, 149, :_reduce_196, + 1, 149, :_reduce_none, + 0, 72, :_reduce_198, + 0, 150, :_reduce_199, + 1, 144, :_reduce_none, + 3, 144, :_reduce_201, + 3, 144, :_reduce_202, + 1, 151, :_reduce_none, + 3, 151, :_reduce_204, + 3, 152, :_reduce_205, + 1, 152, :_reduce_206, + 3, 152, :_reduce_207, + 1, 152, :_reduce_208, + 1, 147, :_reduce_none, + 2, 147, :_reduce_210, + 1, 145, :_reduce_none, + 2, 145, :_reduce_212, + 1, 153, :_reduce_none, + 1, 153, :_reduce_none, + 1, 95, :_reduce_215, + 3, 120, :_reduce_216, + 4, 120, :_reduce_217, + 2, 120, :_reduce_218, + 1, 128, :_reduce_none, + 1, 128, :_reduce_none, + 0, 106, :_reduce_none, + 1, 106, :_reduce_222, + 1, 134, :_reduce_223, + 3, 129, :_reduce_224, + 4, 129, :_reduce_225, + 2, 129, :_reduce_226, + 1, 154, :_reduce_none, + 3, 154, :_reduce_228, + 3, 155, :_reduce_229, + 1, 156, :_reduce_230, + 1, 156, :_reduce_231, + 4, 122, :_reduce_232, + 1, 101, :_reduce_none, + 4, 101, :_reduce_234 ] + +racc_reduce_n = 235 + +racc_shift_n = 386 -racc_use_result_var = true +racc_token_table = { + false => 0, + :error => 1, + :STRING => 2, + :DQPRE => 3, + :DQMID => 4, + :DQPOST => 5, + :LBRACK => 6, + :RBRACK => 7, + :LBRACE => 8, + :RBRACE => 9, + :SYMBOL => 10, + :FARROW => 11, + :COMMA => 12, + :TRUE => 13, + :FALSE => 14, + :EQUALS => 15, + :APPENDS => 16, + :LESSEQUAL => 17, + :NOTEQUAL => 18, + :DOT => 19, + :COLON => 20, + :LLCOLLECT => 21, + :RRCOLLECT => 22, + :QMARK => 23, + :LPAREN => 24, + :RPAREN => 25, + :ISEQUAL => 26, + :GREATEREQUAL => 27, + :GREATERTHAN => 28, + :LESSTHAN => 29, + :IF => 30, + :ELSE => 31, + :IMPORT => 32, + :DEFINE => 33, + :ELSIF => 34, + :VARIABLE => 35, + :CLASS => 36, + :INHERITS => 37, + :NODE => 38, + :BOOLEAN => 39, + :NAME => 40, + :SEMIC => 41, + :CASE => 42, + :DEFAULT => 43, + :AT => 44, + :LCOLLECT => 45, + :RCOLLECT => 46, + :CLASSNAME => 47, + :CLASSREF => 48, + :NOT => 49, + :OR => 50, + :AND => 51, + :UNDEF => 52, + :PARROW => 53, + :PLUS => 54, + :MINUS => 55, + :TIMES => 56, + :DIV => 57, + :LSHIFT => 58, + :RSHIFT => 59, + :UMINUS => 60, + :MATCH => 61, + :NOMATCH => 62, + :REGEX => 63, + :IN_EDGE => 64, + :OUT_EDGE => 65, + :IN_EDGE_SUB => 66, + :OUT_EDGE_SUB => 67, + :IN => 68 } racc_nt_base = 69 +racc_use_result_var = true + Racc_arg = [ - racc_action_table, - racc_action_check, - racc_action_default, - racc_action_pointer, - racc_goto_table, - racc_goto_check, - racc_goto_default, - racc_goto_pointer, - racc_nt_base, - racc_reduce_table, - racc_token_table, - racc_shift_n, - racc_reduce_n, - racc_use_result_var ] + racc_action_table, + racc_action_check, + racc_action_default, + racc_action_pointer, + racc_goto_table, + racc_goto_check, + racc_goto_default, + racc_goto_pointer, + racc_nt_base, + racc_reduce_table, + racc_token_table, + racc_shift_n, + racc_reduce_n, + racc_use_result_var ] Racc_token_to_s_table = [ -'$end', -'error', -'STRING', -'DQPRE', -'DQMID', -'DQPOST', -'LBRACK', -'RBRACK', -'LBRACE', -'RBRACE', -'SYMBOL', -'FARROW', -'COMMA', -'TRUE', -'FALSE', -'EQUALS', -'APPENDS', -'LESSEQUAL', -'NOTEQUAL', -'DOT', -'COLON', -'LLCOLLECT', -'RRCOLLECT', -'QMARK', -'LPAREN', -'RPAREN', -'ISEQUAL', -'GREATEREQUAL', -'GREATERTHAN', -'LESSTHAN', -'IF', -'ELSE', -'IMPORT', -'DEFINE', -'ELSIF', -'VARIABLE', -'CLASS', -'INHERITS', -'NODE', -'BOOLEAN', -'NAME', -'SEMIC', -'CASE', -'DEFAULT', -'AT', -'LCOLLECT', -'RCOLLECT', -'CLASSNAME', -'CLASSREF', -'NOT', -'OR', -'AND', -'UNDEF', -'PARROW', -'PLUS', -'MINUS', -'TIMES', -'DIV', -'LSHIFT', -'RSHIFT', -'UMINUS', -'MATCH', -'NOMATCH', -'REGEX', -'IN_EDGE', -'OUT_EDGE', -'IN_EDGE_SUB', -'OUT_EDGE_SUB', -'IN', -'$start', -'program', -'statements_and_declarations', -'nil', -'statement_or_declaration', -'statements', -'resource', -'virtualresource', -'collection', -'assignment', -'casestatement', -'ifstatement_begin', -'import', -'fstatement', -'definition', -'hostclass', -'nodedef', -'resourceoverride', -'append', -'relationship', -'relationship_side', -'edge', -'resourceref', -'funcvalues', -'namestring', -'name', -'variable', -'type', -'boolean', -'funcrvalue', -'selector', -'quotedtext', -'hasharrayaccesses', -'classname', -'resourceinstances', -'endsemi', -'params', -'endcomma', -'classref', -'anyparams', -'at', -'collectrhand', -'collstatements', -'collstatement', -'colljoin', -'collexpr', -'colllval', -'simplervalue', -'resourceinst', -'resourcename', -'undef', -'array', -'expression', -'hasharrayaccess', -'param', -'rvalue', -'addparam', -'anyparam', -'rvalues', -'comma', -'hash', -'dqrval', -'dqtail', -'ifstatement', -'else', -'regex', -'caseopts', -'caseopt', -'casevalues', -'selectlhand', -'svalues', -'selectval', -'sintvalues', -'string', -'strings', -'argumentlist', -'classparent', -'hostnames', -'nodeparent', -'nodename', -'hostname', -'nothing', -'arguments', -'argument', -'classnameordefault', -'hashpairs', -'hashpair', -'key'] + "$end", + "error", + "STRING", + "DQPRE", + "DQMID", + "DQPOST", + "LBRACK", + "RBRACK", + "LBRACE", + "RBRACE", + "SYMBOL", + "FARROW", + "COMMA", + "TRUE", + "FALSE", + "EQUALS", + "APPENDS", + "LESSEQUAL", + "NOTEQUAL", + "DOT", + "COLON", + "LLCOLLECT", + "RRCOLLECT", + "QMARK", + "LPAREN", + "RPAREN", + "ISEQUAL", + "GREATEREQUAL", + "GREATERTHAN", + "LESSTHAN", + "IF", + "ELSE", + "IMPORT", + "DEFINE", + "ELSIF", + "VARIABLE", + "CLASS", + "INHERITS", + "NODE", + "BOOLEAN", + "NAME", + "SEMIC", + "CASE", + "DEFAULT", + "AT", + "LCOLLECT", + "RCOLLECT", + "CLASSNAME", + "CLASSREF", + "NOT", + "OR", + "AND", + "UNDEF", + "PARROW", + "PLUS", + "MINUS", + "TIMES", + "DIV", + "LSHIFT", + "RSHIFT", + "UMINUS", + "MATCH", + "NOMATCH", + "REGEX", + "IN_EDGE", + "OUT_EDGE", + "IN_EDGE_SUB", + "OUT_EDGE_SUB", + "IN", + "$start", + "program", + "statements_and_declarations", + "nil", + "statement_or_declaration", + "statements", + "resource", + "virtualresource", + "collection", + "assignment", + "casestatement", + "ifstatement_begin", + "import", + "fstatement", + "definition", + "hostclass", + "nodedef", + "resourceoverride", + "append", + "relationship", + "relationship_side", + "edge", + "resourceref", + "funcvalues", + "namestring", + "name", + "variable", + "type", + "boolean", + "funcrvalue", + "selector", + "quotedtext", + "hasharrayaccesses", + "classname", + "resourceinstances", + "endsemi", + "params", + "endcomma", + "classref", + "anyparams", + "at", + "collectrhand", + "collstatements", + "collstatement", + "colljoin", + "collexpr", + "colllval", + "simplervalue", + "resourceinst", + "resourcename", + "undef", + "array", + "expression", + "hasharrayaccess", + "param", + "rvalue", + "addparam", + "anyparam", + "rvalues", + "comma", + "hash", + "dqrval", + "dqtail", + "ifstatement", + "else", + "regex", + "caseopts", + "caseopt", + "casevalues", + "selectlhand", + "svalues", + "selectval", + "sintvalues", + "string", + "strings", + "argumentlist", + "classparent", + "hostnames", + "nodeparent", + "nodename", + "hostname", + "nothing", + "arguments", + "argument", + "classnameordefault", + "hashpairs", + "hashpair", + "key" ] Racc_debug_parser = false -##### racc system variables end ##### +##### State transition tables end ##### - # reduce 0 omitted +# reduce 0 omitted - # reduce 1 omitted +# reduce 1 omitted - # reduce 2 omitted +# reduce 2 omitted -module_eval <<'.,.,', 'grammar.ra', 36 - def _reduce_3( val, _values, result ) - result = ast AST::ASTArray, :children => (val[0] ? [val[0]] : []) - result +module_eval(<<'.,.,', 'grammar.ra', 34) + def _reduce_3(val, _values, result) + result = ast AST::ASTArray, :children => (val[0] ? [val[0]] : []) + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 42 - def _reduce_4( val, _values, result ) - if val[1] +module_eval(<<'.,.,', 'grammar.ra', 37) + def _reduce_4(val, _values, result) + if val[1] val[0].push(val[1]) end result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 54 - def _reduce_5( val, _values, result ) - val[0].each do |stmt| +module_eval(<<'.,.,', 'grammar.ra', 46) + def _reduce_5(val, _values, result) + val[0].each do |stmt| if stmt.is_a?(AST::TopLevelConstruct) error "Classes, definitions, and nodes may only appear at toplevel or inside other classes", \ :line => stmt.context[:line], :file => stmt.context[:file] end end result = val[0] - result + + result end .,., - # reduce 6 omitted +# reduce 6 omitted + +# reduce 7 omitted - # reduce 7 omitted +# reduce 8 omitted - # reduce 8 omitted +# reduce 9 omitted - # reduce 9 omitted +# reduce 10 omitted - # reduce 10 omitted +# reduce 11 omitted - # reduce 11 omitted +# reduce 12 omitted - # reduce 12 omitted +# reduce 13 omitted - # reduce 13 omitted +# reduce 14 omitted - # reduce 14 omitted +# reduce 15 omitted - # reduce 15 omitted +# reduce 16 omitted - # reduce 16 omitted +# reduce 17 omitted - # reduce 17 omitted +# reduce 18 omitted - # reduce 18 omitted +# reduce 19 omitted - # reduce 19 omitted +module_eval(<<'.,.,', 'grammar.ra', 72) + def _reduce_20(val, _values, result) + result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context) -module_eval <<'.,.,', 'grammar.ra', 74 - def _reduce_20( val, _values, result ) - result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context) - result + result end .,., -module_eval <<'.,.,', 'grammar.ra', 77 - def _reduce_21( val, _values, result ) - result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context) - result +module_eval(<<'.,.,', 'grammar.ra', 75) + def _reduce_21(val, _values, result) + result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context) + + result end .,., - # reduce 22 omitted +# reduce 22 omitted - # reduce 23 omitted +# reduce 23 omitted - # reduce 24 omitted +# reduce 24 omitted - # reduce 25 omitted +# reduce 25 omitted - # reduce 26 omitted +# reduce 26 omitted - # reduce 27 omitted +# reduce 27 omitted - # reduce 28 omitted +# reduce 28 omitted -module_eval <<'.,.,', 'grammar.ra', 89 - def _reduce_29( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 83) + def _reduce_29(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => val[2], :ftype => :statement - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 96 - def _reduce_30( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 90) + def _reduce_30(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => val[2], :ftype => :statement - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 102 - def _reduce_31( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 96) + def _reduce_31(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => AST::ASTArray.new({}), :ftype => :statement - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 109 - def _reduce_32( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 103) + def _reduce_32(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => val[1], :ftype => :statement - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 110 - def _reduce_33( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 110) + def _reduce_33(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 111 - def _reduce_34( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 111) + def _reduce_34(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 116 - def _reduce_35( val, _values, result ) - val[0].push(val[2]) +module_eval(<<'.,.,', 'grammar.ra', 113) + def _reduce_35(val, _values, result) + val[0].push(val[2]) result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 120 - def _reduce_36( val, _values, result ) - val[0].push(val[2]) +module_eval(<<'.,.,', 'grammar.ra', 117) + def _reduce_36(val, _values, result) + val[0].push(val[2]) result = val[0] - result + + result end .,., - # reduce 37 omitted +# reduce 37 omitted - # reduce 38 omitted +# reduce 38 omitted - # reduce 39 omitted +# reduce 39 omitted - # reduce 40 omitted +# reduce 40 omitted - # reduce 41 omitted +# reduce 41 omitted - # reduce 42 omitted +# reduce 42 omitted - # reduce 43 omitted +# reduce 43 omitted - # reduce 44 omitted +# reduce 44 omitted -module_eval <<'.,.,', 'grammar.ra', 134 - def _reduce_45( val, _values, result ) - result = ast AST::Name, :value => val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 132) + def _reduce_45(val, _values, result) + result = ast AST::Name, :value => val[0][:value] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 139 - def _reduce_46( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 136) + def _reduce_46(val, _values, result) + @lexer.commentpop result = ast(AST::Resource, :type => val[0], :instances => val[2]) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 142 - def _reduce_47( val, _values, result ) - # This is a deprecated syntax. +module_eval(<<'.,.,', 'grammar.ra', 139) + def _reduce_47(val, _values, result) + # This is a deprecated syntax. error "All resource specifications require names" - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 146 - def _reduce_48( val, _values, result ) - # a defaults setting for a type +module_eval(<<'.,.,', 'grammar.ra', 142) + def _reduce_48(val, _values, result) + # a defaults setting for a type @lexer.commentpop result = ast(AST::ResourceDefaults, :type => val[0], :parameters => val[2]) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 152 - def _reduce_49( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 149) + def _reduce_49(val, _values, result) + @lexer.commentpop result = ast AST::ResourceOverride, :object => val[0], :parameters => val[2] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 171 - def _reduce_50( val, _values, result ) - type = val[0] +module_eval(<<'.,.,', 'grammar.ra', 156) + def _reduce_50(val, _values, result) + type = val[0] if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly] Puppet.warning addcontext("You cannot collect without storeconfigs being set") @@ -1369,27 +1378,28 @@ module_eval <<'.,.,', 'grammar.ra', 171 val[1].send(method, true) result = val[1] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 172 - def _reduce_51( val, _values, result ) - result = :virtual - result +module_eval(<<'.,.,', 'grammar.ra', 172) + def _reduce_51(val, _values, result) + result = :virtual + result end .,., -module_eval <<'.,.,', 'grammar.ra', 173 - def _reduce_52( val, _values, result ) - result = :exported - result +module_eval(<<'.,.,', 'grammar.ra', 173) + def _reduce_52(val, _values, result) + result = :exported + result end .,., -module_eval <<'.,.,', 'grammar.ra', 196 - def _reduce_53( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 178) + def _reduce_53(val, _values, result) + @lexer.commentpop Puppet.warning addcontext("Collection names must now be capitalized") if val[0] =~ /^[a-z]/ type = val[0].downcase args = {:type => type} @@ -1406,13 +1416,14 @@ module_eval <<'.,.,', 'grammar.ra', 196 end args[:override] = val[3] result = ast AST::Collection, args - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 215 - def _reduce_54( val, _values, result ) - if val[0] =~ /^[a-z]/ +module_eval(<<'.,.,', 'grammar.ra', 197) + def _reduce_54(val, _values, result) + if val[0] =~ /^[a-z]/ Puppet.warning addcontext("Collection names must now be capitalized") end type = val[0].downcase @@ -1429,377 +1440,404 @@ module_eval <<'.,.,', 'grammar.ra', 215 Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored") end result = ast AST::Collection, args - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 225 - def _reduce_55( val, _values, result ) - if val[1] +module_eval(<<'.,.,', 'grammar.ra', 218) + def _reduce_55(val, _values, result) + if val[1] result = val[1] result.form = :virtual else result = :virtual end - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 233 - def _reduce_56( val, _values, result ) - if val[1] +module_eval(<<'.,.,', 'grammar.ra', 226) + def _reduce_56(val, _values, result) + if val[1] result = val[1] result.form = :exported else result = :exported end - result + + result end .,., - # reduce 57 omitted +# reduce 57 omitted - # reduce 58 omitted +# reduce 58 omitted -module_eval <<'.,.,', 'grammar.ra', 241 - def _reduce_59( val, _values, result ) - result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 239) + def _reduce_59(val, _values, result) + result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2] + + result end .,., - # reduce 60 omitted +# reduce 60 omitted -module_eval <<'.,.,', 'grammar.ra', 247 - def _reduce_61( val, _values, result ) - result = val[1] +module_eval(<<'.,.,', 'grammar.ra', 244) + def _reduce_61(val, _values, result) + result = val[1] result.parens = true - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 248 - def _reduce_62( val, _values, result ) - result=val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 248) + def _reduce_62(val, _values, result) + result=val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 249 - def _reduce_63( val, _values, result ) - result=val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 249) + def _reduce_63(val, _values, result) + result=val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 256 - def _reduce_64( val, _values, result ) - result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2] +module_eval(<<'.,.,', 'grammar.ra', 252) + def _reduce_64(val, _values, result) + result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2] #result = ast AST::CollExpr #result.push *val - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 261 - def _reduce_65( val, _values, result ) - result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2] +module_eval(<<'.,.,', 'grammar.ra', 257) + def _reduce_65(val, _values, result) + result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2] #result = ast AST::CollExpr #result.push *val - result + + result end .,., - # reduce 66 omitted +# reduce 66 omitted - # reduce 67 omitted +# reduce 67 omitted -module_eval <<'.,.,', 'grammar.ra', 268 - def _reduce_68( val, _values, result ) - result = ast AST::ResourceInstance, :title => val[0], :parameters => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 266) + def _reduce_68(val, _values, result) + result = ast AST::ResourceInstance, :title => val[0], :parameters => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 269 - def _reduce_69( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 269) + def _reduce_69(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 274 - def _reduce_70( val, _values, result ) - val[0].push val[2] +module_eval(<<'.,.,', 'grammar.ra', 271) + def _reduce_70(val, _values, result) + val[0].push val[2] result = val[0] - result + + result end .,., - # reduce 71 omitted +# reduce 71 omitted - # reduce 72 omitted +# reduce 72 omitted -module_eval <<'.,.,', 'grammar.ra', 281 - def _reduce_73( val, _values, result ) - result = ast AST::Undef, :value => :undef - result +module_eval(<<'.,.,', 'grammar.ra', 279) + def _reduce_73(val, _values, result) + result = ast AST::Undef, :value => :undef + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 285 - def _reduce_74( val, _values, result ) - result = ast AST::Name, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 283) + def _reduce_74(val, _values, result) + result = ast AST::Name, :value => val[0][:value], :line => val[0][:line] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 289 - def _reduce_75( val, _values, result ) - result = ast AST::Type, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 287) + def _reduce_75(val, _values, result) + result = ast AST::Type, :value => val[0][:value], :line => val[0][:line] + + result end .,., - # reduce 76 omitted +# reduce 76 omitted - # reduce 77 omitted +# reduce 77 omitted - # reduce 78 omitted +# reduce 78 omitted - # reduce 79 omitted +# reduce 79 omitted - # reduce 80 omitted +# reduce 80 omitted - # reduce 81 omitted +# reduce 81 omitted - # reduce 82 omitted +# reduce 82 omitted -module_eval <<'.,.,', 'grammar.ra', 304 - def _reduce_83( val, _values, result ) - raise Puppet::ParseError, "Cannot assign to variables in other namespaces" if val[0][:value] =~ /::/ +module_eval(<<'.,.,', 'grammar.ra', 299) + def _reduce_83(val, _values, result) + raise Puppet::ParseError, "Cannot assign to variables in other namespaces" if val[0][:value] =~ /::/ # this is distinct from referencing a variable variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line] result = ast AST::VarDef, :name => variable, :value => val[2], :line => val[0][:line] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 307 - def _reduce_84( val, _values, result ) - result = ast AST::VarDef, :name => val[0], :value => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 305) + def _reduce_84(val, _values, result) + result = ast AST::VarDef, :name => val[0], :value => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 312 - def _reduce_85( val, _values, result ) - variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line] +module_eval(<<'.,.,', 'grammar.ra', 309) + def _reduce_85(val, _values, result) + variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line] result = ast AST::VarDef, :name => variable, :value => val[2], :append => true, :line => val[0][:line] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 317 - def _reduce_86( val, _values, result ) - result = ast AST::ASTArray - result +module_eval(<<'.,.,', 'grammar.ra', 315) + def _reduce_86(val, _values, result) + result = ast AST::ASTArray + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 317 - def _reduce_87( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 317) + def _reduce_87(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 322 - def _reduce_88( val, _values, result ) - val[0].push(val[2]) +module_eval(<<'.,.,', 'grammar.ra', 319) + def _reduce_88(val, _values, result) + val[0].push(val[2]) result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 326 - def _reduce_89( val, _values, result ) - result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 324) + def _reduce_89(val, _values, result) + result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 331 - def _reduce_90( val, _values, result ) - result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2], +module_eval(<<'.,.,', 'grammar.ra', 328) + def _reduce_90(val, _values, result) + result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2], :add => true - result + + result end .,., - # reduce 91 omitted +# reduce 91 omitted + +# reduce 92 omitted - # reduce 92 omitted +module_eval(<<'.,.,', 'grammar.ra', 337) + def _reduce_93(val, _values, result) + result = ast AST::ASTArray -module_eval <<'.,.,', 'grammar.ra', 339 - def _reduce_93( val, _values, result ) - result = ast AST::ASTArray - result + result end .,., -module_eval <<'.,.,', 'grammar.ra', 339 - def _reduce_94( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 339) + def _reduce_94(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 344 - def _reduce_95( val, _values, result ) - val[0].push(val[2]) +module_eval(<<'.,.,', 'grammar.ra', 341) + def _reduce_95(val, _values, result) + val[0].push(val[2]) result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 345 - def _reduce_96( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 345) + def _reduce_96(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 346 - def _reduce_97( val, _values, result ) - result = val[0].push(val[2]) - result +module_eval(<<'.,.,', 'grammar.ra', 346) + def _reduce_97(val, _values, result) + result = val[0].push(val[2]) + result end .,., - # reduce 98 omitted +# reduce 98 omitted - # reduce 99 omitted +# reduce 99 omitted - # reduce 100 omitted +# reduce 100 omitted - # reduce 101 omitted +# reduce 101 omitted - # reduce 102 omitted +# reduce 102 omitted - # reduce 103 omitted +# reduce 103 omitted - # reduce 104 omitted +# reduce 104 omitted - # reduce 105 omitted +# reduce 105 omitted - # reduce 106 omitted +# reduce 106 omitted - # reduce 107 omitted +# reduce 107 omitted - # reduce 108 omitted +# reduce 108 omitted - # reduce 109 omitted +# reduce 109 omitted - # reduce 110 omitted +# reduce 110 omitted - # reduce 111 omitted +# reduce 111 omitted - # reduce 112 omitted +# reduce 112 omitted - # reduce 113 omitted +# reduce 113 omitted - # reduce 114 omitted +# reduce 114 omitted - # reduce 115 omitted +# reduce 115 omitted -module_eval <<'.,.,', 'grammar.ra', 375 - def _reduce_116( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 370) + def _reduce_116(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => val[2], :ftype => :rvalue - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 380 - def _reduce_117( val, _values, result ) - result = ast AST::Function, +module_eval(<<'.,.,', 'grammar.ra', 375) + def _reduce_117(val, _values, result) + result = ast AST::Function, :name => val[0][:value], :line => val[0][:line], :arguments => AST::ASTArray.new({}), :ftype => :rvalue - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 381 - def _reduce_118( val, _values, result ) - result = ast AST::String, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 381) + def _reduce_118(val, _values, result) + result = ast AST::String, :value => val[0][:value], :line => val[0][:line] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 382 - def _reduce_119( val, _values, result ) - result = ast AST::Concat, :value => [ast(AST::String,val[0])]+val[1], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 382) + def _reduce_119(val, _values, result) + result = ast AST::Concat, :value => [ast(AST::String,val[0])]+val[1], :line => val[0][:line] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 384 - def _reduce_120( val, _values, result ) - result = [val[0]] + val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 384) + def _reduce_120(val, _values, result) + result = [val[0]] + val[1] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 386 - def _reduce_121( val, _values, result ) - result = [ast(AST::String,val[0])] - result +module_eval(<<'.,.,', 'grammar.ra', 386) + def _reduce_121(val, _values, result) + result = [ast(AST::String,val[0])] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 387 - def _reduce_122( val, _values, result ) - result = [ast(AST::String,val[0])] + val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 387) + def _reduce_122(val, _values, result) + result = [ast(AST::String,val[0])] + val[1] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 392 - def _reduce_123( val, _values, result ) - result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 390) + def _reduce_123(val, _values, result) + result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 397 - def _reduce_124( val, _values, result ) - Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized") +module_eval(<<'.,.,', 'grammar.ra', 394) + def _reduce_124(val, _values, result) + Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized") result = ast AST::ResourceReference, :type => val[0][:value], :line => val[0][:line], :title => val[2] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 399 - def _reduce_125( val, _values, result ) - result = ast AST::ResourceReference, :type => val[0], :title => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 397) + def _reduce_125(val, _values, result) + result = ast AST::ResourceReference, :type => val[0], :title => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 403 - def _reduce_126( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 401) + def _reduce_126(val, _values, result) + result = val[1] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 415 - def _reduce_127( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 405) + def _reduce_127(val, _values, result) + @lexer.commentpop args = { :test => val[0], :statements => val[2] @@ -1808,13 +1846,14 @@ module_eval <<'.,.,', 'grammar.ra', 415 args[:else] = val[4] if val[4] result = ast AST::IfStatement, args - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 426 - def _reduce_128( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 416) + def _reduce_128(val, _values, result) + @lexer.commentpop args = { :test => val[0], :statements => ast(AST::Nop) @@ -1823,211 +1862,238 @@ module_eval <<'.,.,', 'grammar.ra', 426 args[:else] = val[3] if val[3] result = ast AST::IfStatement, args - result + + result end .,., - # reduce 129 omitted +# reduce 129 omitted -module_eval <<'.,.,', 'grammar.ra', 431 - def _reduce_130( val, _values, result ) - result = ast AST::Else, :statements => val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 429) + def _reduce_130(val, _values, result) + result = ast AST::Else, :statements => val[1] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 435 - def _reduce_131( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 432) + def _reduce_131(val, _values, result) + @lexer.commentpop result = ast AST::Else, :statements => val[2] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 439 - def _reduce_132( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 436) + def _reduce_132(val, _values, result) + @lexer.commentpop result = ast AST::Else, :statements => ast(AST::Nop) - result + + result end .,., - # reduce 133 omitted +# reduce 133 omitted -module_eval <<'.,.,', 'grammar.ra', 456 - def _reduce_134( val, _values, result ) - result = ast AST::InOperator, :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 454) + def _reduce_134(val, _values, result) + result = ast AST::InOperator, :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 459 - def _reduce_135( val, _values, result ) - result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 457) + def _reduce_135(val, _values, result) + result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 462 - def _reduce_136( val, _values, result ) - result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 460) + def _reduce_136(val, _values, result) + result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 465 - def _reduce_137( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 463) + def _reduce_137(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 468 - def _reduce_138( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 466) + def _reduce_138(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 471 - def _reduce_139( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 469) + def _reduce_139(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 474 - def _reduce_140( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 472) + def _reduce_140(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 477 - def _reduce_141( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 475) + def _reduce_141(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 480 - def _reduce_142( val, _values, result ) - result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 478) + def _reduce_142(val, _values, result) + result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 483 - def _reduce_143( val, _values, result ) - result = ast AST::Minus, :value => val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 481) + def _reduce_143(val, _values, result) + result = ast AST::Minus, :value => val[1] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 486 - def _reduce_144( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 484) + def _reduce_144(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 489 - def _reduce_145( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 487) + def _reduce_145(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 492 - def _reduce_146( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 490) + def _reduce_146(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 495 - def _reduce_147( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 493) + def _reduce_147(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 498 - def _reduce_148( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 496) + def _reduce_148(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 501 - def _reduce_149( val, _values, result ) - result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 499) + def _reduce_149(val, _values, result) + result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 504 - def _reduce_150( val, _values, result ) - result = ast AST::Not, :value => val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 502) + def _reduce_150(val, _values, result) + result = ast AST::Not, :value => val[1] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 507 - def _reduce_151( val, _values, result ) - result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 505) + def _reduce_151(val, _values, result) + result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 510 - def _reduce_152( val, _values, result ) - result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 508) + def _reduce_152(val, _values, result) + result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 513 - def _reduce_153( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 511) + def _reduce_153(val, _values, result) + result = val[1] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 518 - def _reduce_154( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 515) + def _reduce_154(val, _values, result) + @lexer.commentpop result = ast AST::CaseStatement, :test => val[1], :options => val[3] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 519 - def _reduce_155( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 519) + def _reduce_155(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 524 - def _reduce_156( val, _values, result ) - val[0].push val[1] +module_eval(<<'.,.,', 'grammar.ra', 521) + def _reduce_156(val, _values, result) + val[0].push val[1] result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 529 - def _reduce_157( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 526) + def _reduce_157(val, _values, result) + @lexer.commentpop result = ast AST::CaseOpt, :value => val[0], :statements => val[3] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 538 - def _reduce_158( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 529) + def _reduce_158(val, _values, result) + @lexer.commentpop result = ast( AST::CaseOpt, @@ -2035,479 +2101,516 @@ module_eval <<'.,.,', 'grammar.ra', 538 :statements => ast(AST::ASTArray) ) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 539 - def _reduce_159( val, _values, result ) - result = aryfy(val[0]) - result +module_eval(<<'.,.,', 'grammar.ra', 539) + def _reduce_159(val, _values, result) + result = aryfy(val[0]) + result end .,., -module_eval <<'.,.,', 'grammar.ra', 544 - def _reduce_160( val, _values, result ) - val[0].push(val[2]) +module_eval(<<'.,.,', 'grammar.ra', 541) + def _reduce_160(val, _values, result) + val[0].push(val[2]) result = val[0] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 548 - def _reduce_161( val, _values, result ) - result = ast AST::Selector, :param => val[0], :values => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 546) + def _reduce_161(val, _values, result) + result = ast AST::Selector, :param => val[0], :values => val[2] + + result end .,., - # reduce 162 omitted +# reduce 162 omitted -module_eval <<'.,.,', 'grammar.ra', 554 - def _reduce_163( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 551) + def _reduce_163(val, _values, result) + @lexer.commentpop result = val[1] - result + + result end .,., - # reduce 164 omitted +# reduce 164 omitted -module_eval <<'.,.,', 'grammar.ra', 564 - def _reduce_165( val, _values, result ) - if val[0].instance_of?(AST::ASTArray) +module_eval(<<'.,.,', 'grammar.ra', 557) + def _reduce_165(val, _values, result) + if val[0].instance_of?(AST::ASTArray) val[0].push(val[2]) result = val[0] else result = ast AST::ASTArray, :children => [val[0],val[2]] end - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 568 - def _reduce_166( val, _values, result ) - result = ast AST::ResourceParam, :param => val[0], :value => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 566) + def _reduce_166(val, _values, result) + result = ast AST::ResourceParam, :param => val[0], :value => val[2] + + result end .,., - # reduce 167 omitted +# reduce 167 omitted + +# reduce 168 omitted - # reduce 168 omitted +# reduce 169 omitted - # reduce 169 omitted +# reduce 170 omitted - # reduce 170 omitted +# reduce 171 omitted - # reduce 171 omitted +# reduce 172 omitted - # reduce 172 omitted +# reduce 173 omitted - # reduce 173 omitted +# reduce 174 omitted -module_eval <<'.,.,', 'grammar.ra', 579 - def _reduce_174( val, _values, result ) - result = ast AST::Default, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 578) + def _reduce_175(val, _values, result) + result = ast AST::Default, :value => val[0][:value], :line => val[0][:line] + + result end .,., - # reduce 175 omitted +# reduce 176 omitted -module_eval <<'.,.,', 'grammar.ra', 582 - def _reduce_176( val, _values, result ) - result = [val[0][:value]] - result +module_eval(<<'.,.,', 'grammar.ra', 583) + def _reduce_177(val, _values, result) + result = [val[0][:value]] + result end .,., - # reduce 177 omitted +# reduce 178 omitted -module_eval <<'.,.,', 'grammar.ra', 584 - def _reduce_178( val, _values, result ) - result = val[0] += val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 585) + def _reduce_179(val, _values, result) + result = val[0] += val[2] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 593 - def _reduce_179( val, _values, result ) - val[1].each do |file| +module_eval(<<'.,.,', 'grammar.ra', 588) + def _reduce_180(val, _values, result) + val[1].each do |file| import(file) end result = nil - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 605 - def _reduce_180( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 598) + def _reduce_181(val, _values, result) + @lexer.commentpop result = Puppet::Parser::AST::Definition.new(classname(val[1]), ast_context(true).merge(:arguments => val[2], :code => val[4], :line => val[0][:line])) @lexer.indefine = false #} | DEFINE NAME argumentlist parent LBRACE RBRACE { - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 610 - def _reduce_181( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 606) + def _reduce_182(val, _values, result) + @lexer.commentpop result = Puppet::Parser::AST::Definition.new(classname(val[1]), ast_context(true).merge(:arguments => val[2], :line => val[0][:line])) @lexer.indefine = false - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 620 - def _reduce_182( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 614) + def _reduce_183(val, _values, result) + @lexer.commentpop # Our class gets defined in the parent namespace, not our own. @lexer.namepop result = Puppet::Parser::AST::Hostclass.new(classname(val[1]), ast_context(true).merge(:arguments => val[2], :parent => val[3], :code => val[5], :line => val[0][:line])) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 627 - def _reduce_183( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 621) + def _reduce_184(val, _values, result) + @lexer.commentpop # Our class gets defined in the parent namespace, not our own. @lexer.namepop result = Puppet::Parser::AST::Hostclass.new(classname(val[1]), ast_context(true).merge(:arguments => val[2], :parent => val[3], :line => val[0][:line])) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 634 - def _reduce_184( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 630) + def _reduce_185(val, _values, result) + @lexer.commentpop result = Puppet::Parser::AST::Node.new(val[1], ast_context(true).merge(:parent => val[2], :code => val[4], :line => val[0][:line])) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 637 - def _reduce_185( val, _values, result ) - @lexer.commentpop +module_eval(<<'.,.,', 'grammar.ra', 635) + def _reduce_186(val, _values, result) + @lexer.commentpop result = Puppet::Parser::AST::Node.new(val[1], ast_context(true).merge(:parent => val[2], :line => val[0][:line])) - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 638 - def _reduce_186( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 639) + def _reduce_187(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 640 - def _reduce_187( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 641) + def _reduce_188(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 641 - def _reduce_188( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 642) + def _reduce_189(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 642 - def _reduce_189( val, _values, result ) - result = "class" - result +module_eval(<<'.,.,', 'grammar.ra', 643) + def _reduce_190(val, _values, result) + result = "class" + result end .,., -module_eval <<'.,.,', 'grammar.ra', 649 - def _reduce_190( val, _values, result ) - result = [result] - result +module_eval(<<'.,.,', 'grammar.ra', 648) + def _reduce_191(val, _values, result) + result = [result] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 653 - def _reduce_191( val, _values, result ) - result = val[0] +module_eval(<<'.,.,', 'grammar.ra', 651) + def _reduce_192(val, _values, result) + result = val[0] result << val[2] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 657 - def _reduce_192( val, _values, result ) - result = ast AST::HostName, :value => val[0] - result +module_eval(<<'.,.,', 'grammar.ra', 656) + def _reduce_193(val, _values, result) + result = ast AST::HostName, :value => val[0] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 658 - def _reduce_193( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 659) + def _reduce_194(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 659 - def _reduce_194( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 660) + def _reduce_195(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 660 - def _reduce_195( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 661) + def _reduce_196(val, _values, result) + result = val[0][:value] + result end .,., - # reduce 196 omitted +# reduce 197 omitted -module_eval <<'.,.,', 'grammar.ra', 666 - def _reduce_197( val, _values, result ) - result = nil - result +module_eval(<<'.,.,', 'grammar.ra', 665) + def _reduce_198(val, _values, result) + result = nil + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 670 - def _reduce_198( val, _values, result ) - result = ast AST::ASTArray, :children => [] - result +module_eval(<<'.,.,', 'grammar.ra', 669) + def _reduce_199(val, _values, result) + result = ast AST::ASTArray, :children => [] + + result end .,., - # reduce 199 omitted +# reduce 200 omitted + +module_eval(<<'.,.,', 'grammar.ra', 674) + def _reduce_201(val, _values, result) + result = nil -module_eval <<'.,.,', 'grammar.ra', 675 - def _reduce_200( val, _values, result ) - result = nil - result + result end .,., -module_eval <<'.,.,', 'grammar.ra', 679 - def _reduce_201( val, _values, result ) - result = val[1] +module_eval(<<'.,.,', 'grammar.ra', 677) + def _reduce_202(val, _values, result) + result = val[1] result = [result] unless result[0].is_a?(Array) - result + + result end .,., - # reduce 202 omitted +# reduce 203 omitted -module_eval <<'.,.,', 'grammar.ra', 686 - def _reduce_203( val, _values, result ) - result = val[0] +module_eval(<<'.,.,', 'grammar.ra', 683) + def _reduce_204(val, _values, result) + result = val[0] result = [result] unless result[0].is_a?(Array) result << val[2] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 691 - def _reduce_204( val, _values, result ) - Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") +module_eval(<<'.,.,', 'grammar.ra', 689) + def _reduce_205(val, _values, result) + Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0][:value], val[2]] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 695 - def _reduce_205( val, _values, result ) - Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") +module_eval(<<'.,.,', 'grammar.ra', 693) + def _reduce_206(val, _values, result) + Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype") result = [val[0][:value]] - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 697 - def _reduce_206( val, _values, result ) - result = [val[0][:value], val[2]] - result +module_eval(<<'.,.,', 'grammar.ra', 696) + def _reduce_207(val, _values, result) + result = [val[0][:value], val[2]] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 699 - def _reduce_207( val, _values, result ) - result = [val[0][:value]] - result +module_eval(<<'.,.,', 'grammar.ra', 698) + def _reduce_208(val, _values, result) + result = [val[0][:value]] + + result end .,., - # reduce 208 omitted +# reduce 209 omitted -module_eval <<'.,.,', 'grammar.ra', 704 - def _reduce_209( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 703) + def _reduce_210(val, _values, result) + result = val[1] + + result end .,., - # reduce 210 omitted +# reduce 211 omitted -module_eval <<'.,.,', 'grammar.ra', 709 - def _reduce_211( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 708) + def _reduce_212(val, _values, result) + result = val[1] + + result end .,., - # reduce 212 omitted +# reduce 213 omitted - # reduce 213 omitted +# reduce 214 omitted -module_eval <<'.,.,', 'grammar.ra', 715 - def _reduce_214( val, _values, result ) - result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line] - result +module_eval(<<'.,.,', 'grammar.ra', 714) + def _reduce_215(val, _values, result) + result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 716 - def _reduce_215( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 717) + def _reduce_216(val, _values, result) + result = val[1] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 717 - def _reduce_216( val, _values, result ) - result = val[1] - result +module_eval(<<'.,.,', 'grammar.ra', 718) + def _reduce_217(val, _values, result) + result = val[1] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 718 - def _reduce_217( val, _values, result ) - result = ast AST::ASTArray - result +module_eval(<<'.,.,', 'grammar.ra', 719) + def _reduce_218(val, _values, result) + result = ast AST::ASTArray + result end .,., - # reduce 218 omitted +# reduce 219 omitted - # reduce 219 omitted +# reduce 220 omitted - # reduce 220 omitted +# reduce 221 omitted -module_eval <<'.,.,', 'grammar.ra', 724 - def _reduce_221( val, _values, result ) - result = nil - result +module_eval(<<'.,.,', 'grammar.ra', 725) + def _reduce_222(val, _values, result) + result = nil + result end .,., -module_eval <<'.,.,', 'grammar.ra', 729 - def _reduce_222( val, _values, result ) - result = ast AST::Regex, :value => val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 728) + def _reduce_223(val, _values, result) + result = ast AST::Regex, :value => val[0][:value] + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 737 - def _reduce_223( val, _values, result ) - if val[1].instance_of?(AST::ASTHash) +module_eval(<<'.,.,', 'grammar.ra', 732) + def _reduce_224(val, _values, result) + if val[1].instance_of?(AST::ASTHash) result = val[1] else result = ast AST::ASTHash, { :value => val[1] } end - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 744 - def _reduce_224( val, _values, result ) - if val[1].instance_of?(AST::ASTHash) +module_eval(<<'.,.,', 'grammar.ra', 739) + def _reduce_225(val, _values, result) + if val[1].instance_of?(AST::ASTHash) result = val[1] else result = ast AST::ASTHash, { :value => val[1] } end - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 746 - def _reduce_225( val, _values, result ) - result = ast AST::ASTHash - result +module_eval(<<'.,.,', 'grammar.ra', 745) + def _reduce_226(val, _values, result) + result = ast AST::ASTHash + + result end .,., - # reduce 226 omitted +# reduce 227 omitted -module_eval <<'.,.,', 'grammar.ra', 756 - def _reduce_227( val, _values, result ) - if val[0].instance_of?(AST::ASTHash) +module_eval(<<'.,.,', 'grammar.ra', 750) + def _reduce_228(val, _values, result) + if val[0].instance_of?(AST::ASTHash) result = val[0].merge(val[2]) else result = ast AST::ASTHash, :value => val[0] result.merge(val[2]) end - result + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 760 - def _reduce_228( val, _values, result ) - result = ast AST::ASTHash, { :value => { val[0] => val[2] } } - result +module_eval(<<'.,.,', 'grammar.ra', 759) + def _reduce_229(val, _values, result) + result = ast AST::ASTHash, { :value => { val[0] => val[2] } } + + result end .,., -module_eval <<'.,.,', 'grammar.ra', 761 - def _reduce_229( val, _values, result ) - result = val[0][:value] - result +module_eval(<<'.,.,', 'grammar.ra', 762) + def _reduce_230(val, _values, result) + result = val[0][:value] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 762 - def _reduce_230( val, _values, result ) - result = val[0] - result +module_eval(<<'.,.,', 'grammar.ra', 763) + def _reduce_231(val, _values, result) + result = val[0] + result end .,., -module_eval <<'.,.,', 'grammar.ra', 767 - def _reduce_231( val, _values, result ) - result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2] - result +module_eval(<<'.,.,', 'grammar.ra', 766) + def _reduce_232(val, _values, result) + result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2] + + result end .,., - # reduce 232 omitted +# reduce 233 omitted + +module_eval(<<'.,.,', 'grammar.ra', 771) + def _reduce_234(val, _values, result) + result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2] -module_eval <<'.,.,', 'grammar.ra', 772 - def _reduce_233( val, _values, result ) - result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2] - result + result end .,., - def _reduce_none( val, _values, result ) - result - end +def _reduce_none(val, _values, result) + val[0] +end end # class Parser - - end # module Parser - -end # module Puppet + end # module Parser + end # module Puppet diff --git a/lib/puppet/provider/computer/computer.rb b/lib/puppet/provider/computer/computer.rb index a6be6bdfe..dd055beb3 100644 --- a/lib/puppet/provider/computer/computer.rb +++ b/lib/puppet/provider/computer/computer.rb @@ -10,9 +10,7 @@ Puppet::Type.type(:computer).provide :directoryservice, :parent => Puppet::Provi domain, not in remote directories. If you wish to manage /etc/hosts on Mac OS X, then simply use the host - type as per other platforms. - - " + type as per other platforms." confine :operatingsystem => :darwin defaultfor :operatingsystem => :darwin diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb index c979f742f..65296eed2 100644 --- a/lib/puppet/provider/mount.rb +++ b/lib/puppet/provider/mount.rb @@ -14,8 +14,11 @@ module Puppet::Provider::Mount args << "-o" << self.options if self.options and self.options != :absent args << resource[:name] - flush if respond_to?(:flush) mountcmd(*args) + case get(:ensure) + when :absent; set(:ensure => :ghost) + when :unmounted; set(:ensure => :mounted) + end end def remount @@ -30,24 +33,17 @@ module Puppet::Provider::Mount # This only works when the mount point is synced to the fstab. def unmount - umount resource[:name] + umount(resource[:name]) + + # Update property hash for future queries (e.g. refresh is called) + case get(:ensure) + when :mounted; set(:ensure => :unmounted) + when :ghost; set(:ensure => :absent) + end end # Is the mount currently mounted? def mounted? - platform = Facter.value("operatingsystem") - name = resource[:name] - mounts = mountcmd.split("\n").find do |line| - case platform - when "Darwin" - line =~ / on #{name} / or line =~ %r{ on /private/var/automount#{name}} - when "Solaris", "HP-UX" - line =~ /^#{name} on / - when "AIX" - line.split(/\s+/)[1] == name - else - line =~ / on #{name} / - end - end + [:mounted, :ghost].include?(get(:ensure)) end end diff --git a/lib/puppet/provider/mount/parsed.rb b/lib/puppet/provider/mount/parsed.rb index 82d1628bd..11c5e21a9 100755 --- a/lib/puppet/provider/mount/parsed.rb +++ b/lib/puppet/provider/mount/parsed.rb @@ -8,21 +8,17 @@ else fstab = "/etc/fstab" end - - Puppet::Type.type(:mount).provide( - :parsed, +Puppet::Type.type(:mount).provide( + :parsed, :parent => Puppet::Provider::ParsedFile, :default_target => fstab, - :filetype => :flat ) do include Puppet::Provider::Mount - #confine :exists => fstab commands :mountcmd => "mount", :umount => "umount" - @platform = Facter["operatingsystem"].value - case @platform + case Facter["operatingsystem"] when "Solaris" @fields = [:device, :blockdevice, :name, :fstype, :pass, :atboot, :options] else @@ -43,5 +39,68 @@ end record_line self.name, :fields => @fields, :separator => /\s+/, :joiner => "\t", :optional => optional_fields -end + # Every entry in fstab is :unmounted until we can prove different + def self.prefetch_hook(target_records) + target_records.collect do |record| + record[:ensure] = :unmounted if record[:record_type] == :parsed + record + end + end + + def self.prefetch(resources = nil) + # Get providers for all resources the user defined and that match + # a record in /etc/fstab. + super + # We need to do two things now: + # - Update ensure from :unmounted to :mounted if the resource is mounted + # - Check for mounted devices that are not in fstab and + # set ensure to :ghost (if the user wants to add an entry + # to fstab we need to know if the device was mounted before) + mountinstances.each do |hash| + if mount = resources[hash[:name]] + case mount.provider.get(:ensure) + when :absent # Mount not in fstab + mount.provider.set(:ensure => :ghost) + when :unmounted # Mount in fstab + mount.provider.set(:ensure => :mounted) + end + end + end + end + def self.mountinstances + # XXX: Will not work for mount points that have spaces in path (does fstab support this anyways?) + regex = case Facter.value(:operatingsystem) + when "Darwin" + / on (?:\/private\/var\/automount)?(\S*)/ + when "Solaris", "HP-UX" + /^(\S*) on / + when "AIX" + /^(?:\S*\s+\S+\s+)(\S+)/ + else + / on (\S*)/ + end + instances = [] + mount_output = mountcmd.split("\n") + if mount_output.length >= 2 and mount_output[1] =~ /^[- \t]*$/ + # On some OSes (e.g. AIX) mount output begins with a header line + # followed by a line consisting of dashes and whitespace. + # Discard these two lines. + mount_output[0..1] = [] + end + mount_output.each do |line| + if match = regex.match(line) and name = match.captures.first + instances << {:name => name, :mounted => :yes} # Only :name is important here + else + raise Puppet::Error, "Could not understand line #{line} from mount output" + end + end + instances + end + + def flush + needs_mount = @property_hash.delete(:needs_mount) + super + mount if needs_mount + end +end diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb index ffd36e59f..75a215f4b 100755 --- a/lib/puppet/provider/parsedfile.rb +++ b/lib/puppet/provider/parsedfile.rb @@ -334,7 +334,9 @@ class Puppet::Provider::ParsedFile < Puppet::Provider @property_hash[:target] = @resource.should(:target) || self.class.default_target self.class.modified(@property_hash[:target]) end - @property_hash[:name] ||= @resource.name + @resource.class.key_attributes.each do |attr| + @property_hash[attr] ||= @resource[attr] + end self.class.flush(@property_hash) diff --git a/lib/puppet/provider/service/daemontools.rb b/lib/puppet/provider/service/daemontools.rb index 65abf7728..bbb962a71 100644 --- a/lib/puppet/provider/service/daemontools.rb +++ b/lib/puppet/provider/service/daemontools.rb @@ -19,10 +19,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do or this can be overriden in the service resource parameters:: - service { - \"myservice\": - provider => \"daemontools\", path => \"/path/to/daemons\"; - } + service { \"myservice\": + provider => \"daemontools\", + path => \"/path/to/daemons\", + } This provider supports out of the box: @@ -31,10 +31,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do * restart * status - If a service has ensure => \"running\", it will link /path/to/daemon to + If a service has `ensure => \"running\"`, it will link /path/to/daemon to /path/to/service, which will automatically enable the service. - If a service has ensure => \"stopped\", it will only down the service, not + If a service has `ensure => \"stopped\"`, it will only down the service, not remove the /path/to/service link. " diff --git a/lib/puppet/provider/service/gentoo.rb b/lib/puppet/provider/service/gentoo.rb index 382c74267..20f5d77e6 100644 --- a/lib/puppet/provider/service/gentoo.rb +++ b/lib/puppet/provider/service/gentoo.rb @@ -48,5 +48,3 @@ Puppet::Type.type(:service).provide :gentoo, :parent => :init do raise Puppet::Error, "Could not enable #{self.name}: #{output}" end end - -# $Id $ diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb index 1632edabf..07c549a8b 100644 --- a/lib/puppet/provider/service/launchd.rb +++ b/lib/puppet/provider/service/launchd.rb @@ -3,33 +3,36 @@ require 'facter/util/plist' Puppet::Type.type(:service).provide :launchd, :parent => :base do desc "launchd service management framework. - This provider manages launchd jobs, the default service framework for - Mac OS X, that has also been open sourced by Apple for possible use on - other platforms. + This provider manages jobs with launchd, which is the default service framework for + Mac OS X and is potentially available for use on other platforms. See: + * http://developer.apple.com/macosx/launchd.html * http://launchd.macosforge.org/ This provider reads plists out of the following directories: + * /System/Library/LaunchDaemons * /System/Library/LaunchAgents * /Library/LaunchDaemons * /Library/LaunchAgents - and builds up a list of services based upon each plists \"Label\" entry. + ...and builds up a list of services based upon each plist's \"Label\" entry. This provider supports: + * ensure => running/stopped, * enable => true/false * status * restart Here is how the Puppet states correspond to launchd states: - * stopped => job unloaded - * started => job loaded - * enabled => 'Disable' removed from job plist file - * disabled => 'Disable' added to job plist file + + * stopped --- job unloaded + * started --- job loaded + * enabled --- 'Disable' removed from job plist file + * disabled --- 'Disable' added to job plist file Note that this allows you to do something launchctl can't do, which is to be in a state of \"stopped/enabled\ or \"running/disabled\". diff --git a/lib/puppet/provider/service/runit.rb b/lib/puppet/provider/service/runit.rb index 0315b9597..736e3db71 100644 --- a/lib/puppet/provider/service/runit.rb +++ b/lib/puppet/provider/service/runit.rb @@ -18,10 +18,10 @@ Puppet::Type.type(:service).provide :runit, :parent => :daemontools do or this can be overriden in the service resource parameters:: - service { - \"myservice\": - provider => \"runit\", path => \"/path/to/daemons\"; - } + service { \"myservice\": + provider => \"runit\", + path => \"/path/to/daemons\", + } This provider supports out of the box: diff --git a/lib/puppet/provider/user/useradd.rb b/lib/puppet/provider/user/useradd.rb index ba406cc63..b87971738 100644 --- a/lib/puppet/provider/user/useradd.rb +++ b/lib/puppet/provider/user/useradd.rb @@ -19,7 +19,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ value !~ /\s/ end - has_features :manages_homedir, :allows_duplicates, :manages_expiry + has_features :manages_homedir, :allows_duplicates, :manages_expiry, :system_users has_features :manages_passwords, :manages_password_age if Puppet.features.libshadow? @@ -46,6 +46,10 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ cmd end + def check_system_users + @resource.system? ? ["-r"] : [] + end + def add_properties cmd = [] Puppet::Type.type(:user).validproperties.each do |property| @@ -66,6 +70,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ cmd += check_allow_dup cmd += check_manage_home cmd += check_manage_expiry + cmd += check_system_users cmd << @resource[:name] end diff --git a/lib/puppet/provider/zpool/solaris.rb b/lib/puppet/provider/zpool/solaris.rb index e597c2ae1..758ea618a 100644 --- a/lib/puppet/provider/zpool/solaris.rb +++ b/lib/puppet/provider/zpool/solaris.rb @@ -19,11 +19,13 @@ Puppet::Type.type(:zpool).provide(:solaris) do pool_array.reverse.each do |value| sym = nil case value - when "spares"; sym = :spare - when "logs"; sym = :log - when "mirror", "raidz1", "raidz2" - sym = value == "mirror" ? :mirror : :raidz - pool[:raid_parity] = "raidz2" if value == "raidz2" + when "spares"; + sym = :spare + when "logs"; + sym = :log + when /^mirror|^raidz1|^raidz2/; + sym = value =~ /^mirror/ ? :mirror : :raidz + pool[:raid_parity] = "raidz2" if value =~ /^raidz2/ else tmp << value sym = :disk if value == pool_array.first diff --git a/lib/puppet/rails/database/004_add_inventory_service_tables.rb b/lib/puppet/rails/database/004_add_inventory_service_tables.rb new file mode 100644 index 000000000..6e6b28c0c --- /dev/null +++ b/lib/puppet/rails/database/004_add_inventory_service_tables.rb @@ -0,0 +1,36 @@ +class AddInventoryServiceTables < ActiveRecord::Migration + def self.up + unless ActiveRecord::Base.connection.tables.include?("inventory_nodes") + create_table :inventory_nodes do |t| + t.column :name, :string, :null => false + t.column :timestamp, :datetime, :null => false + t.column :updated_at, :datetime + t.column :created_at, :datetime + end + + add_index :inventory_nodes, :name, :unique => true + end + + unless ActiveRecord::Base.connection.tables.include?("inventory_facts") + create_table :inventory_facts, :id => false do |t| + t.column :node_id, :integer, :null => false + t.column :name, :string, :null => false + t.column :value, :text, :null => false + end + + add_index :inventory_facts, [:node_id, :name], :unique => true + end + end + + def self.down + unless ActiveRecord::Base.connection.tables.include?("inventory_nodes") + remove_index :inventory_nodes, :name + drop_table :inventory_nodes + end + + if ActiveRecord::Base.connection.tables.include?("inventory_facts") + remove_index :inventory_facts, [:node_id, :name] + drop_table :inventory_facts + end + end +end diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb index 8b389d773..7b75f4216 100644 --- a/lib/puppet/rails/database/schema.rb +++ b/lib/puppet/rails/database/schema.rb @@ -103,6 +103,23 @@ class Puppet::Rails::Schema t.column :created_at, :datetime end add_index :param_names, :name + + create_table :inventory_nodes do |t| + t.column :name, :string, :null => false + t.column :timestamp, :datetime, :null => false + t.column :updated_at, :datetime + t.column :created_at, :datetime + end + + add_index :inventory_nodes, :name, :unique => true + + create_table :inventory_facts, :id => false do |t| + t.column :node_id, :integer, :null => false + t.column :name, :string, :null => false + t.column :value, :text, :null => false + end + + add_index :inventory_facts, [:node_id, :name], :unique => true end end ensure diff --git a/lib/puppet/rails/fact_name.rb b/lib/puppet/rails/fact_name.rb index fb40ec48f..4273399e5 100644 --- a/lib/puppet/rails/fact_name.rb +++ b/lib/puppet/rails/fact_name.rb @@ -3,5 +3,3 @@ require 'puppet/rails/fact_value' class Puppet::Rails::FactName < ActiveRecord::Base has_many :fact_values, :dependent => :destroy end - -# $Id: fact_name.rb 1952 2006-12-19 05:47:57Z luke $ diff --git a/lib/puppet/rails/fact_value.rb b/lib/puppet/rails/fact_value.rb index 45a88b2dc..9fd81ae1c 100644 --- a/lib/puppet/rails/fact_value.rb +++ b/lib/puppet/rails/fact_value.rb @@ -6,5 +6,3 @@ class Puppet::Rails::FactValue < ActiveRecord::Base "#{self.fact_name.name}" end end - -# $Id: fact_value.rb 1952 2006-12-19 05:47:57Z luke $ diff --git a/lib/puppet/rails/inventory_fact.rb b/lib/puppet/rails/inventory_fact.rb new file mode 100644 index 000000000..aa6334eef --- /dev/null +++ b/lib/puppet/rails/inventory_fact.rb @@ -0,0 +1,5 @@ +require 'puppet/rails/inventory_node' + +class Puppet::Rails::InventoryFact < ::ActiveRecord::Base + belongs_to :node, :class_name => "Puppet::Rails::InventoryNode" +end diff --git a/lib/puppet/rails/inventory_node.rb b/lib/puppet/rails/inventory_node.rb new file mode 100644 index 000000000..52f8621a4 --- /dev/null +++ b/lib/puppet/rails/inventory_node.rb @@ -0,0 +1,25 @@ +require 'puppet/rails/inventory_fact' + +class Puppet::Rails::InventoryNode < ::ActiveRecord::Base + has_many :facts, :class_name => "Puppet::Rails::InventoryFact", :foreign_key => :node_id, :dependent => :delete_all + + named_scope :has_fact_with_value, lambda { |name,value| + { + :conditions => ["inventory_facts.name = ? AND inventory_facts.value = ?", name, value], + :joins => :facts + } + } + + named_scope :has_fact_without_value, lambda { |name,value| + { + :conditions => ["inventory_facts.name = ? AND inventory_facts.value != ?", name, value], + :joins => :facts + } + } + + def facts_to_hash + facts.inject({}) do |fact_hash,fact| + fact_hash.merge(fact.name => fact.value) + end + end +end diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb index c8ff145ba..6581427ff 100644 --- a/lib/puppet/reference/configuration.rb +++ b/lib/puppet/reference/configuration.rb @@ -122,7 +122,7 @@ likewise be redirected to a file: Puppet can also create user and group accounts for itself (one `puppet` group and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument: - $ puppet agent --mkusers + $ puppet master --mkusers ## Signals diff --git a/lib/puppet/reference/metaparameter.rb b/lib/puppet/reference/metaparameter.rb index c16a1d33a..3c4c08701 100644 --- a/lib/puppet/reference/metaparameter.rb +++ b/lib/puppet/reference/metaparameter.rb @@ -29,7 +29,7 @@ in your manifest, including defined components. params.sort { |a,b| a.to_s <=> b.to_s }.each { |param| - str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 4) + str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 3) } rescue => detail puts detail.backtrace diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb index 99a9fc177..625a263b3 100644 --- a/lib/puppet/reports/store.rb +++ b/lib/puppet/reports/store.rb @@ -15,7 +15,10 @@ Puppet::Reports.register_report(:store) do dir = File.join(Puppet[:reportdir], client) - Dir.mkdir(dir, 0750) unless FileTest.exists?(dir) + if ! FileTest.exists?(dir) + FileUtils.mkdir_p(dir) + FileUtils.chmod_R(0750, dir) + end # Now store the report. now = Time.now.gmtime diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index e832804f5..214516908 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -5,6 +5,11 @@ require 'puppet/util/pson' # The simplest resource class. Eventually it will function as the # base class for all resource-like behaviour. class Puppet::Resource + # This stub class is only needed for serialization compatibility with 0.25.x. + # Specifically, it exists to provide a compatibility API when using YAML + # serialized objects loaded from StoreConfigs. + Reference = Puppet::Resource + include Puppet::Util::Tagging require 'puppet/resource/type_collection_helper' @@ -87,7 +92,7 @@ class Puppet::Resource def yaml_property_munge(x) case x when Hash - x.inject({}) { |h,kv| + x.inject({}) { |h,kv| k,v = kv h[k] = self.class.value_to_pson_data(v) h @@ -104,7 +109,7 @@ class Puppet::Resource # be overridden at some point, but this works for now. %w{has_key? keys length delete empty? <<}.each do |method| define_method(method) do |*args| - @parameters.send(method, *args) + parameters.send(method, *args) end end @@ -112,13 +117,13 @@ class Puppet::Resource # to lower-case symbols. def []=(param, value) validate_parameter(param) if validate_parameters - @parameters[parameter_name(param)] = value + parameters[parameter_name(param)] = value end # Return a given parameter's value. Converts all passed names # to lower-case symbols. def [](param) - @parameters[parameter_name(param)] + parameters[parameter_name(param)] end def ==(other) @@ -140,11 +145,11 @@ class Puppet::Resource # Iterate over each param/value pair, as required for Enumerable. def each - @parameters.each { |p,v| yield p, v } + parameters.each { |p,v| yield p, v } end def include?(parameter) - super || @parameters.keys.include?( parameter_name(parameter) ) + super || parameters.keys.include?( parameter_name(parameter) ) end # These two methods are extracted into a Helper @@ -170,14 +175,6 @@ class Puppet::Resource end end - # This stub class is only needed for serialization compatibility with 0.25.x - class Reference - attr_accessor :type,:title - def initialize(type,title) - @type,@title = type,title - end - end - # Create our resource. def initialize(type, title = nil, attributes = {}) @parameters = {} @@ -204,7 +201,7 @@ class Puppet::Resource tag(self.type) tag(self.title) if valid_tag?(self.title) - @reference = Reference.new(@type,@title) # for serialization compatibility with 0.25.x + @reference = self # for serialization compatibility with 0.25.x if strict? and ! resource_type if @type == 'Class' raise ArgumentError, "Could not find declared class #{title}" @@ -234,7 +231,7 @@ class Puppet::Resource # Produce a simple hash of our parameters. def to_hash - parse_title.merge @parameters + parse_title.merge parameters end def to_s @@ -255,15 +252,26 @@ class Puppet::Resource # Convert our resource to Puppet code. def to_manifest - "%s { '%s':\n%s\n}" % [self.type.to_s.downcase, self.title, - @parameters.collect { |p, v| - if v.is_a? Array - " #{p} => [\'#{v.join("','")}\']" - else - " #{p} => \'#{v}\'" - end - }.join(",\n") - ] + # Collect list of attributes to align => and move ensure first + attr = parameters.keys + attr_max = attr.inject(0) { |max,k| k.to_s.length > max ? k.to_s.length : max } + + attr.sort! + if attr.first != :ensure && attr.include?(:ensure) + attr.delete(:ensure) + attr.unshift(:ensure) + end + + attributes = attr.collect { |k| + v = parameters[k] + if v.is_a? Array + " %-#{attr_max}s => %s,\n" % [ k, "[\'#{v.join("', '")}\']" ] + else + " %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ] + end + } + + "%s { '%s':\n%s}" % [self.type.to_s.downcase, self.title, attributes] end def to_ref @@ -422,4 +430,10 @@ class Puppet::Resource return { :name => title.to_s } end end + + def parameters + # @parameters could have been loaded from YAML, causing it to be nil (by + # bypassing initialize). + @parameters ||= {} + end end diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index 9d7f218a6..e39aa8770 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -1,6 +1,3 @@ -# Created by Luke A. Kanies on 2007-11-07. -# Copyright (c) 2007. All rights reserved. - require 'puppet/external/dot' require 'puppet/relationship' require 'set' @@ -92,36 +89,177 @@ class Puppet::SimpleGraph vertices end - # Provide a topological sort with cycle reporting - def topsort_with_cycles - degree = {} - zeros = [] - result = [] + # This is a simple implementation of Tarjan's algorithm to find strongly + # connected components in the graph; this is a fairly ugly implementation, + # because I can't just decorate the vertices themselves. + # + # This method has an unhealthy relationship with the find_cycles_in_graph + # method below, which contains the knowledge of how the state object is + # maintained. + def tarjan(root, s) + # initialize the recursion stack we use to work around the nasty lack of a + # decent Ruby stack. + recur = [{ :node => root }] + + while not recur.empty? do + frame = recur.last + vertex = frame[:node] + + case frame[:step] + when nil then + s[:index][vertex] = s[:number] + s[:lowlink][vertex] = s[:number] + s[:number] = s[:number] + 1 + + s[:stack].push(vertex) + s[:seen][vertex] = true + + frame[:children] = adjacent(vertex) + frame[:step] = :children + + when :children then + if frame[:children].length > 0 then + child = frame[:children].shift + if ! s[:index][child] then + # Never seen, need to recurse. + frame[:step] = :after_recursion + frame[:child] = child + recur.push({ :node => child }) + elsif s[:seen][child] then + s[:lowlink][vertex] = [s[:lowlink][vertex], s[:index][child]].min + end + else + if s[:lowlink][vertex] == s[:index][vertex] then + this_scc = [] + begin + top = s[:stack].pop + s[:seen][top] = false + this_scc << top + end until top == vertex + # NOTE: if we don't reverse we get the components in the opposite + # order to what a human being would expect; reverse should be an + # O(1) operation, without even copying, because we know the length + # of the source, but I worry that an implementation will get this + # wrong. Still, the worst case is O(n) for n vertices as we can't + # possibly put a vertex into two SCCs. + # + # Also, my feeling is that most implementations are going to do + # better with a reverse operation than a string of 'unshift' + # insertions at the head of the array; if they were going to mess + # up the performance of one, it would be unshift. + s[:scc] << this_scc.reverse + end + recur.pop # done with this node, finally. + end - # Collect each of our vertices, with the number of in-edges each has. - vertices.each do |v| - edges = @in_to[v].dup - zeros << v if edges.empty? - degree[v] = edges + when :after_recursion then + s[:lowlink][vertex] = [s[:lowlink][vertex], s[:lowlink][frame[:child]]].min + frame[:step] = :children + + else + fail "#{frame[:step]} is an unknown step" + end end + end - # Iterate over each 0-degree vertex, decrementing the degree of - # each of its out-edges. - while v = zeros.pop - result << v - @out_from[v].each { |v2,es| - degree[v2].delete(v) - zeros << v2 if degree[v2].empty? - } + # Find all cycles in the graph by detecting all the strongly connected + # components, then eliminating everything with a size of one as + # uninteresting - which it is, because it can't be a cycle. :) + # + # This has an unhealthy relationship with the 'tarjan' method above, which + # it uses to implement the detection of strongly connected components. + def find_cycles_in_graph + state = { + :number => 0, :index => {}, :lowlink => {}, :scc => [], + :stack => [], :seen => {} + } + + # we usually have a disconnected graph, must walk all possible roots + vertices.each do |vertex| + if ! state[:index][vertex] then + tarjan vertex, state + end end - # If we have any vertices left with non-zero in-degrees, then we've found a cycle. - if cycles = degree.values.reject { |ns| ns.empty? } and cycles.length > 0 - message = cycles.collect { |edges| '('+edges.collect { |e| e.to_s }.join(", ")+')' }.join(", ") - raise Puppet::Error, "Found dependency cycles in the following relationships: #{message}; try using the '--graph' option and open the '.dot' files in OmniGraffle or GraphViz" + state[:scc].select { |c| c.length > 1 } + end + + # Perform a BFS on the sub graph representing the cycle, with a view to + # generating a sufficient set of paths to report the cycle meaningfully, and + # ideally usefully, for the end user. + # + # BFS is preferred because it will generally report the shortest paths + # through the graph first, which are more likely to be interesting to the + # user. I think; it would be interesting to verify that. --daniel 2011-01-23 + def paths_in_cycle(cycle, max_paths = 1) + raise ArgumentError, "negative or zero max_paths" if max_paths < 1 + + # Calculate our filtered outbound vertex lists... + adj = {} + cycle.each do |vertex| + adj[vertex] = adjacent(vertex).select{|s| cycle.member? s} end - result + found = [] + + # frame struct is vertex, [path] + stack = [[cycle.first, []]] + while frame = stack.shift do + if frame[1].member?(frame[0]) then + found << frame[1] + [frame[0]] + break if found.length >= max_paths + else + adj[frame[0]].each do |to| + stack.push [to, frame[1] + [frame[0]]] + end + end + end + + return found + end + + def report_cycles_in_graph + cycles = find_cycles_in_graph + n = cycles.length # where is "pluralize"? --daniel 2011-01-22 + s = n == 1 ? '' : 's' + + message = "Found #{n} dependency cycle#{s}:\n" + cycles.each do |cycle| + paths = paths_in_cycle(cycle) + message += paths.map{ |path| '(' + path.join(" => ") + ')'}.join("\n") + "\n" + end + + if Puppet[:graph] then + filename = write_cycles_to_graph(cycles) + message += "Cycle graph written to #{filename}." + else + message += "Try the '--graph' option and opening the " + message += "resulting '.dot' file in OmniGraffle or GraphViz" + end + + raise Puppet::Error, message + end + + def write_cycles_to_graph(cycles) + # This does not use the DOT graph library, just writes the content + # directly. Given the complexity of this, there didn't seem much point + # using a heavy library to generate exactly the same content. --daniel 2011-01-27 + Puppet.settings.use(:graphing) + + graph = ["digraph Resource_Cycles {"] + graph << ' label = "Resource Cycles"' + + cycles.each do |cycle| + paths_in_cycle(cycle, 10).each do |path| + graph << path.map { |v| '"' + v.to_s.gsub(/"/, '\\"') + '"' }.join(" -> ") + end + end + + graph << '}' + + filename = File.join(Puppet[:graphdir], "cycles.dot") + File.open(filename, "w") { |f| f.puts graph } + return filename end # Provide a topological sort. @@ -141,14 +279,14 @@ class Puppet::SimpleGraph # each of its out-edges. while v = zeros.pop result << v - @out_from[v].each { |v2,es| + @out_from[v].each { |v2,es| zeros << v2 if (degree[v2] -= 1) == 0 } end # If we have any vertices left with non-zero in-degrees, then we've found a cycle. if cycles = degree.values.reject { |ns| ns == 0 } and cycles.length > 0 - topsort_with_cycles + report_cycles_in_graph end result diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index e03650b54..d24cc8554 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -200,7 +200,7 @@ class Type end def uniqueness_key - to_resource.uniqueness_key + self.class.key_attributes.sort_by { |attribute_name| attribute_name.to_s }.map{ |attribute_name| self[attribute_name] } end # Create a new parameter. Requires a block and a name, stores it in the @@ -382,8 +382,8 @@ class Type fail("Invalid parameter #{name}(#{name.inspect})") unless self.class.validattr?(name) - if name == :name - name = name_var + if name == :name && nv = name_var + name = nv end if obj = @parameters[name] @@ -403,8 +403,8 @@ class Type fail("Invalid parameter #{name}") unless self.class.validattr?(name) - if name == :name - name = name_var + if name == :name && nv = name_var + name = nv end raise Puppet::Error.new("Got nil value for #{name}") if value.nil? @@ -957,12 +957,25 @@ class Type end newmetaparam(:audit) do - desc "Audit specified attributes of resources over time, and report if any have changed. - This attribute can be used to track changes to any resource over time, and can - provide an audit trail of every change that happens on any given machine. - - Note that you cannot both audit and manage an attribute - managing it guarantees - the value, and any changes already get logged." + desc "Marks a subset of this resource's unmanaged attributes for auditing. Accepts an + attribute name or a list of attribute names. + + Auditing a resource attribute has two effects: First, whenever a catalog + is applied with puppet apply or puppet agent, Puppet will check whether + that attribute of the resource has been modified, comparing its current + value to the previous run; any change will be logged alongside any actions + performed by Puppet while applying the catalog. + + Secondly, marking a resource attribute for auditing will include that + attribute in inspection reports generated by puppet inspect; see the + puppet inspect documentation for more details. + + Managed attributes for a resource can also be audited, but note that + changes made by Puppet will be logged as additional modifications. (I.e. + if a user manually edits a file whose contents are audited and managed, + puppet agent's next two runs will both log an audit notice: the first run + will log the user's edit and then revert the file to the desired state, + and the second run will log the edit made by Puppet.)" validate do |list| list = Array(list).collect {|p| p.to_sym} diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb index d29bda648..a8fb1f15f 100644 --- a/lib/puppet/type/augeas.rb +++ b/lib/puppet/type/augeas.rb @@ -98,10 +98,10 @@ Puppet::Type.newtype(:augeas) do can be either a string which contains a command or an array of commands. Commands supported are: - set [PATH] [VALUE] Sets the value VALUE at loction PATH - rm [PATH] Removes the node at location PATH - remove [PATH] Synonym for rm - clear [PATH] Keeps the node at PATH, but removes the value. + set [PATH] [VALUE] Sets the value VALUE at loction PATH + rm [PATH] Removes the node at location PATH + remove [PATH] Synonym for rm + clear [PATH] Keeps the node at PATH, but removes the value. ins [LABEL] [WHERE] [PATH] Inserts an empty node LABEL either [WHERE={before|after}] PATH. insert [LABEL] [WHERE] [PATH] Synonym for ins diff --git a/lib/puppet/type/computer.rb b/lib/puppet/type/computer.rb index 89a0692bf..7a2c52d53 100644 --- a/lib/puppet/type/computer.rb +++ b/lib/puppet/type/computer.rb @@ -14,7 +14,11 @@ Puppet::Type.newtype(:computer) do type as per other platforms. This type primarily exists to create localhost Computer objects that MCX - policy can then be attached to." + policy can then be attached to. + + **Autorequires:** If Puppet is managing the plist file representing a + Computer object (located at `/var/db/dslocal/nodes/Default/computers/{name}.plist`), + the Computer resource will autorequire it." # ensurable diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index daa49e223..ae579502a 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -22,7 +22,9 @@ module Puppet to native Puppet types as quickly as possible. If you find that you are doing a lot of work with `exec`, please at least notify us at Puppet Labs what you are doing, and hopefully we can work with - you to get a native resource type for the work you are doing." + you to get a native resource type for the work you are doing. + + **Autorequires:** If Puppet is managing an exec's cwd or the executable file used in an exec's command, the exec resource will autorequire those files. If Puppet is managing the user that an exec should run as, the exec resource will autorequire that user." require 'open3' @@ -211,15 +213,6 @@ module Puppet end end - newparam(:env) do - desc "This parameter is deprecated. Use 'environment' instead." - - munge do |value| - warning "'env' is deprecated on exec; use 'environment' instead." - resource[:environment] = value - end - end - newparam(:environment) do desc "Any additional environment variables you want to set for a command. Note that if you use this to set PATH, it will override diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 963b9e5dd..16b1f962d 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -22,7 +22,9 @@ Puppet::Type.newtype(:file) do If you find that you are often copying files in from a central location, rather than using native resources, please contact Puppet Labs and we can hopefully work with you to develop a - native resource to support what you are doing." + native resource to support what you are doing. + + **Autorequires:** If Puppet is managing the user or group that owns a file, the file resource will autorequire them. If Puppet is managing any parent directories of a file, the file resource will autorequire them." def self.title_patterns [ [ /^(.*?)\/*\Z/m, [ [ :path, lambda{|x| x} ] ] ] ] diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb index cf924f371..827183213 100755 --- a/lib/puppet/type/file/content.rb +++ b/lib/puppet/type/file/content.rb @@ -17,22 +17,21 @@ module Puppet desc "Specify the contents of a file as a string. Newlines, tabs, and spaces can be specified using the escaped syntax (e.g., \\n for a newline). The primary purpose of this parameter is to provide a - kind of limited templating:: - - define resolve(nameserver1, nameserver2, domain, search) { - $str = \"search $search - domain $domain - nameserver $nameserver1 - nameserver $nameserver2 - \" - - file { \"/etc/resolv.conf\": - content => $str + kind of limited templating: + + define resolve(nameserver1, nameserver2, domain, search) { + $str = \"search $search + domain $domain + nameserver $nameserver1 + nameserver $nameserver2 + \" + + file { \"/etc/resolv.conf\": + content => $str + } } - } - This attribute is especially useful when used with - `PuppetTemplating templating`:trac:." + This attribute is especially useful when used with templating." # Store a checksum as the value, rather than the actual content. # Simplifies everything. @@ -164,13 +163,15 @@ module Puppet Puppet.settings[:name] == "apply" end + # the content is munged so if it's a checksum source_or_content is nil + # unless the checksum indirectly comes from source def each_chunk_from(source_or_content) if source_or_content.is_a?(String) yield source_or_content - elsif source_or_content.nil? && resource.parameter(:ensure) && [:present, :file].include?(resource.parameter(:ensure).value) - yield '' - elsif source_or_content.nil? + elsif content_is_really_a_checksum? && source_or_content.nil? yield read_file_from_filebucket + elsif source_or_content.nil? + yield '' elsif self.class.standalone? yield source_or_content.content elsif source_or_content.local? @@ -182,6 +183,10 @@ module Puppet private + def content_is_really_a_checksum? + checksum?(should) + end + def chunk_file_from_disk(source_or_content) File.open(source_or_content.full_path, "r") do |src| while chunk = src.read(8192) @@ -195,7 +200,6 @@ module Puppet connection = Puppet::Network::HttpPool.http_instance(source_or_content.server, source_or_content.port) connection.request_get(indirection2uri(request), add_accept_encoding({"Accept" => "raw"})) do |response| case response.code - when "404"; nil when /^2/; uncompress(response) { |uncompressor| response.read_body { |chunk| yield uncompressor.uncompress(chunk) } } else # Raise the http error if we didn't get a 'success' of some kind. diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb index 4a68551ee..99652ecc6 100755 --- a/lib/puppet/type/file/ensure.rb +++ b/lib/puppet/type/file/ensure.rb @@ -7,29 +7,23 @@ module Puppet if the file is missing will create an empty file. Specifying `absent` will delete the file (and directory if recurse => true). - Anything other than those values will be considered to be a symlink. - For instance, the following text creates a link: + Anything other than those values will create a symlink. In the interest of readability and clarity, you should use `ensure => link` and explicitly specify a + target; however, if a `target` attribute isn't provided, the value of the `ensure` + attribute will be used as the symlink target: - # Useful on solaris + # (Useful on Solaris) + # Less maintainable: file { \"/etc/inetd.conf\": - ensure => \"/etc/inet/inetd.conf\" + ensure => \"/etc/inet/inetd.conf\", } - You can make relative links: - - # Useful on solaris + # More maintainable: file { \"/etc/inetd.conf\": - ensure => \"inet/inetd.conf\" + ensure => link, + target => \"/etc/inet/inetd.conf\", } - - If you need to make a relative link to a file named the same - as one of the valid values, you must prefix it with `./` or - something similar. - - You can also make recursive symlinks, which will create a - directory structure that maps to the target directory, - with directories corresponding to each directory - and links corresponding to each file." + + These two declarations are equivalent." # Most 'ensure' properties have a default, but with files we, um, don't. nodefault diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb index a33c6a000..ea385eec0 100644 --- a/lib/puppet/type/file/selcontext.rb +++ b/lib/puppet/type/file/selcontext.rb @@ -32,9 +32,14 @@ module Puppet end def retrieve_default_context(property) + if @resource[:selinux_ignore_defaults] == :true + return nil + end + unless context = self.get_selinux_default_context(@resource[:path]) return nil end + property_default = self.parse_selinux_context(property, context) self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" if not property_default.nil? property_default @@ -54,6 +59,17 @@ module Puppet end end + Puppet::Type.type(:file).newparam(:selinux_ignore_defaults) do + desc "If this is set then Puppet will not ask SELinux (via matchpathcon) to + supply defaults for the SELinux attributes (seluser, selrole, + seltype, and selrange). In general, you should leave this set at its + default and only set it to true when you need Puppet to not try to fix + SELinux labels automatically." + newvalues(:true, :false) + + defaultto :false + end + Puppet::Type.type(:file).newproperty(:seluser, :parent => Puppet::SELFileContext) do desc "What the SELinux user component of the context of the file should be. Any valid SELinux user component is accepted. For example `user_u`. diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index ac06a26a1..d3b3a48eb 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -132,10 +132,6 @@ module Puppet end end - def pinparams - [:mode, :type, :owner, :group, :content] - end - def found? ! (metadata.nil? or metadata.ftype.nil?) end @@ -161,16 +157,6 @@ module Puppet result end - # Make sure we're also checking the checksum - def value=(value) - super - - checks = (pinparams + [:ensure]) - checks.delete(:checksum) - - resource[:audit] = checks - end - def local? found? and uri and (uri.scheme || "file") == "file" end diff --git a/lib/puppet/type/file/target.rb b/lib/puppet/type/file/target.rb index b9fe9213b..7d391e672 100644 --- a/lib/puppet/type/file/target.rb +++ b/lib/puppet/type/file/target.rb @@ -1,7 +1,20 @@ module Puppet Puppet::Type.type(:file).newproperty(:target) do desc "The target for creating a link. Currently, symlinks are the - only type supported." + only type supported. + + You can make relative links: + + # (Useful on Solaris) + file { \"/etc/inetd.conf\": + ensure => link, + target => \"inet/inetd.conf\", + } + + You can also make recursive symlinks, which will create a + directory structure that maps to the target directory, + with directories corresponding to each directory + and links corresponding to each file." newvalue(:notlink) do # We do nothing if the value is absent diff --git a/lib/puppet/type/k5login.rb b/lib/puppet/type/k5login.rb index a343e9e5c..eac142ff7 100644 --- a/lib/puppet/type/k5login.rb +++ b/lib/puppet/type/k5login.rb @@ -1,5 +1,3 @@ -# $Id: k5login.rb 2468 2007-08-07 23:30:20Z digant $ -# # Plug-in type for handling k5login files Puppet::Type.newtype(:k5login) do diff --git a/lib/puppet/type/macauthorization.rb b/lib/puppet/type/macauthorization.rb index ef6fbb6c1..e89aa7c89 100644 --- a/lib/puppet/type/macauthorization.rb +++ b/lib/puppet/type/macauthorization.rb @@ -1,7 +1,10 @@ Puppet::Type.newtype(:macauthorization) do @doc = "Manage the Mac OS X authorization database. - See the [Apple developer site](http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html) for more information." + See the [Apple developer site](http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html) for more information. + + **Autorequires:** If Puppet is managing the `/etc/authorization` file, each + macauthorization resource will autorequire it." ensurable diff --git a/lib/puppet/type/mcx.rb b/lib/puppet/type/mcx.rb index 4f0a6c3c5..07c9348dd 100644 --- a/lib/puppet/type/mcx.rb +++ b/lib/puppet/type/mcx.rb @@ -27,8 +27,11 @@ content property of the file type in Puppet. The recommended method of using this type is to use Work Group Manager to manage users and groups on the local computer, record the resulting -puppet manifest using the command 'ralsh mcx' then deploying this +puppet manifest using the command `puppet resource mcx`, then deploy it to other machines. + +**Autorequires:** If Puppet is managing the user, group, or computer that these +MCX settings refer to, the MCX resource will autorequire that user, group, or computer. " feature :manages_content, \ "The provider can manage MCXSettings as a string.", diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb index 915bb8e6c..5b8c5ca58 100755 --- a/lib/puppet/type/mount.rb +++ b/lib/puppet/type/mount.rb @@ -21,6 +21,11 @@ module Puppet fstab and mount it. Set to `present` to add to fstab but not change mount/unmount status" + # IS -> SHOULD In Sync Action + # ghost -> present NO create + # absent -> present NO create + # (mounted -> present YES) + # (unmounted -> present YES) newvalue(:defined) do provider.create return :mount_created @@ -28,55 +33,66 @@ module Puppet aliasvalue :present, :defined + # IS -> SHOULD In Sync Action + # ghost -> unmounted NO create, unmount + # absent -> unmounted NO create + # mounted -> unmounted NO unmount newvalue(:unmounted) do - if provider.mounted? - syncothers + case self.retrieve + when :ghost # (not in fstab but mounted) + provider.create + @resource.flush provider.unmount return :mount_unmounted - else + when nil, :absent # (not in fstab and not mounted) provider.create return :mount_created + when :mounted # (in fstab and mounted) + provider.unmount + syncothers # I guess it's more likely that the mount was originally mounted with + # the wrong attributes so I sync AFTER the umount + return :mount_unmounted + else + raise Puppet::Error, "Unexpected change from #{current_value} to unmounted}" end end + # IS -> SHOULD In Sync Action + # ghost -> absent NO unmount + # mounted -> absent NO provider.destroy AND unmount + # unmounted -> absent NO provider.destroy newvalue(:absent, :event => :mount_deleted) do + current_value = self.retrieve provider.unmount if provider.mounted? - - provider.destroy + provider.destroy unless current_value == :ghost end + # IS -> SHOULD In Sync Action + # ghost -> mounted NO provider.create + # absent -> mounted NO provider.create AND mount + # unmounted -> mounted NO mount newvalue(:mounted, :event => :mount_mounted) do # Create the mount point if it does not already exist. current_value = self.retrieve - provider.create if current_value.nil? or current_value == :absent + currently_mounted = provider.mounted? + provider.create if [nil, :absent, :ghost].include?(current_value) syncothers # The fs can be already mounted if it was absent but mounted - provider.mount unless provider.mounted? + provider.property_hash[:needs_mount] = true unless currently_mounted end + # insync: mounted -> present + # unmounted -> present def insync?(is) - if should == :defined and is != :absent + if should == :defined and [:mounted,:unmounted].include?(is) true else super end end - def retrieve - # We need to special case :mounted; if we're absent, we still - # want - curval = super() - if curval == :absent - return :absent - elsif provider.mounted? - return :mounted - else - return :unmounted - end - end - def syncothers # We have to flush any changes to disk. currentvalues = @resource.retrieve_resource @@ -210,7 +226,7 @@ module Puppet def refresh # Only remount if we're supposed to be mounted. - provider.remount if self.should(:fstype) != "swap" and self.should(:ensure) == :mounted + provider.remount if self.should(:fstype) != "swap" and provider.mounted? end def value(name) diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index d73d90dff..1222a5319 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -15,7 +15,11 @@ module Puppet using based on the platform you are on, but you can override it using the `provider` parameter; each provider defines what it requires in order to function, and you must meet those requirements - to use a given provider." + to use a given provider. + + **Autorequires:** If Puppet is managing the files specified as a package's + `adminfile`, `responsefile`, or `source`, the package resource will autorequire + those files." feature :installable, "The provider can install packages.", :methods => [:install] diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb index 82f17e533..5fb008f6f 100755 --- a/lib/puppet/type/schedule.rb +++ b/lib/puppet/type/schedule.rb @@ -18,11 +18,11 @@ module Puppet wanted to restrict certain resources to only running once, between the hours of two and 4 AM, then you would use this schedule: - schedule { maint: - range => \"2 - 4\", - period => daily, - repeat => 1 - } + schedule { maint: + range => \"2 - 4\", + period => daily, + repeat => 1 + } With this schedule, the first time that Puppet runs between 2 and 4 AM, all resources with this schedule will get applied, but they won't @@ -35,10 +35,10 @@ module Puppet a schedule named *puppet* is created and used as the default, with the following attributes: - schedule { puppet: - period => hourly, - repeat => 2 - } + schedule { puppet: + period => hourly, + repeat => 2 + } This will cause resources to be applied every 30 minutes by default. " @@ -47,14 +47,14 @@ module Puppet desc "The name of the schedule. This name is used to retrieve the schedule when assigning it to an object: - schedule { daily: - period => daily, - range => \"2 - 4\", - } - - exec { \"/usr/bin/apt-get update\": - schedule => daily - } + schedule { daily: + period => daily, + range => \"2 - 4\", + } + + exec { \"/usr/bin/apt-get update\": + schedule => daily + } " isnamevar @@ -67,9 +67,9 @@ module Puppet seconds can be provided, using the normal colon as a separator. For instance: - schedule { maintenance: - range => \"1:30 - 4:30\" - } + schedule { maintenance: + range => \"1:30 - 4:30\" + } This is mostly useful for restricting certain resources to being applied in maintenance windows or during off-peak hours." diff --git a/lib/puppet/type/selmodule.rb b/lib/puppet/type/selmodule.rb index 60be8a855..e76c18cc0 100644 --- a/lib/puppet/type/selmodule.rb +++ b/lib/puppet/type/selmodule.rb @@ -5,7 +5,9 @@ Puppet::Type.newtype(:selmodule) do @doc = "Manages loading and unloading of SELinux policy modules on the system. Requires SELinux support. See man semodule(8) - for more information on SELinux policy modules." + for more information on SELinux policy modules. + + **Autorequires:** If Puppet is managing the file containing this SELinux policy module (which is either explicitly specified in the `selmodulepath` attribute or will be found at {`selmoduledir`}/{`name`}.pp), the selmodule resource will autorequire that file." ensurable diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb index e3320140e..8338e2d64 100644 --- a/lib/puppet/type/ssh_authorized_key.rb +++ b/lib/puppet/type/ssh_authorized_key.rb @@ -1,7 +1,11 @@ module Puppet newtype(:ssh_authorized_key) do @doc = "Manages SSH authorized keys. Currently only type 2 keys are - supported." + supported. + + **Autorequires:** If Puppet is managing the user account in which this + SSH key should be installed, the `ssh_authorized_key` resource will autorequire + that user." ensurable diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index e7389a0d1..f74e4266f 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -12,7 +12,9 @@ module Puppet This resource type uses the prescribed native tools for creating groups and generally uses POSIX APIs for retrieving information - about them. It does not directly modify `/etc/passwd` or anything." + about them. It does not directly modify `/etc/passwd` or anything. + + **Autorequires:** If Puppet is managing the user's primary group (as provided in the `gid` attribute), the user resource will autorequire that group. If Puppet is managing any role accounts corresponding to the user's roles, the user resource will autorequire those role accounts." feature :allows_duplicates, "The provider supports duplicate users with the same UID." @@ -34,6 +36,9 @@ module Puppet feature :manages_expiry, "The provider can manage the expiry date for a user." + feature :system_users, + "The provider allows you to create system users with lower UIDs." + newproperty(:ensure, :parent => Puppet::Property::Ensure) do newvalue(:present, :event => :user_created) do provider.create @@ -230,6 +235,14 @@ module Puppet defaultto :minimum end + newparam(:system, :boolean => true) do + desc "Whether the user is a system user with lower UID." + + newvalues(:true, :false) + + defaultto false + end + newparam(:allowdupe, :boolean => true) do desc "Whether to allow duplicate UIDs." diff --git a/lib/puppet/type/zfs.rb b/lib/puppet/type/zfs.rb index be18ab5aa..7123f8ac9 100755 --- a/lib/puppet/type/zfs.rb +++ b/lib/puppet/type/zfs.rb @@ -1,6 +1,8 @@ module Puppet newtype(:zfs) do - @doc = "Manage zfs. Create destroy and set properties on zfs instances." + @doc = "Manage zfs. Create destroy and set properties on zfs instances. + +**Autorequires:** If Puppet is managing the zpool at the root of this zfs instance, the zfs resource will autorequire it. If Puppet is managing any parent zfs instances, the zfs resource will autorequire them." ensurable diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb index fc524a541..1bae93120 100644 --- a/lib/puppet/type/zone.rb +++ b/lib/puppet/type/zone.rb @@ -1,5 +1,7 @@ Puppet::Type.newtype(:zone) do - @doc = "Solaris zones." + @doc = "Solaris zones. + +**Autorequires:** If Puppet is managing the directory specified as the root of the zone's filesystem (with the `path` attribute), the zone resource will autorequire that directory." # These properties modify the zone configuration, and they need to provide # the text separately from syncing it, so all config statements can be rolled @@ -413,6 +415,23 @@ Puppet::Type.newtype(:zone) do end end + # If Puppet is also managing the zfs filesystem which is the zone dataset + # then list it as a prerequisite. Zpool's get autorequired by the zfs + # type. We just need to autorequire the dataset zfs itself as the zfs type + # will autorequire all of the zfs parents and zpool. + autorequire(:zfs) do + + # Check if we have datasets in our zone configuration + if @parameters.include? :dataset + reqs = [] + # Autorequire each dataset + self[:dataset].each { |value| + reqs << value + } + reqs + end + end + def validate_ip(ip, name) IPAddr.new(ip) if ip rescue ArgumentError diff --git a/lib/puppet/type/zpool.rb b/lib/puppet/type/zpool.rb index df06522e8..40ee8f286 100755 --- a/lib/puppet/type/zpool.rb +++ b/lib/puppet/type/zpool.rb @@ -40,9 +40,10 @@ module Puppet end newproperty(:mirror, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do - desc "List of all the devices to mirror for this pool. Each mirror should be a space separated string: + desc "List of all the devices to mirror for this pool. Each mirror should be a + space separated string: - mirror => [\"disk1 disk2\", \"disk3 disk4\"] + mirror => [\"disk1 disk2\", \"disk3 disk4\"], " @@ -52,9 +53,10 @@ module Puppet end newproperty(:raidz, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do - desc "List of all the devices to raid for this pool. Should be an array of space separated strings: - - raidz => [\"disk1 disk2\", \"disk3 disk4\"] + desc "List of all the devices to raid for this pool. Should be an array of + space separated strings: + + raidz => [\"disk1 disk2\", \"disk3 disk4\"], " diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 850d147e2..d06f44808 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -4,6 +4,7 @@ require 'puppet/util/monkey_patches' require 'sync' require 'puppet/external/lock' require 'monitor' +require 'puppet/util/execution_stub' module Puppet # A command failed to execute. @@ -264,6 +265,10 @@ module Util arguments[:uid] = Puppet::Util::SUIDManager.convert_xid(:uid, arguments[:uid]) if arguments[:uid] arguments[:gid] = Puppet::Util::SUIDManager.convert_xid(:gid, arguments[:gid]) if arguments[:gid] + if execution_stub = Puppet::Util::ExecutionStub.current_value + return execution_stub.call(command, arguments) + end + @@os ||= Facter.value(:operatingsystem) output = nil child_pid, child_status = nil diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb index 3562a3dc0..7f74d266a 100644 --- a/lib/puppet/util/command_line.rb +++ b/lib/puppet/util/command_line.rb @@ -33,8 +33,12 @@ module Puppet end def available_subcommands - absolute_appdir = $LOAD_PATH.collect { |x| File.join(x,'puppet','application') }.detect{ |x| File.directory?(x) } - Dir[File.join(absolute_appdir, '*.rb')].map{|fn| File.basename(fn, '.rb')} + absolute_appdirs = $LOAD_PATH.collect do |x| + File.join(x,'puppet','application') + end.select{ |x| File.directory?(x) } + absolute_appdirs.inject([]) do |commands, dir| + commands + Dir[File.join(dir, '*.rb')].map{|fn| File.basename(fn, '.rb')} + end.uniq end def usage_message @@ -81,7 +85,7 @@ module Puppet if zero == 'puppet' case argv.first when nil; [ stdin.tty? ? nil : "apply", argv] # ttys get usage info - when "--help"; [nil, argv] # help should give you usage, not the help for `puppet apply` + when "--help", "-h"; [nil, argv] # help should give you usage, not the help for `puppet apply` when /^-|\.pp$|\.rb$/; ["apply", argv] else [ argv.first, argv[1..-1] ] end diff --git a/lib/puppet/util/command_line/filebucket b/lib/puppet/util/command_line/filebucket deleted file mode 100755 index 34b01508e..000000000 --- a/lib/puppet/util/command_line/filebucket +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# A stand-alone Puppet filebucket client. -# -# = Usage -# -# puppet filebucket [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] -# [-l|--local] [-r|--remote] -# [-s|--server <server>] [-b|--bucket <directory>] <file> <file> ... -# -# = Description -# -# This is a stand-alone filebucket client for sending files to a local -# or central filebucket. -# -# = Usage -# -# This client can operate in three modes, with only one mode per call: -# -# backup:: -# Send one or more files to the specified file bucket. Each sent file -# is printed with its resulting md5 sum. -# -# get:: -# Return the text associated with an md5 sum. The text is printed to -# stdout, and only one file can be retrieved at a time. -# -# restore:: -# Given a file path and an md5 sum, store the content associated with the -# sum into the specified file path. You can specify an entirely new path -# to this argument; you are not restricted to restoring the content to its -# original location. -# -# Note that +filebucket+ defaults to using a network-based filebucket available on -# the server named +puppet+. To use this, you'll have to be running as a user -# with valid Puppet certificates. Alternatively, you can use your local file bucket -# by specifying +--local+. -# -# = Example -# -# $ puppet filebucket backup /etc/passwd -# /etc/passwd: 429b225650b912a2ee067b0a4cf1e949 -# $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 -# $ -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet with -# '--genconfig'. -# -# debug:: -# Enable full debugging. -# -# help:: -# Print this help message -# -# local:: -# Use the local filebucket. This will use the default configuration -# information. -# -# remote:: -# Use a remote filebucket. This will use the default configuration -# information. -# -# server:: -# The server to send the file to, instead of locally. -# -# verbose:: -# Print extra information. -# -# version:: -# Print version information. -# -# = Example -# -# puppet filebucket -b /tmp/filebucket /my/file -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:filebucket].run diff --git a/lib/puppet/util/command_line/pi b/lib/puppet/util/command_line/pi deleted file mode 100755 index 3d80eea8f..000000000 --- a/lib/puppet/util/command_line/pi +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Print help about puppet types on the console. Run with '-h' to get detailed -# help. -# = Usage -# -# puppet describe [-h|--help] [-s|--short] [-p|--providers] [-l|--list] [-m|--meta] -# -# = Description -# -# Prints details of Puppet types, providers and metaparameters on the console. -# -# = Options -# -# help:: -# Print this help text -# -# providers:: -# Describe providers in detail for each type -# -# list:: -# List all types -# -# meta:: -# List all metaparameters -# -# short:: -# List only parameters without detail -# -# = Example -# -# puppet describe --list -# puppet describe file --providers -# puppet describe user -s -m -# -# = Author -# -# David Lutterkort -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:describe].run diff --git a/lib/puppet/util/command_line/puppet b/lib/puppet/util/command_line/puppet deleted file mode 100755 index e75b92af8..000000000 --- a/lib/puppet/util/command_line/puppet +++ /dev/null @@ -1,69 +0,0 @@ - -# -# = Synopsis -# -# Run a stand-alone +puppet+ manifest. -# -# = Usage -# -# puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] [-e|--execute] -# [--detailed-exitcodes] [-l|--logdest <file>] <file> -# -# = Description -# -# This is the standalone puppet execution tool; use it to execute -# individual manifests that you write. If you need to execute site-wide -# manifests, use 'puppet agent' and 'puppet master'. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet with -# '--genconfig'. -# -# debug:: -# Enable full debugging. -# -# detailed-exitcodes:: -# Provide transaction information via exit codes. If this is enabled, an exit -# code of '2' means there were changes, and an exit code of '4' means that there -# were failures during the transaction. -# -# help:: -# Print this help message -# -# loadclasses:: -# Load any stored classes. 'puppet agent' caches configured classes (usually at -# /etc/puppet/classes.txt), and setting this option causes all of those classes -# to be set in your puppet manifest. -# -# logdest:: -# Where to send messages. Choose between syslog, the console, and a log file. -# Defaults to sending messages to the console. -# -# execute:: -# Execute a specific piece of Puppet code -# -# verbose:: -# Print extra information. -# -# = Example -# -# puppet -l /tmp/manifest.log manifest.pp -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:apply].run diff --git a/lib/puppet/util/command_line/puppetca b/lib/puppet/util/command_line/puppetca deleted file mode 100755 index 317d99881..000000000 --- a/lib/puppet/util/command_line/puppetca +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Stand-alone certificate authority. Capable of generating certificates -# but mostly meant for signing certificate requests from puppet clients. -# -# = Usage -# -# puppet cert [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] -# [-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke] -# [-p|--print] [-c|--clean] [--verify] [--digest DIGEST] -# [--fingerprint] [host] -# -# = Description -# -# Because the puppetmasterd daemon defaults to not signing client certificate -# requests, this script is available for signing outstanding requests. It -# can be used to list outstanding requests and then either sign them individually -# or sign all of them. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet cert with -# '--genconfig'. -# -# all:: -# Operate on all items. Currently only makes sense with '--sign', -# '--clean', or '--list'. -# -# digest:: -# Set the digest for fingerprinting (defaults to md5). Valid values depends -# on your openssl and openssl ruby extension version, but should contain at -# least md5, sha1, md2, sha256. -# -# clean:: -# Remove all files related to a host from puppet cert's storage. This is -# useful when rebuilding hosts, since new certificate signing requests -# will only be honored if puppet cert does not have a copy of a signed -# certificate for that host. The certificate of the host is also revoked. -# If '--all' is specified then all host certificates, both signed and -# unsigned, will be removed. -# -# debug:: -# Enable full debugging. -# -# generate:: -# Generate a certificate for a named client. A certificate/keypair will be -# generated for each client named on the command line. -# -# help:: -# Print this help message -# -# list:: -# List outstanding certificate requests. If '--all' is specified, -# signed certificates are also listed, prefixed by '+', and revoked -# or invalid certificates are prefixed by '-' (the verification outcome -# is printed in parenthesis). -# -# print:: -# Print the full-text version of a host's certificate. -# -# fingerprint:: -# Print the DIGEST (defaults to md5) fingerprint of a host's certificate. -# -# revoke:: -# Revoke the certificate of a client. The certificate can be specified -# either by its serial number, given as a decimal number or a hexadecimal -# number prefixed by '0x', or by its hostname. The certificate is revoked -# by adding it to the Certificate Revocation List given by the 'cacrl' -# config parameter. Note that the puppetmasterd needs to be restarted -# after revoking certificates. -# -# sign:: -# Sign an outstanding certificate request. Unless '--all' is specified, -# hosts must be listed after all flags. -# -# verbose:: -# Enable verbosity. -# -# version:: -# Print the puppet version number and exit. -# -# verify:: -# Verify the named certificate against the local CA certificate. -# -# = Example -# -# $ puppet cert -l -# culain.madstop.com -# $ puppet cert -s culain.madstop.com -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:cert].run diff --git a/lib/puppet/util/command_line/puppetd b/lib/puppet/util/command_line/puppetd deleted file mode 100755 index 71b28429b..000000000 --- a/lib/puppet/util/command_line/puppetd +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env ruby - -# == Synopsis -# -# Retrieve the client configuration from the puppet master and apply -# it to the local host. -# -# Currently must be run out periodically, using cron or something similar. -# -# = Usage -# -# puppet agent [-D|--daemonize|--no-daemonize] [-d|--debug] -# [--detailed-exitcodes] [--disable] [--enable] -# [-h|--help] [--certname <host name>] [-l|--logdest syslog|<file>|console] -# [-o|--onetime] [--serve <handler>] [-t|--test] [--noop] -# [--digest <digest>] [--fingerprint] [-V|--version] -# [-v|--verbose] [-w|--waitforcert <seconds>] -# -# = Description -# -# This is the main puppet client. Its job is to retrieve the local machine's -# configuration from a remote server and apply it. In order to successfully -# communicate with the remote server, the client must have a certificate signed -# by a certificate authority that the server trusts; the recommended method -# for this, at the moment, is to run a certificate authority as part of the -# puppet server (which is the default). The client will connect and request -# a signed certificate, and will continue connecting until it receives one. -# -# Once the client has a signed certificate, it will retrieve its configuration -# and apply it. -# -# = Usage Notes -# -# +puppet agent+ does its best to find a compromise between interactive use and -# daemon use. Run with no arguments and no configuration, it will go into the -# backgroun, attempt to get a signed certificate, and retrieve and apply its -# configuration every 30 minutes. -# -# Some flags are meant specifically for interactive use -- in particular, -# +test+, +tags+ or +fingerprint+ are useful. +test+ enables verbose logging, causes -# the daemon to stay in the foreground, exits if the server's configuration is -# invalid (this happens if, for instance, you've left a syntax error on the -# server), and exits after running the configuration once (rather than hanging -# around as a long-running process). -# -# +tags+ allows you to specify what portions of a configuration you want to apply. -# Puppet elements are tagged with all of the class or definition names that -# contain them, and you can use the +tags+ flag to specify one of these names, -# causing only configuration elements contained within that class or definition -# to be applied. This is very useful when you are testing new configurations -- -# for instance, if you are just starting to manage +ntpd+, you would put all of -# the new elements into an +ntpd+ class, and call puppet with +--tags ntpd+, -# which would only apply that small portion of the configuration during your -# testing, rather than applying the whole thing. -# -# +fingerprint+ is a one-time flag. In this mode +puppet agent+ will run once and -# display on the console (and in the log) the current certificate (or certificate -# request) fingerprint. Providing the +--digest+ option allows to use a different -# digest algorithm to generate the fingerprint. The main use is to verify that -# before signing a certificate request on the master, the certificate request the -# master received is the same as the one the client sent (to prevent against -# man-in-the-middle attacks when signing certificates). -# -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'server' is a valid configuration -# parameter, so you can specify '--server <servername>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet agent with -# '--genconfig'. -# -# daemonize:: -# Send the process into the background. This is the default. -# -# no-daemonize:: -# Do not send the process into the background. -# -# debug:: -# Enable full debugging. -# -# digest:: -# Change the certificate fingerprinting digest algorithm. The default is MD5. -# Valid values depends on the version of OpenSSL installed, but should always -# at least contain MD5, MD2, SHA1 and SHA256. -# -# detailed-exitcodes:: -# Provide transaction information via exit codes. If this is enabled, an -# exit code of '2' means there were changes, and an exit code of '4' means -# that there were failures during the transaction. This option only makes -# sense in conjunction with --onetime. -# -# disable:: -# Disable working on the local system. This puts a lock file in place, -# causing +puppet agent+ not to work on the system until the lock file is removed. -# This is useful if you are testing a configuration and do not want the central -# configuration to override the local state until everything is tested and -# committed. -# -# +puppet agent+ uses the same lock file while it is running, so no more than one -# +puppet agent+ process is working at a time. -# -# +puppet agent+ exits after executing this. -# -# enable:: -# Enable working on the local system. This removes any lock file, causing -# +puppet agent+ to start managing the local system again (although it will continue -# to use its normal scheduling, so it might not start for another half hour). -# -# +puppet agent+ exits after executing this. -# -# certname:: -# Set the certname (unique ID) of the client. The master reads this unique -# identifying string, which is usually set to the node's fully-qualified domain -# name, to determine which configurations the node will receive. Use this option -# to debug setup problems or implement unusual node identification schemes. -# -# help:: -# Print this help message -# -# logdest:: -# Where to send messages. Choose between syslog, the console, and a log file. -# Defaults to sending messages to syslog, or the console if debugging or -# verbosity is enabled. -# -# no-client:: -# Do not create a config client. This will cause the daemon to run -# without ever checking for its configuration automatically, and only -# makes sense when used in conjunction with --listen. -# -# onetime:: -# Run the configuration once. Runs a single (normally daemonized) Puppet run. -# Useful for interactively running puppet agent when used in conjunction with -# the --no-daemonize option. -# -# fingerprint:: -# Display the current certificate or certificate signing request fingerprint -# and then exit. Use the +--digest+ option to change the digest algorithm used. -# -# serve:: -# Start another type of server. By default, +puppet agent+ will start -# a service handler that allows authenticated and authorized remote nodes to -# trigger the configuration to be pulled down and applied. You can specify -# any handler here that does not require configuration, e.g., filebucket, ca, -# or resource. The handlers are in +lib/puppet/network/handler+, and the names -# must match exactly, both in the call to +serve+ and in +namespaceauth.conf+. -# -# test:: -# Enable the most common options used for testing. These are +onetime+, -# +verbose+, +ignorecache, +no-daemonize+, +no-usecacheonfailure+, -# +detailed-exit-codes+, +no-splay+, and +show_diff+. -# -# noop:: -# Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful -# for seeing what changes Puppet will make without actually executing the changes. -# -# verbose:: -# Turn on verbose reporting. -# -# version:: -# Print the puppet version number and exit. -# -# waitforcert:: -# This option only matters for daemons that do not yet have certificates -# and it is enabled by default, with a value of 120 (seconds). This causes -# +puppet agent+ to connect to the server every 2 minutes and ask it to sign a -# certificate request. This is useful for the initial setup of a puppet -# client. You can turn off waiting for certificates by specifying a time -# of 0. -# -# = Example -# -# puppet agent --server puppet.domain.com -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005, 2006 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:agent].run diff --git a/lib/puppet/util/command_line/puppetdoc b/lib/puppet/util/command_line/puppetdoc deleted file mode 100755 index 45a9c6518..000000000 --- a/lib/puppet/util/command_line/puppetdoc +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Generate a reference for all Puppet types. Largely meant for internal Puppet -# Labs use. -# -# = Usage -# -# puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|rdoc>] -# [-r|--reference <[type]|configuration|..>] [--charset CHARSET] [manifest-file] -# -# = Description -# -# If mode is not 'rdoc', then this command generates a Markdown document describing all installed -# Puppet types or all allowable arguments to puppet executables. It is largely -# meant for internal use and is used to generate the reference document -# available on the Puppet Labs web site. -# -# In 'rdoc' mode, this command generates an html RDoc hierarchy describing the manifests that -# are in 'manifestdir' and 'modulepath' configuration directives. -# The generated documentation directory is doc by default but can be changed with the 'outputdir' option. -# -# If the command is started with 'manifest-file' command-line arguments, puppet doc generate a single -# manifest documentation that is output on stdout. -# -# = Options -# -# all:: -# Output the docs for all of the reference types. In 'rdoc' modes, this also outputs documentation for all resources -# -# help:: -# Print this help message -# -# outputdir:: -# Specifies the directory where to output the rdoc documentation in 'rdoc' mode. -# -# mode:: -# Determine the output mode. Valid modes are 'text', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path' -# -# reference:: -# Build a particular reference. Get a list of references by running +puppet doc --list+. -# -# charset:: -# Used only in 'rdoc' mode. It sets the charset used in the html files produced. -# -# = Example -# -# $ puppet doc -r type > /tmp/type_reference.markdown -# or -# $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests -# or -# $ puppet doc /etc/puppet/manifests/site.pp -# or -# $ puppet doc -m pdf -r configuration -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005-2007 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:doc].run diff --git a/lib/puppet/util/command_line/puppetmasterd b/lib/puppet/util/command_line/puppetmasterd deleted file mode 100755 index 445169820..000000000 --- a/lib/puppet/util/command_line/puppetmasterd +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# The central puppet server. Functions as a certificate authority by default. -# -# = Usage -# -# puppet master [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help] -# [-l|--logdest <file>|console|syslog] [-v|--verbose] [-V|--version] -# [--compile <nodename>] [--apply <catalog>] -# -# = Description -# -# This is the puppet central daemon. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppetmasterdd with -# '--genconfig'. -# -# daemonize:: -# Send the process into the background. This is the default. -# -# no-daemonize:: -# Do not send the process into the background. -# -# debug:: -# Enable full debugging. -# -# help:: -# Print this help message. -# -# logdest:: -# Where to send messages. Choose between syslog, the console, and a log file. -# Defaults to sending messages to syslog, or the console -# if debugging or verbosity is enabled. -# -# verbose:: -# Enable verbosity. -# -# version:: -# Print the puppet version number and exit. -# -# compile:: -# Capability to compile a catalogue and output it in JSON from the Puppet master. Uses -# facts contained in the $vardir/yaml/ directory to compile the catalog. -# -# apply:: -# Capability to apply JSON catalog (such as one generated with --compile). You can either specify -# a JSON file or pipe in JSON from standard input. -# -# = Example -# -# puppet master -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:master].run diff --git a/lib/puppet/util/command_line/puppetqd b/lib/puppet/util/command_line/puppetqd deleted file mode 100755 index 81963d537..000000000 --- a/lib/puppet/util/command_line/puppetqd +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env ruby - -# == Synopsis -# -# Retrieve serialized records from a queue and process them in order. -# -# = Usage -# -# puppet queue [-d|--debug] [-v|--verbose] -# -# = Description -# -# This is a simple application that just processes entities in a queue as they -# are recieved. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'server' is a valid configuration -# parameter, so you can specify '--server <servername>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppetd with -# '--genconfig'. -# -# debug:: -# Enable full debugging. -# -# help:: -# Print this help message -# -# verbose:: -# Turn on verbose reporting. -# -# version:: -# Print the puppet version number and exit. -# -# = Example -# -# puppet queue -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2009 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:queue].run diff --git a/lib/puppet/util/command_line/puppetrun b/lib/puppet/util/command_line/puppetrun deleted file mode 100755 index 7eba3b2c4..000000000 --- a/lib/puppet/util/command_line/puppetrun +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Trigger a puppet agent run on a set of hosts. -# -# = Usage -# -# puppet kick [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground] -# [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules] -# [-t|--tag <tag>] [--test] [-p|--ping] <host> [<host> [...]] -# -# = Description -# -# This script can be used to connect to a set of machines running +puppet agent+ -# and trigger them to run their configurations. The most common usage would -# be to specify a class of hosts and a set of tags, and +puppet kick+ would -# look up in LDAP all of the hosts matching that class, then connect to -# each host and trigger a run of all of the objects with the specified tags. -# -# If you are not storing your host configurations in LDAP, you can specify -# hosts manually. -# -# You will most likely have to run +puppet kick+ as root to get access to -# the SSL certificates. -# -# +puppet kick+ reads +puppet master+'s configuration file, so that it can copy -# things like LDAP settings. -# -# = Usage Notes -# -# +puppet kick+ is useless unless +puppet agent+ is listening. See its documentation -# for more information, but the gist is that you must enable +listen+ on the -# +puppet agent+ daemon, either using +--listen+ on the command line or adding -# 'listen: true' in its config file. In addition, you need to set the daemons -# up to specifically allow connections by creating the +namespaceauth+ file, -# normally at '/etc/puppet/namespaceauth.conf'. This file specifies who has -# access to each namespace; if you create the file you must add every namespace -# you want any Puppet daemon to allow -- it is currently global to all Puppet -# daemons. -# -# An example file looks like this:: -# -# [fileserver] -# allow *.madstop.com -# -# [puppetmaster] -# allow *.madstop.com -# -# [puppetrunner] -# allow culain.madstop.com -# -# This is what you would install on your Puppet master; non-master hosts could -# leave off the 'fileserver' and 'puppetmaster' namespaces. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://reductivelabs.com/projects/puppet/reference/configref.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet master with -# '--genconfig'. -# -# -# all:: -# Connect to all available hosts. Requires LDAP support at this point. -# -# class:: -# Specify a class of machines to which to connect. This only works if you -# have LDAP configured, at the moment. -# -# debug:: -# Enable full debugging. -# -# foreground:: -# Run each configuration in the foreground; that is, when connecting to a host, -# do not return until the host has finished its run. The default is false. -# -# help:: -# Print this help message -# -# host:: -# A specific host to which to connect. This flag can be specified more -# than once. -# -# ignoreschedules:: -# Whether the client should ignore schedules when running its configuration. -# This can be used to force the client to perform work it would not normally -# perform so soon. The default is false. -# -# parallel:: -# How parallel to make the connections. Parallelization is provided by forking -# for each client to which to connect. The default is 1, meaning serial execution. -# -# tag:: -# Specify a tag for selecting the objects to apply. Does not work with the -# --test option. -# -# -# test:: -# Print the hosts you would connect to but do not actually connect. This -# option requires LDAP support at this point. -# -# ping:: -# -# Do a ICMP echo against the target host. Skip hosts that don't respond to ping. -# -# = Example -# -# sudo puppet kick -p 10 -t remotefile -t webserver host1 host2 -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:kick].run diff --git a/lib/puppet/util/command_line/ralsh b/lib/puppet/util/command_line/ralsh deleted file mode 100755 index 5c1f719e2..000000000 --- a/lib/puppet/util/command_line/ralsh +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Use the Puppet RAL to directly interact with the system. -# -# = Usage -# -# puppet resource [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit] -# [-H|--host <host>] [-p|--param <param>] [-t|--types] -# type <name> -# -# = Description -# -# This command provides simple facilities for converting current system state -# into Puppet code, along with some ability to use Puppet to affect the current -# state. -# -# By default, you must at least provide a type to list, which case puppet resource -# will tell you everything it knows about all instances of that type. You can -# optionally specify an instance name, and puppet resource will only describe that single -# instance. -# -# You can also add +--edit+ as an argument, and puppet resource will write its output -# to a file, open that file in an editor, and then apply the file as a Puppet -# transaction. You can easily use this to use Puppet to make simple changes to -# a system. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir <directory>' as an argument. -# -# See the configuration file documentation at -# http://docs.puppetlabs.com/references/stable/configuration.html for -# the full list of acceptable parameters. A commented list of all -# configuration options can also be generated by running puppet with -# '--genconfig'. -# -# debug:: -# Enable full debugging. -# -# edit: -# Write the results of the query to a file, open the file in an editor, -# and read the file back in as an executable Puppet manifest. -# -# host: -# When specified, connect to the resource server on the named host -# and retrieve the list of resouces of the type specified. -# -# help: -# Print this help message. -# -# param: -# Add more parameters to be outputted from queries. -# -# types: -# List all available types. -# -# verbose: -# Print extra information. -# -# = Example -# -# This example uses `puppet resource` to return Puppet configuration for the user `luke`: -# -# $ puppet resource user luke -# user { 'luke': -# home => '/home/luke', -# uid => '100', -# ensure => 'present', -# comment => 'Luke Kanies,,,', -# gid => '1000', -# shell => '/bin/bash', -# groups => ['sysadmin','audio','video','puppet'] -# } -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005-2007 Puppet Labs, LLC -# Licensed under the GNU Public License - -#Puppet::Application[:resource].run diff --git a/lib/puppet/util/execution.rb b/lib/puppet/util/execution.rb index dd820f856..69f4f2c15 100644 --- a/lib/puppet/util/execution.rb +++ b/lib/puppet/util/execution.rb @@ -4,16 +4,15 @@ module Puppet::Util::Execution # Run some code with a specific environment. Resets the environment back to # what it was at the end of the code. def withenv(hash) - oldvals = {} + saved = ENV.to_hash hash.each do |name, val| - name = name.to_s - oldvals[name] = ENV[name] - ENV[name] = val + ENV[name.to_s] = val end yield ensure - oldvals.each do |name, val| + ENV.clear + saved.each do |name, val| ENV[name] = val end end diff --git a/lib/puppet/util/execution_stub.rb b/lib/puppet/util/execution_stub.rb new file mode 100644 index 000000000..af74e0f72 --- /dev/null +++ b/lib/puppet/util/execution_stub.rb @@ -0,0 +1,26 @@ +module Puppet::Util + class ExecutionStub + class << self + # Set a stub block that Puppet::Util.execute() should invoke instead + # of actually executing commands on the target machine. Intended + # for spec testing. + # + # The arguments passed to the block are |command, options|, where + # command is an array of strings and options is an options hash. + def set(&block) + @value = block + end + + # Uninstall any execution stub, so that calls to + # Puppet::Util.execute() behave normally again. + def reset + @value = nil + end + + # Retrieve the current execution stub, or nil if there is no stub. + def current_value + @value + end + end + end +end diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb index 2f9f356bb..d34fbaf55 100644 --- a/lib/puppet/util/log.rb +++ b/lib/puppet/util/log.rb @@ -68,6 +68,12 @@ class Puppet::Util::Log } end + def Log.autoflush=(v) + @destinations.each do |type, dest| + dest.autoflush = v if dest.respond_to?(:autoflush=) + end + end + # Create a new log message. The primary role of this method is to # avoid creating log messages below the loglevel. def Log.create(hash) diff --git a/lib/puppet/util/log/destinations.rb b/lib/puppet/util/log/destinations.rb index 2e2f9a5b7..dd0d996bf 100644 --- a/lib/puppet/util/log/destinations.rb +++ b/lib/puppet/util/log/destinations.rb @@ -50,6 +50,8 @@ Puppet::Util::Log.newdesttype :file do @file.flush if defined?(@file) end + attr_accessor :autoflush + def initialize(path) @name = path # first make sure the directory exists diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb index 1c35ae523..a93c66b07 100644 --- a/lib/puppet/util/monkey_patches.rb +++ b/lib/puppet/util/monkey_patches.rb @@ -21,6 +21,9 @@ class Symbol z.emit("!ruby/sym ") to_s.to_zaml(z) end + def <=> (other) + self.to_s <=> other.to_s + end end [Object, Exception, Integer, Struct, Date, Time, Range, Regexp, Hash, Array, Float, String, FalseClass, TrueClass, Symbol, NilClass, Class].each { |cls| @@ -48,7 +51,6 @@ if RUBY_VERSION == '1.8.7' end end - class Object # ActiveSupport 2.3.x mixes in a dangerous method # that can cause rspec to fork bomb @@ -56,6 +58,23 @@ class Object def daemonize raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it." end + + # The following code allows callers to make assertions that are only + # checked when the environment variable PUPPET_ENABLE_ASSERTIONS is + # set to a non-empty string. For example: + # + # assert_that { condition } + # assert_that(message) { condition } + if ENV["PUPPET_ENABLE_ASSERTIONS"].to_s != '' + def assert_that(message = nil) + unless yield + raise Exception.new("Assertion failure: #{message}") + end + end + else + def assert_that(message = nil) + end + end end # Workaround for yaml_initialize, which isn't supported before Ruby diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb index bdac579d6..c00bc6f85 100644 --- a/lib/puppet/util/rdoc.rb +++ b/lib/puppet/util/rdoc.rb @@ -31,6 +31,7 @@ module Puppet::Util::RDoc options << "--force-update" if Options::OptionList.options.any? { |o| o[0] == "--force-update" } options += [ "--charset", charset] if charset options += files + #TODO dedup file paths (not strict duplication sense, parents, children, etc # launch the documentation process r.document(options) @@ -53,17 +54,10 @@ module Puppet::Util::RDoc # of a manifest def output(file, ast) astobj = [] - ast.nodes.each do |name, k| - astobj << k if k.file == file + ast.instantiate('').each do |resource_type| + astobj << resource_type if resource_type.file == file end - ast.hostclasses.each do |name,k| - astobj << k if k.file == file - end - - ast.definitions.each do |name, k| - astobj << k if k.file == file - end astobj.sort! {|a,b| a.line <=> b.line }.each do |k| output_astnode_doc(k) end @@ -89,4 +83,4 @@ module Puppet::Util::RDoc end end -end
\ No newline at end of file +end diff --git a/lib/puppet/util/rdoc/code_objects.rb b/lib/puppet/util/rdoc/code_objects.rb index 3854fbc01..3c789a0c5 100644 --- a/lib/puppet/util/rdoc/code_objects.rb +++ b/lib/puppet/util/rdoc/code_objects.rb @@ -124,6 +124,45 @@ module RDoc def add_child(child) @childs << child end + + # Look up the given symbol. RDoc only looks for class1::class2.method + # or class1::class2#method. Since our definitions are mapped to RDoc methods + # but are written class1::class2::define we need to perform the lookup by + # ourselves. + def find_symbol(symbol, method=nil) + result = super + if not result and symbol =~ /::/ + modules = symbol.split(/::/) + unless modules.empty? + module_name = modules.shift + result = find_module_named(module_name) + if result + last_name = "" + previous = nil + modules.each do |module_name| + previous = result + last_name = module_name + result = result.find_module_named(module_name) + break unless result + end + unless result + result = previous + method = last_name + end + end + end + if result && method + if !result.respond_to?(:find_local_symbol) + p result.name + p method + fail + end + result = result.find_local_symbol(method) + end + end + result + end + end # PuppetNode holds a puppet node diff --git a/lib/puppet/util/rdoc/generators/puppet_generator.rb b/lib/puppet/util/rdoc/generators/puppet_generator.rb index e6bbb2e1e..249c9a8ba 100644 --- a/lib/puppet/util/rdoc/generators/puppet_generator.rb +++ b/lib/puppet/util/rdoc/generators/puppet_generator.rb @@ -31,6 +31,24 @@ module Generators NODE_DIR = "nodes" PLUGIN_DIR = "plugins" + # We're monkey patching RDoc markup to allow + # lowercase class1::class2::class3 crossref hyperlinking + module MarkUp + alias :old_markup :markup + + def new_markup(str, remove_para=false) + first = @markup.nil? + res = old_markup(str, remove_para) + if first and not @markup.nil? + @markup.add_special(/\b([a-z]\w+(::\w+)*)/,:CROSSREF) + # we need to call it again, since we added a rule + res = old_markup(str, remove_para) + end + res + end + alias :markup :new_markup + end + # This is a specialized HTMLGenerator tailored to Puppet manifests class PuppetGenerator < HTMLGenerator diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb index ce34442ab..0f746e2ea 100644 --- a/lib/puppet/util/rdoc/parser.rb +++ b/lib/puppet/util/rdoc/parser.rb @@ -34,18 +34,19 @@ class Parser # main entry point def scan environment = Puppet::Node::Environment.new + @known_resource_types = environment.known_resource_types unless environment.known_resource_types.watching_file?(@input_file_name) Puppet.info "rdoc: scanning #{@input_file_name}" if @input_file_name =~ /\.pp$/ @parser = Puppet::Parser::Parser.new(environment) @parser.file = @input_file_name - @known_resource_types = environment.known_resource_types @parser.parse.instantiate('').each do |type| @known_resource_types.add type end - scan_top_level(@top_level) end end + + scan_top_level(@top_level) @top_level end @@ -160,8 +161,8 @@ class Parser if stmt.is_a?(Puppet::Parser::AST::Function) and ['include','require'].include?(stmt.name) stmt.arguments.each do |included| - Puppet.debug "found #{stmt.name}: #{included.value}" - container.send("add_#{stmt.name}",Include.new(included.value, stmt.doc)) + Puppet.debug "found #{stmt.name}: #{included}" + container.send("add_#{stmt.name}",Include.new(included.to_s, stmt.doc)) end end end @@ -342,6 +343,7 @@ class Parser # that contains the documentation def parse_elements(container) Puppet.debug "rdoc: scanning manifest" + @known_resource_types.hostclasses.values.sort { |a,b| a.name <=> b.name }.each do |klass| name = klass.name if klass.file == @input_file_name diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb index 626ed20eb..f243b8691 100644 --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -91,7 +91,7 @@ class Puppet::Util::Settings varname = $2 || $1 if varname == "environment" and environment environment - elsif pval = self.value(varname) + elsif pval = self.value(varname, environment) pval else raise Puppet::DevError, "Could not find value for #{value}" diff --git a/lib/puppet/util/zaml.rb b/lib/puppet/util/zaml.rb index 2155e989c..bbb2af2d2 100644 --- a/lib/puppet/util/zaml.rb +++ b/lib/puppet/util/zaml.rb @@ -60,6 +60,7 @@ class ZAML def initialize(obj,indent) @indent = indent @this_label_number = nil + @obj = obj # prevent garbage collection so that object id isn't reused end def to_s @this_label_number ? ('&id%03d%s' % [@this_label_number, @indent]) : '' diff --git a/man/man5/puppet.conf.5 b/man/man5/puppet.conf.5 index 210f36786..f6c9926c3 100644 --- a/man/man5/puppet.conf.5 +++ b/man/man5/puppet.conf.5 @@ -1,14 +1,13 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETCONF" "5" "August 2010" "" "" -\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on Sat Aug 28 14:00:20 \-0700 2010)\fR -. -.P -{:toc} +.TH "PUPPETCONF" "5" "February 2011" "Puppet Labs, LLC" "Puppet manual" +\fBThis page is autogenerated; any changes will get overwritten\fR \fI(last generated on Thu Feb 17 09:56:34 \-0800 2011)\fR . .SH "Specifying Configuration Parameters" -On The Command\-Line +++++++++++++++++++ Every Puppet executable (with the exception of \fBpuppetdoc\fR) accepts all of the parameters below, but not all of the arguments make sense for every executable\. +. +.SS "On The Command\-Line" +Every Puppet executable (with the exception of \fBpuppetdoc\fR) accepts all of the parameters below, but not all of the arguments make sense for every executable\. . .P I have tried to be as thorough as possible in the descriptions of the arguments, so it should be obvious whether an argument is appropriate or not\. @@ -44,19 +43,13 @@ $ puppet agent \-\-no\-storeconfigs .P The invocations above will enable and disable, respectively, the storage of the client configuration\. . -.P -Configuration Files +++++++++++++++++++ -. -.P +.SS "Configuration Files" As mentioned above, the configuration parameters can also be stored in a configuration file, located in the configuration directory\. As root, the default configuration directory is \fB/etc/puppet\fR, and as a regular user, the default configuration directory is \fB~user/\.puppet\fR\. As of 0\.23\.0, all executables look for \fBpuppet\.conf\fR in their configuration directory (although they previously looked for separate files)\. For example, \fBpuppet\.conf\fR is located at \fB/etc/puppet/puppet\.conf\fR as \fBroot\fR and \fB~user/\.puppet/puppet\.conf\fR as a regular user by default\. . .P All executables will set any parameters set within the \fB[main]\fR section, and each executable will also use one of the \fB[master]\fR, \fB[agent]\fR\. . .P -File Format \'\'\'\'\'\'\'\'\'\'\' -. -.P The file follows INI\-style formatting\. Here is an example of a very simple \fBpuppet\.conf\fR file: . .IP "" 4 @@ -75,14 +68,14 @@ The file follows INI\-style formatting\. Here is an example of a very simple \fB Note that boolean parameters must be explicitly specified as \fBtrue\fR or \fBfalse\fR as seen above\. . .P -If you need to change file parameters (e\.g\., reset the mode or owner), do so within curly braces on the same line: +If you need to change file or directory parameters (e\.g\., reset the mode or owner), do so within curly braces on the same line: . .IP "" 4 . .nf [main] - myfile = /tmp/whatever {owner = root, mode = 644} + vardir = /new/vardir {owner = root, mode = 644} . .fi . @@ -139,21 +132,31 @@ Sending the \fBSIGUSR1\fR signal to an instance of \fBpuppet agent\fR will cause .SH "Configuration Parameter Reference" Below is a list of all documented parameters\. Not all of them are valid with all Puppet executables, but the executables will ignore any inappropriate values\. . -.P -async_storeconfigs ++++++++++++++++++ +.SS "archive_file_server" +During an inspect run, the file bucket server to archive files to if archive_files is set\. . -.P -Whether to use a queueing system to provide asynchronous database integration\. Requires that \fBpuppetqd\fR be running and that \'PSON\' support for ruby be installed\. +.IP "\(bu" 4 +\fIDefault\fR: $server +. +.IP "" 0 +. +.SS "archive_files" +During an inspect run, whether to archive files whose contents are audited to a file bucket\. . .IP "\(bu" 4 \fIDefault\fR: false . .IP "" 0 . -.P -authconfig ++++++++++ +.SS "async_storeconfigs" +Whether to use a queueing system to provide asynchronous database integration\. Requires that \fBpuppetqd\fR be running and that \'PSON\' support for ruby be installed\. . -.P +.IP "\(bu" 4 +\fIDefault\fR: false +. +.IP "" 0 +. +.SS "authconfig" The configuration file that defines the rights to the different namespaces and methods\. This can be used as a coarse\-grained authorization system for both \fBpuppet agent\fR and \fBpuppet master\fR\. . .IP "\(bu" 4 @@ -161,10 +164,7 @@ The configuration file that defines the rights to the different namespaces and m . .IP "" 0 . -.P -autoflush +++++++++ -. -.P +.SS "autoflush" Whether log files should always flush to disk\. . .IP "\(bu" 4 @@ -172,10 +172,7 @@ Whether log files should always flush to disk\. . .IP "" 0 . -.P -autosign ++++++++ -. -.P +.SS "autosign" Whether to enable autosign\. Valid values are true (which autosigns any key request, and is a very bad idea), false (which never autosigns any key request), and the path to a file, which uses that configuration file to determine which keys to sign\. . .IP "\(bu" 4 @@ -183,16 +180,10 @@ Whether to enable autosign\. Valid values are true (which autosigns any key requ . .IP "" 0 . -.P -bindaddress +++++++++++ -. -.P +.SS "bindaddress" The address a listening server should bind to\. Mongrel servers default to 127\.0\.0\.1 and WEBrick defaults to 0\.0\.0\.0\. . -.P -bucketdir +++++++++ -. -.P +.SS "bucketdir" Where FileBucket files are stored\. . .IP "\(bu" 4 @@ -200,10 +191,7 @@ Where FileBucket files are stored\. . .IP "" 0 . -.P -ca ++ -. -.P +.SS "ca" Wether the master should function as a certificate authority\. . .IP "\(bu" 4 @@ -211,16 +199,10 @@ Wether the master should function as a certificate authority\. . .IP "" 0 . -.P -ca_days +++++++ -. -.P +.SS "ca_days" How long a certificate should be valid\. This parameter is deprecated, use ca_ttl instead . -.P -ca_md +++++ -. -.P +.SS "ca_md" The type of hash used in certificates\. . .IP "\(bu" 4 @@ -228,21 +210,15 @@ The type of hash used in certificates\. . .IP "" 0 . -.P -ca_name +++++++ -. -.P +.SS "ca_name" The name to use the Certificate Authority certificate\. . .IP "\(bu" 4 -\fIDefault\fR: $certname +\fIDefault\fR: Puppet CA: $certname . .IP "" 0 . -.P -ca_port +++++++ -. -.P +.SS "ca_port" The port to use for the certificate authority\. . .IP "\(bu" 4 @@ -250,10 +226,7 @@ The port to use for the certificate authority\. . .IP "" 0 . -.P -ca_server +++++++++ -. -.P +.SS "ca_server" The server to use for certificate authority requests\. It\'s a separate server because it cannot and does not need to horizontally scale\. . .IP "\(bu" 4 @@ -261,10 +234,7 @@ The server to use for certificate authority requests\. It\'s a separate server b . .IP "" 0 . -.P -ca_ttl ++++++ -. -.P +.SS "ca_ttl" The default TTL for new certificates; valid values must be an integer, optionally followed by one of the units \'y\' (years of 365 days), \'d\' (days), \'h\' (hours), or \'s\' (seconds)\. The unit defaults to seconds\. If this parameter is set, ca_days is ignored\. Examples are \'3600\' (one hour) and \'1825d\', which is the same as \'5y\' (5 years) . .IP "\(bu" 4 @@ -272,10 +242,7 @@ The default TTL for new certificates; valid values must be an integer, optionall . .IP "" 0 . -.P -cacert ++++++ -. -.P +.SS "cacert" The CA certificate\. . .IP "\(bu" 4 @@ -283,10 +250,7 @@ The CA certificate\. . .IP "" 0 . -.P -cacrl +++++ -. -.P +.SS "cacrl" The certificate revocation list (CRL) for the CA\. Will be used if present but otherwise ignored\. . .IP "\(bu" 4 @@ -294,10 +258,7 @@ The certificate revocation list (CRL) for the CA\. Will be used if present but o . .IP "" 0 . -.P -cadir +++++ -. -.P +.SS "cadir" The root directory for the certificate authority\. . .IP "\(bu" 4 @@ -305,10 +266,7 @@ The root directory for the certificate authority\. . .IP "" 0 . -.P -cakey +++++ -. -.P +.SS "cakey" The CA private key\. . .IP "\(bu" 4 @@ -316,10 +274,7 @@ The CA private key\. . .IP "" 0 . -.P -capass ++++++ -. -.P +.SS "capass" Where the CA stores the password for the private key . .IP "\(bu" 4 @@ -327,10 +282,7 @@ Where the CA stores the password for the private key . .IP "" 0 . -.P -caprivatedir ++++++++++++ -. -.P +.SS "caprivatedir" Where the CA stores private certificate information\. . .IP "\(bu" 4 @@ -338,10 +290,7 @@ Where the CA stores private certificate information\. . .IP "" 0 . -.P -capub +++++ -. -.P +.SS "capub" The CA public key\. . .IP "\(bu" 4 @@ -349,16 +298,10 @@ The CA public key\. . .IP "" 0 . -.P -catalog_format ++++++++++++++ -. -.P +.SS "catalog_format" (Deprecated for \'preferred_serialization_format\') What format to use to dump the catalog\. Only supports \'marshal\' and \'yaml\'\. Only matters on the client, since it asks the server for a specific format\. . -.P -catalog_terminus ++++++++++++++++ -. -.P +.SS "catalog_terminus" Where to get node catalogs\. This is useful to change if, for instance, you\'d like to pre\-compile catalogs and store them in memcached or some other easily\-accessed store\. . .IP "\(bu" 4 @@ -366,10 +309,7 @@ Where to get node catalogs\. This is useful to change if, for instance, you\'d l . .IP "" 0 . -.P -cert_inventory ++++++++++++++ -. -.P +.SS "cert_inventory" A Complete listing of all certificates . .IP "\(bu" 4 @@ -377,10 +317,7 @@ A Complete listing of all certificates . .IP "" 0 . -.P -certdir +++++++ -. -.P +.SS "certdir" The certificate directory\. . .IP "\(bu" 4 @@ -388,16 +325,10 @@ The certificate directory\. . .IP "" 0 . -.P -certdnsnames ++++++++++++ -. -.P +.SS "certdnsnames" The DNS names on the Server certificate as a colon\-separated list\. If it\'s anything other than an empty string, it will be used as an alias in the created certificate\. By default, only the server gets an alias set up, and only for \'puppet\'\. . -.P -certificate_revocation ++++++++++++++++++++++ -. -.P +.SS "certificate_revocation" Whether certificate revocation should be supported by downloading a Certificate Revocation List (CRL) to all clients\. If enabled, CA chaining will almost definitely not work\. . .IP "\(bu" 4 @@ -405,21 +336,15 @@ Whether certificate revocation should be supported by downloading a Certificate . .IP "" 0 . -.P -certname ++++++++ -. -.P +.SS "certname" The name to use when handling certificates\. Defaults to the fully qualified domain name\. . .IP "\(bu" 4 -\fIDefault\fR: pelin\.members\.linode\.com +\fIDefault\fR: magpie\.puppetlabs\.lan . .IP "" 0 . -.P -classfile +++++++++ -. -.P +.SS "classfile" The file in which puppet agent stores a list of the classes associated with the retrieved configuration\. Can be loaded in the separate \fBpuppet\fR executable using the \fB\-\-loadclasses\fR option\. . .IP "\(bu" 4 @@ -427,10 +352,7 @@ The file in which puppet agent stores a list of the classes associated with the . .IP "" 0 . -.P -client_datadir ++++++++++++++ -. -.P +.SS "client_datadir" The directory in which serialized data is stored on the client\. . .IP "\(bu" 4 @@ -438,10 +360,7 @@ The directory in which serialized data is stored on the client\. . .IP "" 0 . -.P -clientbucketdir +++++++++++++++ -. -.P +.SS "clientbucketdir" Where FileBucket files are stored locally\. . .IP "\(bu" 4 @@ -449,10 +368,7 @@ Where FileBucket files are stored locally\. . .IP "" 0 . -.P -clientyamldir +++++++++++++ -. -.P +.SS "clientyamldir" The directory in which client\-side YAML data is stored\. . .IP "\(bu" 4 @@ -460,16 +376,10 @@ The directory in which client\-side YAML data is stored\. . .IP "" 0 . -.P -code ++++ -. -.P +.SS "code" Code to parse directly\. This is essentially only used by \fBpuppet\fR, and should only be set if you\'re writing your own Puppet executable . -.P -color +++++ -. -.P +.SS "color" Whether to use colors when logging to the console\. Valid values are \fBansi\fR (equivalent to \fBtrue\fR), \fBhtml\fR (mostly used during testing with TextMate), and \fBfalse\fR, which produces no color\. . .IP "\(bu" 4 @@ -477,21 +387,15 @@ Whether to use colors when logging to the console\. Valid values are \fBansi\fR . .IP "" 0 . -.P -confdir +++++++ -. -.P -The main Puppet configuration directory\. The default for this parameter is calculated based on the user\. If the process is running as root or the user that \fBpuppet master\fR is supposed to run as, it defaults to a system directory, but if it\'s running as any other user, it defaults to being in \fB~\fR\. +.SS "confdir" +The main Puppet configuration directory\. The default for this parameter is calculated based on the user\. If the process is running as root or the user that Puppet is supposed to run as, it defaults to a system directory, but if it\'s running as any other user, it defaults to being in the user\'s home directory\. . .IP "\(bu" 4 \fIDefault\fR: /etc/puppet . .IP "" 0 . -.P -config ++++++ -. -.P +.SS "config" The configuration file for doc\. . .IP "\(bu" 4 @@ -499,22 +403,13 @@ The configuration file for doc\. . .IP "" 0 . -.P -config_version ++++++++++++++ -. -.P +.SS "config_version" How to determine the configuration version\. By default, it will be the time that the configuration is parsed, but you can provide a shell script to override how the version is determined\. The output of this script will be added to every log message in the reports, allowing you to correlate changes on your hosts to the source version on the server\. . -.P -configprint +++++++++++ -. -.P +.SS "configprint" Print the value of a specific configuration parameter\. If a parameter is provided for this, then the value is printed and puppet exits\. Comma\-separate multiple values\. For a list of all values, specify \'all\'\. This feature is only available in Puppet versions higher than 0\.18\.4\. . -.P -configtimeout +++++++++++++ -. -.P +.SS "configtimeout" How long the client should wait for the configuration to be retrieved before considering it a failure\. This can help reduce flapping if too many clients contact the server at one time\. . .IP "\(bu" 4 @@ -522,10 +417,7 @@ How long the client should wait for the configuration to be retrieved before con . .IP "" 0 . -.P -couchdb_url +++++++++++ -. -.P +.SS "couchdb_url" The url where the puppet couchdb database will be created . .IP "\(bu" 4 @@ -533,10 +425,7 @@ The url where the puppet couchdb database will be created . .IP "" 0 . -.P -csrdir ++++++ -. -.P +.SS "csrdir" Where the CA stores certificate requests . .IP "\(bu" 4 @@ -544,10 +433,7 @@ Where the CA stores certificate requests . .IP "" 0 . -.P -daemonize +++++++++ -. -.P +.SS "daemonize" Send the process into the background\. This is the default\. . .IP "\(bu" 4 @@ -555,10 +441,7 @@ Send the process into the background\. This is the default\. . .IP "" 0 . -.P -dbadapter +++++++++ -. -.P +.SS "dbadapter" The type of database to use\. . .IP "\(bu" 4 @@ -566,21 +449,10 @@ The type of database to use\. . .IP "" 0 . -.P -dbconnections +++++++++++++ -. -.P -The number of database connections\. Only used when networked databases are used\. Will be ignored if the value is an empty string or is less than 1\. -. -.IP "\(bu" 4 -\fIDefault\fR: 0 -. -.IP "" 0 +.SS "dbconnections" +The number of database connections for networked databases\. Will be ignored unless the value is a positive integer\. . -.P -dblocation ++++++++++ -. -.P +.SS "dblocation" The database cache for client configurations\. Used for querying within the language\. . .IP "\(bu" 4 @@ -588,10 +460,7 @@ The database cache for client configurations\. Used for querying within the lang . .IP "" 0 . -.P -dbmigrate +++++++++ -. -.P +.SS "dbmigrate" Whether to automatically migrate the database\. . .IP "\(bu" 4 @@ -599,10 +468,7 @@ Whether to automatically migrate the database\. . .IP "" 0 . -.P -dbname ++++++ -. -.P +.SS "dbname" The name of the database to use\. . .IP "\(bu" 4 @@ -610,10 +476,7 @@ The name of the database to use\. . .IP "" 0 . -.P -dbpassword ++++++++++ -. -.P +.SS "dbpassword" The database password for caching\. Only used when networked databases are used\. . .IP "\(bu" 4 @@ -621,16 +484,10 @@ The database password for caching\. Only used when networked databases are used\ . .IP "" 0 . -.P -dbport ++++++ -. -.P +.SS "dbport" The database password for caching\. Only used when networked databases are used\. . -.P -dbserver ++++++++ -. -.P +.SS "dbserver" The database server for caching\. Only used when networked databases are used\. . .IP "\(bu" 4 @@ -638,16 +495,10 @@ The database server for caching\. Only used when networked databases are used\. . .IP "" 0 . -.P -dbsocket ++++++++ -. -.P +.SS "dbsocket" The database socket location\. Only used when networked databases are used\. Will be ignored if the value is an empty string\. . -.P -dbuser ++++++ -. -.P +.SS "dbuser" The database user for caching\. Only used when networked databases are used\. . .IP "\(bu" 4 @@ -655,10 +506,7 @@ The database user for caching\. Only used when networked databases are used\. . .IP "" 0 . -.P -diff ++++ -. -.P +.SS "diff" Which diff command to use when printing differences between files\. . .IP "\(bu" 4 @@ -666,10 +514,7 @@ Which diff command to use when printing differences between files\. . .IP "" 0 . -.P -diff_args +++++++++ -. -.P +.SS "diff_args" Which arguments to pass to the diff command when printing differences between files\. . .IP "\(bu" 4 @@ -677,10 +522,7 @@ Which arguments to pass to the diff command when printing differences between fi . .IP "" 0 . -.P -downcasefacts +++++++++++++ -. -.P +.SS "downcasefacts" Whether facts should be made all lowercase when sent to the server\. . .IP "\(bu" 4 @@ -688,10 +530,7 @@ Whether facts should be made all lowercase when sent to the server\. . .IP "" 0 . -.P -dynamicfacts ++++++++++++ -. -.P +.SS "dynamicfacts" Facts that are dynamic; these facts will be ignored when deciding whether changed facts should result in a recompile\. Multiple facts should be comma\-separated\. . .IP "\(bu" 4 @@ -699,10 +538,7 @@ Facts that are dynamic; these facts will be ignored when deciding whether change . .IP "" 0 . -.P -environment +++++++++++ -. -.P +.SS "environment" The environment Puppet is running in\. For clients (e\.g\., \fBpuppet agent\fR) this determines the environment itself, which is used to find modules and much more\. For servers (i\.e\., \fBpuppet master\fR) this provides the default environment for nodes we know nothing about\. . .IP "\(bu" 4 @@ -710,10 +546,7 @@ The environment Puppet is running in\. For clients (e\.g\., \fBpuppet agent\fR) . .IP "" 0 . -.P -evaltrace +++++++++ -. -.P +.SS "evaltrace" Whether each resource should log when it is being evaluated\. This allows you to interactively see exactly what is being done\. . .IP "\(bu" 4 @@ -721,10 +554,7 @@ Whether each resource should log when it is being evaluated\. This allows you to . .IP "" 0 . -.P -external_nodes ++++++++++++++ -. -.P +.SS "external_nodes" An external command that can produce node information\. The output must be a YAML dump of a hash, and that hash must have one or both of \fBclasses\fR and \fBparameters\fR, where \fBclasses\fR is an array and \fBparameters\fR is a hash\. For unknown nodes, the commands should exit with a non\-zero exit code\. This command makes it straightforward to store your node mapping information in other data sources like databases\. . .IP "\(bu" 4 @@ -732,10 +562,7 @@ An external command that can produce node information\. The output must be a YAM . .IP "" 0 . -.P -factdest ++++++++ -. -.P +.SS "factdest" Where Puppet should store facts that it pulls down from the central server\. . .IP "\(bu" 4 @@ -743,10 +570,7 @@ Where Puppet should store facts that it pulls down from the central server\. . .IP "" 0 . -.P -factpath ++++++++ -. -.P +.SS "factpath" Where Puppet should look for facts\. Multiple directories should be colon\-separated, like normal PATH variables\. . .IP "\(bu" 4 @@ -754,10 +578,7 @@ Where Puppet should look for facts\. Multiple directories should be colon\-separ . .IP "" 0 . -.P -facts_terminus ++++++++++++++ -. -.P +.SS "facts_terminus" The node facts terminus\. . .IP "\(bu" 4 @@ -765,10 +586,7 @@ The node facts terminus\. . .IP "" 0 . -.P -factsignore +++++++++++ -. -.P +.SS "factsignore" What files to ignore when pulling down facts\. . .IP "\(bu" 4 @@ -776,10 +594,7 @@ What files to ignore when pulling down facts\. . .IP "" 0 . -.P -factsource ++++++++++ -. -.P +.SS "factsource" From where to retrieve facts\. The standard Puppet \fBfile\fR type is used for retrieval, so anything that is a valid file source can be used here\. . .IP "\(bu" 4 @@ -787,10 +602,7 @@ From where to retrieve facts\. The standard Puppet \fBfile\fR type is used for r . .IP "" 0 . -.P -factsync ++++++++ -. -.P +.SS "factsync" Whether facts should be synced with the central server\. . .IP "\(bu" 4 @@ -798,10 +610,7 @@ Whether facts should be synced with the central server\. . .IP "" 0 . -.P -fileserverconfig ++++++++++++++++ -. -.P +.SS "fileserverconfig" Where the fileserver configuration is stored\. . .IP "\(bu" 4 @@ -809,10 +618,7 @@ Where the fileserver configuration is stored\. . .IP "" 0 . -.P -filetimeout +++++++++++ -. -.P +.SS "filetimeout" The minimum time to wait (in seconds) between checking for updates in configuration files\. This timeout determines how quickly Puppet checks whether a file (such as manifests or templates) has changed on disk\. . .IP "\(bu" 4 @@ -820,10 +626,7 @@ The minimum time to wait (in seconds) between checking for updates in configurat . .IP "" 0 . -.P -freeze_main +++++++++++ -. -.P +.SS "freeze_main" Freezes the \'main\' class, disallowing any code to be added to it\. This essentially means that you can\'t have any code outside of a node, class, or definition other than in the site manifest\. . .IP "\(bu" 4 @@ -831,10 +634,7 @@ Freezes the \'main\' class, disallowing any code to be added to it\. This essent . .IP "" 0 . -.P -genconfig +++++++++ -. -.P +.SS "genconfig" Whether to just print a configuration to stdout and exit\. Only makes sense when used interactively\. Takes into account arguments specified on the CLI\. . .IP "\(bu" 4 @@ -842,10 +642,7 @@ Whether to just print a configuration to stdout and exit\. Only makes sense when . .IP "" 0 . -.P -genmanifest +++++++++++ -. -.P +.SS "genmanifest" Whether to just print a manifest to stdout and exit\. Only makes sense when used interactively\. Takes into account arguments specified on the CLI\. . .IP "\(bu" 4 @@ -853,10 +650,7 @@ Whether to just print a manifest to stdout and exit\. Only makes sense when used . .IP "" 0 . -.P -graph +++++ -. -.P +.SS "graph" Whether to create dot graph files for the different configuration graphs\. These dot files can be interpreted by tools like OmniGraffle or dot (which is part of ImageMagick)\. . .IP "\(bu" 4 @@ -864,10 +658,7 @@ Whether to create dot graph files for the different configuration graphs\. These . .IP "" 0 . -.P -graphdir ++++++++ -. -.P +.SS "graphdir" Where to store dot\-outputted graphs\. . .IP "\(bu" 4 @@ -875,10 +666,7 @@ Where to store dot\-outputted graphs\. . .IP "" 0 . -.P -group +++++ -. -.P +.SS "group" The group puppet master should run as\. . .IP "\(bu" 4 @@ -886,10 +674,7 @@ The group puppet master should run as\. . .IP "" 0 . -.P -hostcert ++++++++ -. -.P +.SS "hostcert" Where individual hosts store and look for their certificates\. . .IP "\(bu" 4 @@ -897,10 +682,7 @@ Where individual hosts store and look for their certificates\. . .IP "" 0 . -.P -hostcrl +++++++ -. -.P +.SS "hostcrl" Where the host\'s certificate revocation list can be found\. This is distinct from the certificate authority\'s CRL\. . .IP "\(bu" 4 @@ -908,10 +690,7 @@ Where the host\'s certificate revocation list can be found\. This is distinct fr . .IP "" 0 . -.P -hostcsr +++++++ -. -.P +.SS "hostcsr" Where individual hosts store and look for their certificate requests\. . .IP "\(bu" 4 @@ -919,10 +698,7 @@ Where individual hosts store and look for their certificate requests\. . .IP "" 0 . -.P -hostprivkey +++++++++++ -. -.P +.SS "hostprivkey" Where individual hosts store and look for their private key\. . .IP "\(bu" 4 @@ -930,10 +706,7 @@ Where individual hosts store and look for their private key\. . .IP "" 0 . -.P -hostpubkey ++++++++++ -. -.P +.SS "hostpubkey" Where individual hosts store and look for their public key\. . .IP "\(bu" 4 @@ -941,10 +714,7 @@ Where individual hosts store and look for their public key\. . .IP "" 0 . -.P -http_compression ++++++++++++++++ -. -.P +.SS "http_compression" Allow http compression in REST communication with the master\. This setting might improve performance for agent \-> master communications over slow WANs\. Your puppetmaster needs to support compression (usually by activating some settings in a reverse\-proxy in front of the puppetmaster, which rules out webrick)\. It is harmless to activate this settings if your master doesn\'t support compression, but if it supports it, this setting might reduce performance on high\-speed LANs\. . .IP "\(bu" 4 @@ -952,10 +722,7 @@ Allow http compression in REST communication with the master\. This setting migh . .IP "" 0 . -.P -http_proxy_host +++++++++++++++ -. -.P +.SS "http_proxy_host" The HTTP proxy host to use for outgoing connections\. Note: You may need to use a FQDN for the server hostname when using a proxy\. . .IP "\(bu" 4 @@ -963,10 +730,7 @@ The HTTP proxy host to use for outgoing connections\. Note: You may need to use . .IP "" 0 . -.P -http_proxy_port +++++++++++++++ -. -.P +.SS "http_proxy_port" The HTTP proxy port to use for outgoing connections . .IP "\(bu" 4 @@ -974,10 +738,7 @@ The HTTP proxy port to use for outgoing connections . .IP "" 0 . -.P -httplog +++++++ -. -.P +.SS "httplog" Where the puppet agent web server logs\. . .IP "\(bu" 4 @@ -985,10 +746,7 @@ Where the puppet agent web server logs\. . .IP "" 0 . -.P -ignorecache +++++++++++ -. -.P +.SS "ignorecache" Ignore cache and always recompile the configuration\. This is useful for testing new configurations, where the local cache may in fact be stale even if the timestamps are up to date \- if the facts change or if the server changes\. . .IP "\(bu" 4 @@ -996,10 +754,7 @@ Ignore cache and always recompile the configuration\. This is useful for testing . .IP "" 0 . -.P -ignoreimport ++++++++++++ -. -.P +.SS "ignoreimport" A parameter that can be used in commit hooks, since it enables you to parse\-check a single file rather than requiring that all files exist\. . .IP "\(bu" 4 @@ -1007,10 +762,7 @@ A parameter that can be used in commit hooks, since it enables you to parse\-che . .IP "" 0 . -.P -ignoreschedules +++++++++++++++ -. -.P +.SS "ignoreschedules" Boolean; whether puppet agent should ignore schedules\. This is useful for initial puppet agent runs\. . .IP "\(bu" 4 @@ -1018,10 +770,31 @@ Boolean; whether puppet agent should ignore schedules\. This is useful for initi . .IP "" 0 . -.P -keylength +++++++++ +.SS "inventory_port" +The port to communicate with the inventory_server\. . -.P +.IP "\(bu" 4 +\fIDefault\fR: $masterport +. +.IP "" 0 +. +.SS "inventory_server" +The server to send facts to\. +. +.IP "\(bu" 4 +\fIDefault\fR: $server +. +.IP "" 0 +. +.SS "inventory_terminus" +Should usually be the same as the facts terminus +. +.IP "\(bu" 4 +\fIDefault\fR: $facts_terminus +. +.IP "" 0 +. +.SS "keylength" The bit length of keys\. . .IP "\(bu" 4 @@ -1029,10 +802,23 @@ The bit length of keys\. . .IP "" 0 . -.P -ldapattrs +++++++++ +.SS "lastrunfile" +Where puppet agent stores the last run report summary in yaml format\. . -.P +.IP "\(bu" 4 +\fIDefault\fR: $statedir/last_run_summary\.yaml +. +.IP "" 0 +. +.SS "lastrunreport" +Where puppet agent stores the last run report in yaml format\. +. +.IP "\(bu" 4 +\fIDefault\fR: $statedir/last_run_report\.yaml +. +.IP "" 0 +. +.SS "ldapattrs" The LDAP attributes to include when querying LDAP for nodes\. All returned attributes are set as variables in the top\-level scope\. Multiple values should be comma\-separated\. The value \'all\' returns all attributes\. . .IP "\(bu" 4 @@ -1040,16 +826,10 @@ The LDAP attributes to include when querying LDAP for nodes\. All returned attri . .IP "" 0 . -.P -ldapbase ++++++++ -. -.P +.SS "ldapbase" The search base for LDAP searches\. It\'s impossible to provide a meaningful default here, although the LDAP libraries might have one already set\. Generally, it should be the \'ou=Hosts\' branch under your main directory\. . -.P -ldapclassattrs ++++++++++++++ -. -.P +.SS "ldapclassattrs" The LDAP attributes to use to define Puppet classes\. Values should be comma\-separated\. . .IP "\(bu" 4 @@ -1057,10 +837,7 @@ The LDAP attributes to use to define Puppet classes\. Values should be comma\-se . .IP "" 0 . -.P -ldapnodes +++++++++ -. -.P +.SS "ldapnodes" Whether to search for node configurations in LDAP\. See http://projects\.puppetlabs\.com/projects/puppet/wiki/LDAP_Nodes for more information\. . .IP "\(bu" 4 @@ -1068,10 +845,7 @@ Whether to search for node configurations in LDAP\. See http://projects\.puppetl . .IP "" 0 . -.P -ldapparentattr ++++++++++++++ -. -.P +.SS "ldapparentattr" The attribute to use to define the parent node\. . .IP "\(bu" 4 @@ -1079,16 +853,10 @@ The attribute to use to define the parent node\. . .IP "" 0 . -.P -ldappassword ++++++++++++ -. -.P +.SS "ldappassword" The password to use to connect to LDAP\. . -.P -ldapport ++++++++ -. -.P +.SS "ldapport" The LDAP port\. Only used if \fBldapnodes\fR is enabled\. . .IP "\(bu" 4 @@ -1096,10 +864,7 @@ The LDAP port\. Only used if \fBldapnodes\fR is enabled\. . .IP "" 0 . -.P -ldapserver ++++++++++ -. -.P +.SS "ldapserver" The LDAP server\. Only used if \fBldapnodes\fR is enabled\. . .IP "\(bu" 4 @@ -1107,10 +872,7 @@ The LDAP server\. Only used if \fBldapnodes\fR is enabled\. . .IP "" 0 . -.P -ldapssl +++++++ -. -.P +.SS "ldapssl" Whether SSL should be used when searching for nodes\. Defaults to false because SSL usually requires certificates to be set up on the client side\. . .IP "\(bu" 4 @@ -1118,10 +880,7 @@ Whether SSL should be used when searching for nodes\. Defaults to false because . .IP "" 0 . -.P -ldapstackedattrs ++++++++++++++++ -. -.P +.SS "ldapstackedattrs" The LDAP attributes that should be stacked to arrays by adding the values in all hierarchy elements of the tree\. Values should be comma\-separated\. . .IP "\(bu" 4 @@ -1129,10 +888,7 @@ The LDAP attributes that should be stacked to arrays by adding the values in all . .IP "" 0 . -.P -ldapstring ++++++++++ -. -.P +.SS "ldapstring" The search string used to find an LDAP node\. . .IP "\(bu" 4 @@ -1140,10 +896,7 @@ The search string used to find an LDAP node\. . .IP "" 0 . -.P -ldaptls +++++++ -. -.P +.SS "ldaptls" Whether TLS should be used when searching for nodes\. Defaults to false because TLS usually requires certificates to be set up on the client side\. . .IP "\(bu" 4 @@ -1151,16 +904,10 @@ Whether TLS should be used when searching for nodes\. Defaults to false because . .IP "" 0 . -.P -ldapuser ++++++++ -. -.P +.SS "ldapuser" The user to use to connect to LDAP\. Must be specified as a full DN\. . -.P -lexical +++++++ -. -.P +.SS "lexical" Whether to use lexical scoping (vs\. dynamic)\. . .IP "\(bu" 4 @@ -1168,10 +915,7 @@ Whether to use lexical scoping (vs\. dynamic)\. . .IP "" 0 . -.P -libdir ++++++ -. -.P +.SS "libdir" An extra search path for Puppet\. This is only useful for those files that Puppet will load on demand, and is only guaranteed to work for those cases\. In fact, the autoload mechanism is responsible for making sure this directory is in Ruby\'s search path . .IP "\(bu" 4 @@ -1179,10 +923,7 @@ An extra search path for Puppet\. This is only useful for those files that Puppe . .IP "" 0 . -.P -listen ++++++ -. -.P +.SS "listen" Whether puppet agent should listen for connections\. If this is true, then by default only the \fBrunner\fR server is started, which allows remote authorized and authenticated nodes to connect and trigger \fBpuppet agent\fR runs\. . .IP "\(bu" 4 @@ -1190,10 +931,7 @@ Whether puppet agent should listen for connections\. If this is true, then by de . .IP "" 0 . -.P -localcacert +++++++++++ -. -.P +.SS "localcacert" Where each client stores the CA certificate\. . .IP "\(bu" 4 @@ -1201,10 +939,7 @@ Where each client stores the CA certificate\. . .IP "" 0 . -.P -localconfig +++++++++++ -. -.P +.SS "localconfig" Where puppet agent caches the local configuration\. An extension indicating the cache format is added automatically\. . .IP "\(bu" 4 @@ -1212,10 +947,7 @@ Where puppet agent caches the local configuration\. An extension indicating the . .IP "" 0 . -.P -logdir ++++++ -. -.P +.SS "logdir" The Puppet log directory\. . .IP "\(bu" 4 @@ -1223,10 +955,7 @@ The Puppet log directory\. . .IP "" 0 . -.P -manage_internal_file_permissions ++++++++++++++++++++++++++++++++ -. -.P +.SS "manage_internal_file_permissions" Whether Puppet should manage the owner, group, and mode of files it uses internally . .IP "\(bu" 4 @@ -1234,10 +963,7 @@ Whether Puppet should manage the owner, group, and mode of files it uses interna . .IP "" 0 . -.P -manifest ++++++++ -. -.P +.SS "manifest" The entry\-point manifest for puppet master\. . .IP "\(bu" 4 @@ -1245,10 +971,7 @@ The entry\-point manifest for puppet master\. . .IP "" 0 . -.P -manifestdir +++++++++++ -. -.P +.SS "manifestdir" Where puppet master looks for its manifests\. . .IP "\(bu" 4 @@ -1256,10 +979,7 @@ Where puppet master looks for its manifests\. . .IP "" 0 . -.P -masterhttplog +++++++++++++ -. -.P +.SS "masterhttplog" Where the puppet master web server logs\. . .IP "\(bu" 4 @@ -1267,10 +987,7 @@ Where the puppet master web server logs\. . .IP "" 0 . -.P -masterlog +++++++++ -. -.P +.SS "masterlog" Where puppet master logs\. This is generally not used, since syslog is the default log destination\. . .IP "\(bu" 4 @@ -1278,10 +995,7 @@ Where puppet master logs\. This is generally not used, since syslog is the defau . .IP "" 0 . -.P -masterport ++++++++++ -. -.P +.SS "masterport" Which port puppet master listens on\. . .IP "\(bu" 4 @@ -1289,10 +1003,7 @@ Which port puppet master listens on\. . .IP "" 0 . -.P -maximum_uid +++++++++++ -. -.P +.SS "maximum_uid" The maximum allowed UID\. Some platforms use negative UIDs but then ship with tools that do not know how to handle signed ints, so the UIDs show up as huge numbers that can then not be fed back into the system\. This is a hackish way to fail in a slightly more useful way when that happens\. . .IP "\(bu" 4 @@ -1300,10 +1011,7 @@ The maximum allowed UID\. Some platforms use negative UIDs but then ship with to . .IP "" 0 . -.P -mkusers +++++++ -. -.P +.SS "mkusers" Whether to create the necessary user and group that puppet agent will run as\. . .IP "\(bu" 4 @@ -1311,10 +1019,7 @@ Whether to create the necessary user and group that puppet agent will run as\. . .IP "" 0 . -.P -modulepath ++++++++++ -. -.P +.SS "modulepath" The search path for modules as a colon\-separated list of directories\. . .IP "\(bu" 4 @@ -1322,10 +1027,7 @@ The search path for modules as a colon\-separated list of directories\. . .IP "" 0 . -.P -name ++++ -. -.P +.SS "name" The name of the application, if we are running as one\. The default is essentially $0 without the path or \fB\.rb\fR\. . .IP "\(bu" 4 @@ -1333,10 +1035,7 @@ The name of the application, if we are running as one\. The default is essential . .IP "" 0 . -.P -node_name +++++++++ -. -.P +.SS "node_name" How the puppetmaster determines the client\'s identity and sets the \'hostname\', \'fqdn\' and \'domain\' facts for use in the manifest, in particular for determining which \'node\' statement applies to the client\. Possible values are \'cert\' (use the subject\'s CN in the client\'s certificate) and \'facter\' (use the hostname that the client reported in its facts) . .IP "\(bu" 4 @@ -1344,10 +1043,7 @@ How the puppetmaster determines the client\'s identity and sets the \'hostname\' . .IP "" 0 . -.P -node_terminus +++++++++++++ -. -.P +.SS "node_terminus" Where to find information about nodes\. . .IP "\(bu" 4 @@ -1355,10 +1051,7 @@ Where to find information about nodes\. . .IP "" 0 . -.P -noop ++++ -. -.P +.SS "noop" Whether puppet agent should be run in noop mode\. . .IP "\(bu" 4 @@ -1366,10 +1059,7 @@ Whether puppet agent should be run in noop mode\. . .IP "" 0 . -.P -onetime +++++++ -. -.P +.SS "onetime" Run the configuration once, rather than as a long\-running daemon\. This is useful for interactively running puppetd\. . .IP "\(bu" 4 @@ -1377,10 +1067,7 @@ Run the configuration once, rather than as a long\-running daemon\. This is usef . .IP "" 0 . -.P -parseonly +++++++++ -. -.P +.SS "parseonly" Just check the syntax of the manifests\. . .IP "\(bu" 4 @@ -1388,10 +1075,7 @@ Just check the syntax of the manifests\. . .IP "" 0 . -.P -passfile ++++++++ -. -.P +.SS "passfile" Where puppet agent stores the password for its private key\. Generally unused\. . .IP "\(bu" 4 @@ -1399,10 +1083,7 @@ Where puppet agent stores the password for its private key\. Generally unused\. . .IP "" 0 . -.P -path ++++ -. -.P +.SS "path" The shell search path\. Defaults to whatever is inherited from the parent process\. . .IP "\(bu" 4 @@ -1410,10 +1091,7 @@ The shell search path\. Defaults to whatever is inherited from the parent proces . .IP "" 0 . -.P -pidfile +++++++ -. -.P +.SS "pidfile" The pid file . .IP "\(bu" 4 @@ -1421,10 +1099,7 @@ The pid file . .IP "" 0 . -.P -plugindest ++++++++++ -. -.P +.SS "plugindest" Where Puppet should store plugins that it pulls down from the central server\. . .IP "\(bu" 4 @@ -1432,10 +1107,7 @@ Where Puppet should store plugins that it pulls down from the central server\. . .IP "" 0 . -.P -pluginsignore +++++++++++++ -. -.P +.SS "pluginsignore" What files to ignore when pulling down plugins\. . .IP "\(bu" 4 @@ -1443,10 +1115,7 @@ What files to ignore when pulling down plugins\. . .IP "" 0 . -.P -pluginsource ++++++++++++ -. -.P +.SS "pluginsource" From where to retrieve plugins\. The standard Puppet \fBfile\fR type is used for retrieval, so anything that is a valid file source can be used here\. . .IP "\(bu" 4 @@ -1454,10 +1123,7 @@ From where to retrieve plugins\. The standard Puppet \fBfile\fR type is used for . .IP "" 0 . -.P -pluginsync ++++++++++ -. -.P +.SS "pluginsync" Whether plugins should be synced with the central server\. . .IP "\(bu" 4 @@ -1465,16 +1131,10 @@ Whether plugins should be synced with the central server\. . .IP "" 0 . -.P -postrun_command +++++++++++++++ -. -.P +.SS "postrun_command" A command to run after every agent run\. If this command returns a non\-zero return code, the entire Puppet run will be considered to have failed, even though it might have performed work during the normal run\. . -.P -preferred_serialization_format ++++++++++++++++++++++++++++++ -. -.P +.SS "preferred_serialization_format" The preferred means of serializing ruby instances for passing over the wire\. This won\'t guarantee that all instances will be serialized using this method, since not all classes can be guaranteed to support this format, but it will be used for all classes that support it\. . .IP "\(bu" 4 @@ -1482,16 +1142,10 @@ The preferred means of serializing ruby instances for passing over the wire\. Th . .IP "" 0 . -.P -prerun_command ++++++++++++++ -. -.P +.SS "prerun_command" A command to run before every agent run\. If this command returns a non\-zero return code, the entire Puppet run will fail\. . -.P -privatedir ++++++++++ -. -.P +.SS "privatedir" Where the client stores private certificate information\. . .IP "\(bu" 4 @@ -1499,10 +1153,7 @@ Where the client stores private certificate information\. . .IP "" 0 . -.P -privatekeydir +++++++++++++ -. -.P +.SS "privatekeydir" The private key directory\. . .IP "\(bu" 4 @@ -1510,10 +1161,7 @@ The private key directory\. . .IP "" 0 . -.P -publickeydir ++++++++++++ -. -.P +.SS "publickeydir" The public key directory\. . .IP "\(bu" 4 @@ -1521,10 +1169,7 @@ The public key directory\. . .IP "" 0 . -.P -puppetdlockfile +++++++++++++++ -. -.P +.SS "puppetdlockfile" A lock file to temporarily stop puppet agent from doing anything\. . .IP "\(bu" 4 @@ -1532,10 +1177,7 @@ A lock file to temporarily stop puppet agent from doing anything\. . .IP "" 0 . -.P -puppetdlog ++++++++++ -. -.P +.SS "puppetdlog" The log file for puppet agent\. This is generally not used\. . .IP "\(bu" 4 @@ -1543,10 +1185,7 @@ The log file for puppet agent\. This is generally not used\. . .IP "" 0 . -.P -puppetport ++++++++++ -. -.P +.SS "puppetport" Which port puppet agent listens on\. . .IP "\(bu" 4 @@ -1554,10 +1193,7 @@ Which port puppet agent listens on\. . .IP "" 0 . -.P -queue_source ++++++++++++ -. -.P +.SS "queue_source" Which type of queue to use for asynchronous processing\. If your stomp server requires authentication, you can include it in the URI as long as your stomp client library is at least 1\.1\.1 . .IP "\(bu" 4 @@ -1565,10 +1201,7 @@ Which type of queue to use for asynchronous processing\. If your stomp server re . .IP "" 0 . -.P -queue_type ++++++++++ -. -.P +.SS "queue_type" Which type of queue to use for asynchronous processing\. . .IP "\(bu" 4 @@ -1576,10 +1209,7 @@ Which type of queue to use for asynchronous processing\. . .IP "" 0 . -.P -rails_loglevel ++++++++++++++ -. -.P +.SS "rails_loglevel" The log level for Rails connections\. The value must be a valid log level within Rails\. Production environments normally use \fBinfo\fR and other environments normally use \fBdebug\fR\. . .IP "\(bu" 4 @@ -1587,10 +1217,7 @@ The log level for Rails connections\. The value must be a valid log level within . .IP "" 0 . -.P -railslog ++++++++ -. -.P +.SS "railslog" Where Rails\-specific logs are sent . .IP "\(bu" 4 @@ -1598,21 +1225,15 @@ Where Rails\-specific logs are sent . .IP "" 0 . -.P -report ++++++ -. -.P +.SS "report" Whether to send reports after every transaction\. . .IP "\(bu" 4 -\fIDefault\fR: false +\fIDefault\fR: true . .IP "" 0 . -.P -report_port +++++++++++ -. -.P +.SS "report_port" The port to communicate with the report_server\. . .IP "\(bu" 4 @@ -1620,21 +1241,15 @@ The port to communicate with the report_server\. . .IP "" 0 . -.P -report_server +++++++++++++ -. -.P -The server to which to send transaction reports\. +.SS "report_server" +The server to send transaction reports to\. . .IP "\(bu" 4 \fIDefault\fR: $server . .IP "" 0 . -.P -reportdir +++++++++ -. -.P +.SS "reportdir" The directory in which to store reports received from the client\. Each client gets a separate subdirectory\. . .IP "\(bu" 4 @@ -1642,21 +1257,15 @@ The directory in which to store reports received from the client\. Each client g . .IP "" 0 . -.P -reportfrom ++++++++++ -. -.P +.SS "reportfrom" The \'from\' email address for the reports\. . .IP "\(bu" 4 -\fIDefault\fR: report@pelin\.members\.linode\.com +\fIDefault\fR: report@magpie\.puppetlabs\.lan . .IP "" 0 . -.P -reports +++++++ -. -.P +.SS "reports" The list of reports to generate\. All reports are looked for in \fBpuppet/reports/name\.rb\fR, and multiple report names should be comma\-separated (whitespace is okay)\. . .IP "\(bu" 4 @@ -1664,10 +1273,7 @@ The list of reports to generate\. All reports are looked for in \fBpuppet/report . .IP "" 0 . -.P -reportserver ++++++++++++ -. -.P +.SS "reportserver" (Deprecated for \'report_server\') The server to which to send transaction reports\. . .IP "\(bu" 4 @@ -1675,10 +1281,7 @@ reportserver ++++++++++++ . .IP "" 0 . -.P -reporturl +++++++++ -. -.P +.SS "reporturl" The URL used by the http reports processor to send reports . .IP "\(bu" 4 @@ -1686,10 +1289,7 @@ The URL used by the http reports processor to send reports . .IP "" 0 . -.P -req_bits ++++++++ -. -.P +.SS "req_bits" The bit length of the certificates\. . .IP "\(bu" 4 @@ -1697,10 +1297,7 @@ The bit length of the certificates\. . .IP "" 0 . -.P -requestdir ++++++++++ -. -.P +.SS "requestdir" Where host certificate requests are stored\. . .IP "\(bu" 4 @@ -1708,10 +1305,7 @@ Where host certificate requests are stored\. . .IP "" 0 . -.P -rest_authconfig +++++++++++++++ -. -.P +.SS "rest_authconfig" The configuration file that defines the rights to the different rest indirections\. This can be used as a fine\-grained authorization system for \fBpuppet master\fR\. . .IP "\(bu" 4 @@ -1719,10 +1313,7 @@ The configuration file that defines the rights to the different rest indirection . .IP "" 0 . -.P -rrddir ++++++ -. -.P +.SS "rrddir" The directory where RRD database files are stored\. Directories for each reporting host will be created under this directory\. . .IP "\(bu" 4 @@ -1730,10 +1321,7 @@ The directory where RRD database files are stored\. Directories for each reporti . .IP "" 0 . -.P -rrdinterval +++++++++++ -. -.P +.SS "rrdinterval" How often RRD should expect data\. This should match how often the hosts report back to the server\. . .IP "\(bu" 4 @@ -1741,10 +1329,7 @@ How often RRD should expect data\. This should match how often the hosts report . .IP "" 0 . -.P -run_mode ++++++++ -. -.P +.SS "run_mode" The effective \'run mode\' of the application: master, agent, or user\. . .IP "\(bu" 4 @@ -1752,10 +1337,7 @@ The effective \'run mode\' of the application: master, agent, or user\. . .IP "" 0 . -.P -rundir ++++++ -. -.P +.SS "rundir" Where Puppet PID files are kept\. . .IP "\(bu" 4 @@ -1763,10 +1345,7 @@ Where Puppet PID files are kept\. . .IP "" 0 . -.P -runinterval +++++++++++ -. -.P +.SS "runinterval" How often puppet agent applies the client configuration; in seconds\. . .IP "\(bu" 4 @@ -1774,10 +1353,7 @@ How often puppet agent applies the client configuration; in seconds\. . .IP "" 0 . -.P -sendmail ++++++++ -. -.P +.SS "sendmail" Where to find the sendmail binary with which to send email\. . .IP "\(bu" 4 @@ -1785,10 +1361,7 @@ Where to find the sendmail binary with which to send email\. . .IP "" 0 . -.P -serial ++++++ -. -.P +.SS "serial" Where the serial number for certificates is stored\. . .IP "\(bu" 4 @@ -1796,10 +1369,7 @@ Where the serial number for certificates is stored\. . .IP "" 0 . -.P -server ++++++ -. -.P +.SS "server" The server to which server puppet agent should connect . .IP "\(bu" 4 @@ -1807,10 +1377,7 @@ The server to which server puppet agent should connect . .IP "" 0 . -.P -server_datadir ++++++++++++++ -. -.P +.SS "server_datadir" The directory in which serialized data is stored, usually in a subdirectory\. . .IP "\(bu" 4 @@ -1818,10 +1385,7 @@ The directory in which serialized data is stored, usually in a subdirectory\. . .IP "" 0 . -.P -servertype ++++++++++ -. -.P +.SS "servertype" The type of server to use\. Currently supported options are webrick and mongrel\. If you use mongrel, you will need a proxy in front of the process or processes, since Mongrel cannot speak SSL\. . .IP "\(bu" 4 @@ -1829,10 +1393,7 @@ The type of server to use\. Currently supported options are webrick and mongrel\ . .IP "" 0 . -.P -show_diff +++++++++ -. -.P +.SS "show_diff" Whether to print a contextual diff when files are being replaced\. The diff is printed on stdout, so this option is meaningless unless you are running Puppet interactively\. This feature currently requires the \fBdiff/lcs\fR Ruby library\. . .IP "\(bu" 4 @@ -1840,10 +1401,7 @@ Whether to print a contextual diff when files are being replaced\. The diff is p . .IP "" 0 . -.P -signeddir +++++++++ -. -.P +.SS "signeddir" Where the CA stores signed certificates\. . .IP "\(bu" 4 @@ -1851,10 +1409,7 @@ Where the CA stores signed certificates\. . .IP "" 0 . -.P -smtpserver ++++++++++ -. -.P +.SS "smtpserver" The server through which to send email reports\. . .IP "\(bu" 4 @@ -1862,10 +1417,7 @@ The server through which to send email reports\. . .IP "" 0 . -.P -splay +++++ -. -.P +.SS "splay" Whether to sleep for a pseudo\-random (but consistent) amount of time before a run\. . .IP "\(bu" 4 @@ -1873,10 +1425,7 @@ Whether to sleep for a pseudo\-random (but consistent) amount of time before a r . .IP "" 0 . -.P -splaylimit ++++++++++ -. -.P +.SS "splaylimit" The maximum time to delay before runs\. Defaults to being the same as the run interval\. . .IP "\(bu" 4 @@ -1884,10 +1433,7 @@ The maximum time to delay before runs\. Defaults to being the same as the run in . .IP "" 0 . -.P -ssl_client_header +++++++++++++++++ -. -.P +.SS "ssl_client_header" The header containing an authenticated client\'s SSL DN\. Only used with Mongrel\. This header must be set by the proxy to the authenticated client\'s SSL DN (e\.g\., \fB/CN=puppet\.puppetlabs\.com\fR)\. See http://projects\.puppetlabs\.com/projects/puppet/wiki/Using_Mongrel for more information\. . .IP "\(bu" 4 @@ -1895,10 +1441,7 @@ The header containing an authenticated client\'s SSL DN\. Only used with Mongrel . .IP "" 0 . -.P -ssl_client_verify_header ++++++++++++++++++++++++ -. -.P +.SS "ssl_client_verify_header" The header containing the status message of the client verification\. Only used with Mongrel\. This header must be set by the proxy to \'SUCCESS\' if the client successfully authenticated, and anything else otherwise\. See http://projects\.puppetlabs\.com/projects/puppet/wiki/Using_Mongrel for more information\. . .IP "\(bu" 4 @@ -1906,10 +1449,7 @@ The header containing the status message of the client verification\. Only used . .IP "" 0 . -.P -ssldir ++++++ -. -.P +.SS "ssldir" Where SSL certificates are kept\. . .IP "\(bu" 4 @@ -1917,10 +1457,7 @@ Where SSL certificates are kept\. . .IP "" 0 . -.P -statedir ++++++++ -. -.P +.SS "statedir" The directory where Puppet state is stored\. Generally, this directory can be removed without causing harm (although it might result in spurious service restarts)\. . .IP "\(bu" 4 @@ -1928,10 +1465,7 @@ The directory where Puppet state is stored\. Generally, this directory can be re . .IP "" 0 . -.P -statefile +++++++++ -. -.P +.SS "statefile" Where puppet agent and puppet master store state associated with the running configuration\. In the case of puppet master, this file reflects the state discovered through interacting with clients\. . .IP "\(bu" 4 @@ -1939,10 +1473,7 @@ Where puppet agent and puppet master store state associated with the running con . .IP "" 0 . -.P -storeconfigs ++++++++++++ -. -.P +.SS "storeconfigs" Whether to store each client\'s configuration\. This requires ActiveRecord from Ruby on Rails\. . .IP "\(bu" 4 @@ -1950,10 +1481,7 @@ Whether to store each client\'s configuration\. This requires ActiveRecord from . .IP "" 0 . -.P -strict_hostname_checking ++++++++++++++++++++++++ -. -.P +.SS "strict_hostname_checking" Whether to only search for the complete hostname as it is in the certificate when searching for node information in the catalogs\. . .IP "\(bu" 4 @@ -1961,10 +1489,7 @@ Whether to only search for the complete hostname as it is in the certificate whe . .IP "" 0 . -.P -summarize +++++++++ -. -.P +.SS "summarize" Whether to print a transaction summary\. . .IP "\(bu" 4 @@ -1972,10 +1497,7 @@ Whether to print a transaction summary\. . .IP "" 0 . -.P -syslogfacility ++++++++++++++ -. -.P +.SS "syslogfacility" What syslog facility to use when logging to syslog\. Syslog has a fixed list of valid facilities, and you must choose one of those; you cannot just make one up\. . .IP "\(bu" 4 @@ -1983,10 +1505,7 @@ What syslog facility to use when logging to syslog\. Syslog has a fixed list of . .IP "" 0 . -.P -tagmap ++++++ -. -.P +.SS "tagmap" The mapping between reporting tags and email addresses\. . .IP "\(bu" 4 @@ -1994,16 +1513,10 @@ The mapping between reporting tags and email addresses\. . .IP "" 0 . -.P -tags ++++ -. -.P +.SS "tags" Tags to use to find resources\. If this is set, then only resources tagged with the specified tags will be applied\. Values must be comma\-separated\. . -.P -templatedir +++++++++++ -. -.P +.SS "templatedir" Where Puppet looks for template files\. Can be a list of colon\-seperated directories\. . .IP "\(bu" 4 @@ -2011,10 +1524,7 @@ Where Puppet looks for template files\. Can be a list of colon\-seperated direct . .IP "" 0 . -.P -thin_storeconfigs +++++++++++++++++ -. -.P +.SS "thin_storeconfigs" Boolean; wether storeconfigs store in the database only the facts and exported resources\. If true, then storeconfigs performance will be higher and still allow exported/collected resources, but other usage external to Puppet might not work . .IP "\(bu" 4 @@ -2022,10 +1532,7 @@ Boolean; wether storeconfigs store in the database only the facts and exported r . .IP "" 0 . -.P -trace +++++ -. -.P +.SS "trace" Whether to print stack traces on some errors . .IP "\(bu" 4 @@ -2033,10 +1540,7 @@ Whether to print stack traces on some errors . .IP "" 0 . -.P -use_cached_catalog ++++++++++++++++++ -. -.P +.SS "use_cached_catalog" Whether to only use the cached catalog rather than compiling a new catalog on every run\. Puppet can be run with this enabled by default and then selectively disabled when a recompile is desired\. . .IP "\(bu" 4 @@ -2044,10 +1548,7 @@ Whether to only use the cached catalog rather than compiling a new catalog on ev . .IP "" 0 . -.P -usecacheonfailure +++++++++++++++++ -. -.P +.SS "usecacheonfailure" Whether to use the cached configuration when the remote configuration will not compile\. This option is useful for testing new configurations, where you want to fix the broken configuration rather than reverting to a known\-good one\. . .IP "\(bu" 4 @@ -2055,10 +1556,7 @@ Whether to use the cached configuration when the remote configuration will not c . .IP "" 0 . -.P -user ++++ -. -.P +.SS "user" The user puppet master should run as\. . .IP "\(bu" 4 @@ -2066,10 +1564,7 @@ The user puppet master should run as\. . .IP "" 0 . -.P -vardir ++++++ -. -.P +.SS "vardir" Where Puppet stores dynamic and growing data\. The default for this parameter is calculated specially, like \fBconfdir\fR_\. . .IP "\(bu" 4 @@ -2077,10 +1572,7 @@ Where Puppet stores dynamic and growing data\. The default for this parameter is . .IP "" 0 . -.P -yamldir +++++++ -. -.P +.SS "yamldir" The directory in which YAML data is stored, usually in a subdirectory\. . .IP "\(bu" 4 @@ -2088,10 +1580,7 @@ The directory in which YAML data is stored, usually in a subdirectory\. . .IP "" 0 . -.P -zlib ++++ -. -.P +.SS "zlib" Boolean; whether to use the zlib library . .IP "\(bu" 4 @@ -2100,4 +1589,4 @@ Boolean; whether to use the zlib library .IP "" 0 . .P -\fIThis page autogenerated on Sat Aug 28 14:00:20 \-0700 2010\fR +\fIThis page autogenerated on Thu Feb 17 09:56:34 \-0800 2011\fR diff --git a/man/man8/filebucket.8 b/man/man8/filebucket.8 index 59afc2ed3..7ff0da9af 100644 --- a/man/man8/filebucket.8 +++ b/man/man8/filebucket.8 @@ -1,105 +1,81 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "FILEBUCKET" "8" "August 2010" "" "" -A stand\-alone Puppet filebucket client\.puppet filebucket [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] +.TH "PUPPET\-FILEBUCKET" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket . -.nf - - [\-l|\-\-local] [\-r|\-\-remote] - [\-s|\-\-server <server>] [\-b|\-\-bucket <directory>] <file> <file> \.\.\. +.SH "SYNOPSIS" +A stand\-alone Puppet filebucket client\. . -.fi -. -.IP "" 0 -This is a stand\-alone filebucket client for sending files to a local or central filebucket\.This client can operate in three modes, with only one mode per call: +.SH "USAGE" +puppet filebucket \fImode\fR [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-l|\-\-local] [\-r|\-\-remote] [\-s|\-\-server \fIserver\fR] [\-b|\-\-bucket \fIdirectory\fR] \fIfile\fR \fIfile\fR \.\.\. . .P -backup: Send one or more files to the specified file bucket\. Each sent -. -.IP "" 4 -. -.nf - - file is printed with its resulting md5 sum\. -. -.fi -. -.IP "" 0 +Puppet filebucket can operate in three modes, with only one mode per call: . .P -get: Return the text associated with an md5 sum\. The text is printed -. -.IP "" 4 -. -.nf - - to stdout, and only one file can be retrieved at a time\. -. -.fi -. -.IP "" 0 +backup: Send one or more files to the specified file bucket\. Each sent file is printed with its resulting md5 sum\. . .P -restore: Given a file path and an md5 sum, store the content associated -. -.IP "" 4 +get: Return the text associated with an md5 sum\. The text is printed to stdout, and only one file can be retrieved at a time\. . -.nf - - with the sum into the specified file path\. You can specify an - entirely new path to this argument; you are not restricted to - restoring the content to its original location\. -. -.fi +.P +restore: Given a file path and an md5 sum, store the content associated with the sum into the specified file path\. You can specify an entirely new path to this argument; you are not restricted to restoring the content to its original location\. . -.IP "" 0 +.SH "DESCRIPTION" +This is a stand\-alone filebucket client for sending files to a local or central filebucket\. . .P -Note that +filebucket+ defaults to using a network\-based filebucket available on the server named +puppet+\. To use this, you\'ll have to be running as a user with valid Puppet certificates\. Alternatively, you can use your local file bucket by specifying +\-\-local+\.$ puppet filebucket backup /etc/passwd /etc/passwd: 429b225650b912a2ee067b0a4cf1e949 $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 $Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +Note that \'filebucket\' defaults to using a network\-based filebucket available on the server named \'puppet\'\. To use this, you\'ll have to be running as a user with valid Puppet certificates\. Alternatively, you can use your local file bucket by specifying \'\-\-local\'\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. . .P See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. . -.P -debug: Enable full debugging\. +.TP +\-\-debug +Enable full debugging\. . -.P -help: Print this help message +.TP +\-\-help +Print this help message . -.P -local: Use the local filebucket\. This will use the default +.TP +\-\-local +Use the local filebucket\. This will use the default configuration information\. . -.IP "" 4 +.TP +\-\-remote +Use a remote filebucket\. This will use the default configuration information\. . -.nf - - configuration information\. +.TP +\-\-server +The server to send the file to, instead of locally\. . -.fi +.TP +\-\-verbose +Print extra information\. . -.IP "" 0 +.TP +\-\-version +Print version information\. . -.P -remote: Use a remote filebucket\. This will use the default -. -.IP "" 4 +.SH "EXAMPLE" . .nf - configuration information\. +$ puppet filebucket backup /etc/passwd +/etc/passwd: 429b225650b912a2ee067b0a4cf1e949 +$ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 . .fi . -.IP "" 0 +.SH "AUTHOR" +Luke Kanies . -.P -server: The server to send the file to, instead of locally\. -. -.P -verbose: Print extra information\. -. -.P -version: Print version information\.puppet filebucket \-b /tmp/filebucket /my/fileLuke KaniesCopyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/pi.8 b/man/man8/pi.8 index b70a128e7..c54a7bec7 100644 --- a/man/man8/pi.8 +++ b/man/man8/pi.8 @@ -1,17 +1,51 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PI" "8" "August 2010" "" "" -Print help about puppet types on the console\. Run with \'\-h\' to get detailed help\.puppet describe [\-h|\-\-help] [\-s|\-\-short] [\-p|\-\-providers] [\-l|\-\-list] [\-m|\-\-meta]Prints details of Puppet types, providers and metaparameters on the console\.help: Print this help text +.TH "PUPPET\-DESCRIBE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.P -providers: Describe providers in detail for each type +.SH "NAME" +\fBpuppet\-describe\fR \- Display help about resource types . -.P -list: List all types +.SH "SYNOPSIS" +Prints help about Puppet resource types, providers, and metaparameters\. . -.P -meta: List all metaparameters +.SH "USAGE" +puppet describe [\-h|\-\-help] [\-s|\-\-short] [\-p|\-\-providers] [\-l|\-\-list] [\-m|\-\-meta] . -.P -short: List only parameters without detailpuppet describe \-\-list puppet describe file \-\-providers puppet describe user \-s \-mDavid LutterkortCopyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License +.SH "OPTIONS" +. +.TP +\-\-help +Print this help text +. +.TP +\-\-providers +Describe providers in detail for each type +. +.TP +\-\-list +List all types +. +.TP +\-\-meta +List all metaparameters +. +.TP +\-\-short +List only parameters without detail +. +.SH "EXAMPLE" +. +.nf + +$ puppet describe \-\-list +$ puppet describe file \-\-providers +$ puppet describe user \-s \-m +. +.fi +. +.SH "AUTHOR" +David Lutterkort +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-agent.8 b/man/man8/puppet-agent.8 new file mode 100644 index 000000000..3fadd9df7 --- /dev/null +++ b/man/man8/puppet-agent.8 @@ -0,0 +1,139 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-AGENT" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-agent\fR \- The puppet agent daemon +. +.SH "SYNOPSIS" +Retrieves the client configuration from the puppet master and applies it to the local host\. +. +.P +This service may be run as a daemon, run periodically using cron (or something similar), or run interactively for testing purposes\. +. +.SH "USAGE" +puppet agent [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-\-detailed\-exitcodes] [\-\-disable] [\-\-enable] [\-h|\-\-help] [\-\-certname \fIhost name\fR] [\-l|\-\-logdest syslog|\fIfile\fR|console] [\-o|\-\-onetime] [\-\-serve \fIhandler\fR] [\-t|\-\-test] [\-\-noop] [\-\-digest \fIdigest\fR] [\-\-fingerprint] [\-V|\-\-version] [\-v|\-\-verbose] [\-w|\-\-waitforcert \fIseconds\fR] +. +.SH "DESCRIPTION" +This is the main puppet client\. Its job is to retrieve the local machine\'s configuration from a remote server and apply it\. In order to successfully communicate with the remote server, the client must have a certificate signed by a certificate authority that the server trusts; the recommended method for this, at the moment, is to run a certificate authority as part of the puppet server (which is the default)\. The client will connect and request a signed certificate, and will continue connecting until it receives one\. +. +.P +Once the client has a signed certificate, it will retrieve its configuration and apply it\. +. +.SH "USAGE NOTES" +\'puppet agent\' does its best to find a compromise between interactive use and daemon use\. Run with no arguments and no configuration, it will go into the background, attempt to get a signed certificate, and retrieve and apply its configuration every 30 minutes\. +. +.P +Some flags are meant specifically for interactive use \-\- in particular, \'test\', \'tags\' or \'fingerprint\' are useful\. \'test\' enables verbose logging, causes the daemon to stay in the foreground, exits if the server\'s configuration is invalid (this happens if, for instance, you\'ve left a syntax error on the server), and exits after running the configuration once (rather than hanging around as a long\-running process)\. +. +.P +\'tags\' allows you to specify what portions of a configuration you want to apply\. Puppet elements are tagged with all of the class or definition names that contain them, and you can use the \'tags\' flag to specify one of these names, causing only configuration elements contained within that class or definition to be applied\. This is very useful when you are testing new configurations \-\- for instance, if you are just starting to manage \'ntpd\', you would put all of the new elements into an \'ntpd\' class, and call puppet with \'\-\-tags ntpd\', which would only apply that small portion of the configuration during your testing, rather than applying the whole thing\. +. +.P +\'fingerprint\' is a one\-time flag\. In this mode \'puppet agent\' will run once and display on the console (and in the log) the current certificate (or certificate request) fingerprint\. Providing the \'\-\-digest\' option allows to use a different digest algorithm to generate the fingerprint\. The main use is to verify that before signing a certificate request on the master, the certificate request the master received is the same as the one the client sent (to prevent against man\-in\-the\-middle attacks when signing certificates)\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet agent with \'\-\-genconfig\'\. +. +.TP +\-\-daemonize +Send the process into the background\. This is the default\. +. +.TP +\-\-no\-daemonize +Do not send the process into the background\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-digest +Change the certificate fingerprinting digest algorithm\. The default is MD5\. Valid values depends on the version of OpenSSL installed, but should always at least contain MD5, MD2, SHA1 and SHA256\. +. +.TP +\-\-detailed\-exitcodes +Provide transaction information via exit codes\. If this is enabled, an exit code of \'2\' means there were changes, and an exit code of \'4\' means that there were failures during the transaction\. This option only makes sense in conjunction with \-\-onetime\. +. +.TP +\-\-disable +Disable working on the local system\. This puts a lock file in place, causing \'puppet agent\' not to work on the system until the lock file is removed\. This is useful if you are testing a configuration and do not want the central configuration to override the local state until everything is tested and committed\. +. +.IP +\'puppet agent\' uses the same lock file while it is running, so no more than one \'puppet agent\' process is working at a time\. +. +.IP +\'puppet agent\' exits after executing this\. +. +.TP +\-\-enable +Enable working on the local system\. This removes any lock file, causing \'puppet agent\' to start managing the local system again (although it will continue to use its normal scheduling, so it might not start for another half hour)\. +. +.IP +\'puppet agent\' exits after executing this\. +. +.TP +\-\-certname +Set the certname (unique ID) of the client\. The master reads this unique identifying string, which is usually set to the node\'s fully\-qualified domain name, to determine which configurations the node will receive\. Use this option to debug setup problems or implement unusual node identification schemes\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-logdest +Where to send messages\. Choose between syslog, the console, and a log file\. Defaults to sending messages to syslog, or the console if debugging or verbosity is enabled\. +. +.TP +\-\-no\-client +Do not create a config client\. This will cause the daemon to run without ever checking for its configuration automatically, and only makes sense +. +.TP +\-\-onetime +Run the configuration once\. Runs a single (normally daemonized) Puppet run\. Useful for interactively running puppet agent when used in conjunction with the \-\-no\-daemonize option\. +. +.TP +\-\-fingerprint +Display the current certificate or certificate signing request fingerprint and then exit\. Use the \'\-\-digest\' option to change the digest algorithm used\. +. +.TP +\-\-serve +Start another type of server\. By default, \'puppet agent\' will start a service handler that allows authenticated and authorized remote nodes to trigger the configuration to be pulled down and applied\. You can specify any handler here that does not require configuration, e\.g\., filebucket, ca, or resource\. The handlers are in \'lib/puppet/network/handler\', and the names must match exactly, both in the call to \'serve\' and in \'namespaceauth\.conf\'\. +. +.TP +\-\-test +Enable the most common options used for testing\. These are \'onetime\', \'verbose\', \'ignorecache\', \'no\-daemonize\', \'no\-usecacheonfailure\', \'detailed\-exit\-codes\', \'no\-splay\', and \'show_diff\'\. +. +.TP +\-\-noop +Use \'noop\' mode where the daemon runs in a no\-op or dry\-run mode\. This is useful for seeing what changes Puppet will make without actually executing the changes\. +. +.TP +\-\-verbose +Turn on verbose reporting\. +. +.TP +\-\-version +Print the puppet version number and exit\. +. +.TP +\-\-waitforcert +This option only matters for daemons that do not yet have certificates and it is enabled by default, with a value of 120 (seconds)\. This causes \'puppet agent\' to connect to the server every 2 minutes and ask it to sign a certificate request\. This is useful for the initial setup of a puppet client\. You can turn off waiting for certificates by specifying a time of 0\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet agent \-\-server puppet\.domain\.com +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005, 2006 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-apply.8 b/man/man8/puppet-apply.8 new file mode 100644 index 000000000..d8d864b56 --- /dev/null +++ b/man/man8/puppet-apply.8 @@ -0,0 +1,75 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-APPLY" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-apply\fR \- Apply Puppet manifests locally +. +.SH "SYNOPSIS" +Applies a standalone Puppet manifest to the local system\. +. +.SH "USAGE" +puppet apply [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-execute] [\-\-detailed\-exitcodes] [\-l|\-\-logdest \fIfile\fR] [\-\-apply \fIcatalog\fR] \fIfile\fR +. +.SH "DESCRIPTION" +This is the standalone puppet execution tool; use it to apply individual manifests\. +. +.P +When provided with a modulepath, via command line or config file, puppet apply can effectively mimic the catalog that would be served by puppet master with access to the same modules, although there are some subtle differences\. When combined with scheduling and an automated system for pushing manifests, this can be used to implement a serverless Puppet site\. +. +.P +Most users should use \'puppet agent\' and \'puppet master\' for site\-wide manifests\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'modulepath\' is a valid configuration parameter, so you can specify \'\-\-tags \fIclass\fR,\fItag\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-detailed\-exitcodes +Provide transaction information via exit codes\. If this is enabled, an exit code of \'2\' means there were changes, and an exit code of \'4\' means that there were failures during the transaction\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-loadclasses +Load any stored classes\. \'puppet agent\' caches configured classes (usually at /etc/puppet/classes\.txt), and setting this option causes all of those classes to be set in your puppet manifest\. +. +.TP +\-\-logdest +Where to send messages\. Choose between syslog, the console, and a log file\. Defaults to sending messages to the console\. +. +.TP +\-\-execute +Execute a specific piece of Puppet code +. +.TP +\-\-verbose +Print extra information\. +. +.TP +\-\-apply +Apply a JSON catalog (such as one generated with \'puppet master \-\-compile\')\. You can either specify a JSON file or pipe in JSON from standard input\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet apply \-l /tmp/manifest\.log manifest\.pp +$ puppet apply \-\-modulepath=/root/dev/modules \-e "include ntpd::server" +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-cert.8 b/man/man8/puppet-cert.8 new file mode 100644 index 000000000..bea7596d4 --- /dev/null +++ b/man/man8/puppet-cert.8 @@ -0,0 +1,94 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-CERT" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-cert\fR \- Manage certificates and requests +. +.SH "SYNOPSIS" +Standalone certificate authority\. Capable of generating certificates, but mostly used for signing certificate requests from puppet clients\. +. +.SH "USAGE" +puppet cert [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-g|\-\-generate] [\-l|\-\-list] [\-s|\-\-sign] [\-r|\-\-revoke] [\-p|\-\-print] [\-c|\-\-clean] [\-\-verify] [\-\-digest \fIdigest\fR] [\-\-fingerprint] [host] +. +.SH "DESCRIPTION" +Because the puppet master service defaults to not signing client certificate requests, this script is available for signing outstanding requests\. It can be used to list outstanding requests and then either sign them individually or sign all of them\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet cert with \'\-\-genconfig\'\. +. +.TP +\-\-all +Operate on all items\. Currently only makes sense with \'\-\-sign\', \'\-\-clean\', or \'\-\-list\'\. +. +.TP +\-\-digest +Set the digest for fingerprinting (defaults to md5)\. Valid values depends on your openssl and openssl ruby extension version, but should contain at least md5, sha1, md2, sha256\. +. +.TP +\-\-clean +Remove all files related to a host from puppet cert\'s storage\. This is useful when rebuilding hosts, since new certificate signing requests will only be honored if puppet cert does not have a copy of a signed certificate for that host\. The certificate of the host is also revoked\. If \'\-\-all\' is specified then all host certificates, both signed and unsigned, will be removed\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-generate +Generate a certificate for a named client\. A certificate/keypair will be generated for each client named on the command line\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-list +List outstanding certificate requests\. If \'\-\-all\' is specified, signed certificates are also listed, prefixed by \'+\', and revoked or invalid certificates are prefixed by \'\-\' (the verification outcome is printed in parenthesis)\. +. +.TP +\-\-print +Print the full\-text version of a host\'s certificate\. +. +.TP +\-\-fingerprint +Print the DIGEST (defaults to md5) fingerprint of a host\'s certificate\. +. +.TP +\-\-revoke +Revoke the certificate of a client\. The certificate can be specified either by its serial number, given as a decimal number or a hexadecimal number prefixed by \'0x\', or by its hostname\. The certificate is revoked by adding it to the Certificate Revocation List given by the \'cacrl\' config parameter\. Note that the puppetmasterd needs to be restarted after revoking certificates\. +. +.TP +\-\-sign +Sign an outstanding certificate request\. Unless \'\-\-all\' is specified, hosts must be listed after all flags\. +. +.TP +\-\-verbose +Enable verbosity\. +. +.TP +\-\-version +Print the puppet version number and exit\. +. +.TP +\-\-verify +Verify the named certificate against the local CA certificate\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet cert \-l +culain\.madstop\.com +$ puppet cert \-s culain\.madstop\.com +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-describe.8 b/man/man8/puppet-describe.8 new file mode 100644 index 000000000..c54a7bec7 --- /dev/null +++ b/man/man8/puppet-describe.8 @@ -0,0 +1,51 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-DESCRIBE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-describe\fR \- Display help about resource types +. +.SH "SYNOPSIS" +Prints help about Puppet resource types, providers, and metaparameters\. +. +.SH "USAGE" +puppet describe [\-h|\-\-help] [\-s|\-\-short] [\-p|\-\-providers] [\-l|\-\-list] [\-m|\-\-meta] +. +.SH "OPTIONS" +. +.TP +\-\-help +Print this help text +. +.TP +\-\-providers +Describe providers in detail for each type +. +.TP +\-\-list +List all types +. +.TP +\-\-meta +List all metaparameters +. +.TP +\-\-short +List only parameters without detail +. +.SH "EXAMPLE" +. +.nf + +$ puppet describe \-\-list +$ puppet describe file \-\-providers +$ puppet describe user \-s \-m +. +.fi +. +.SH "AUTHOR" +David Lutterkort +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-doc.8 b/man/man8/puppet-doc.8 new file mode 100644 index 000000000..e0cabd5d1 --- /dev/null +++ b/man/man8/puppet-doc.8 @@ -0,0 +1,101 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-DOC" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-doc\fR \- Generate Puppet documentation and references +. +.SH "SYNOPSIS" +Generates a reference for all Puppet types\. Largely meant for internal Puppet Labs use\. +. +.SH "USAGE" +puppet doc [\-a|\-\-all] [\-h|\-\-help] [\-o|\-\-outputdir \fIrdoc\-outputdir\fR] [\-m|\-\-mode text|pdf|rdoc] [\-r|\-\-reference \fIreference\-name\fR] [\-\-charset \fIcharset\fR] [\fImanifest\-file\fR] +. +.SH "DESCRIPTION" +If mode is not \'rdoc\', then this command generates a Markdown document describing all installed Puppet types or all allowable arguments to puppet executables\. It is largely meant for internal use and is used to generate the reference document available on the Puppet Labs web site\. +. +.P +In \'rdoc\' mode, this command generates an html RDoc hierarchy describing the manifests that are in \'manifestdir\' and \'modulepath\' configuration directives\. The generated documentation directory is doc by default but can be changed with the \'outputdir\' option\. +. +.P +If the command is run with the name of a manifest file as an argument, puppet doc will output a single manifest\'s documentation on stdout\. +. +.SH "OPTIONS" +. +.TP +\-\-all +Output the docs for all of the reference types\. In \'rdoc\' modes, this also outputs documentation for all resources +. +.TP +\-\-help +Print this help message +. +.TP +\-\-outputdir +Specifies the directory where to output the rdoc documentation in \'rdoc\' mode\. +. +.TP +\-\-mode +Determine the output mode\. Valid modes are \'text\', \'pdf\' and \'rdoc\'\. The \'pdf\' mode creates PDF formatted files in the /tmp directory\. The default mode is \'text\'\. In \'rdoc\' mode you must provide \'manifests\-path\' +. +.TP +\-\-reference +Build a particular reference\. Get a list of references by running \'puppet doc \-\-list\'\. +. +.TP +\-\-charset +Used only in \'rdoc\' mode\. It sets the charset used in the html files produced\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet doc \-r type > /tmp/type_reference\.markdown +. +.fi +. +.P +or +. +.IP "" 4 +. +.nf + +$ puppet doc \-\-outputdir /tmp/rdoc \-\-mode rdoc /path/to/manifests +. +.fi +. +.IP "" 0 +. +.P +or +. +.IP "" 4 +. +.nf + +$ puppet doc /etc/puppet/manifests/site\.pp +. +.fi +. +.IP "" 0 +. +.P +or +. +.IP "" 4 +. +.nf + +$ puppet doc \-m pdf \-r configuration +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-filebucket.8 b/man/man8/puppet-filebucket.8 new file mode 100644 index 000000000..7ff0da9af --- /dev/null +++ b/man/man8/puppet-filebucket.8 @@ -0,0 +1,81 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-FILEBUCKET" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket +. +.SH "SYNOPSIS" +A stand\-alone Puppet filebucket client\. +. +.SH "USAGE" +puppet filebucket \fImode\fR [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-l|\-\-local] [\-r|\-\-remote] [\-s|\-\-server \fIserver\fR] [\-b|\-\-bucket \fIdirectory\fR] \fIfile\fR \fIfile\fR \.\.\. +. +.P +Puppet filebucket can operate in three modes, with only one mode per call: +. +.P +backup: Send one or more files to the specified file bucket\. Each sent file is printed with its resulting md5 sum\. +. +.P +get: Return the text associated with an md5 sum\. The text is printed to stdout, and only one file can be retrieved at a time\. +. +.P +restore: Given a file path and an md5 sum, store the content associated with the sum into the specified file path\. You can specify an entirely new path to this argument; you are not restricted to restoring the content to its original location\. +. +.SH "DESCRIPTION" +This is a stand\-alone filebucket client for sending files to a local or central filebucket\. +. +.P +Note that \'filebucket\' defaults to using a network\-based filebucket available on the server named \'puppet\'\. To use this, you\'ll have to be running as a user with valid Puppet certificates\. Alternatively, you can use your local file bucket by specifying \'\-\-local\'\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-local +Use the local filebucket\. This will use the default configuration information\. +. +.TP +\-\-remote +Use a remote filebucket\. This will use the default configuration information\. +. +.TP +\-\-server +The server to send the file to, instead of locally\. +. +.TP +\-\-verbose +Print extra information\. +. +.TP +\-\-version +Print version information\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet filebucket backup /etc/passwd +/etc/passwd: 429b225650b912a2ee067b0a4cf1e949 +$ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-inspect.8 b/man/man8/puppet-inspect.8 new file mode 100644 index 000000000..ae19deede --- /dev/null +++ b/man/man8/puppet-inspect.8 @@ -0,0 +1,28 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-INSPECT" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-inspect\fR \- Send an inspection report +. +.SH "SYNOPSIS" +Prepares and submits an inspection report to the puppet master\. +. +.SH "USAGE" +puppet inspect +. +.SH "DESCRIPTION" +This command uses the cached catalog from the previous run of \'puppet agent\' to determine which attributes of which resources have been marked as auditable with the \'audit\' metaparameter\. It then examines the current state of the system, writes the state of the specified resource attributes to a report, and submits the report to the puppet master\. +. +.P +Puppet inspect does not run as a daemon, and must be run manually or from cron\. +. +.SH "OPTIONS" +Any configuration setting which is valid in the configuration file is also a valid long argument, e\.g\. \'\-\-server=master\.domain\.com\'\. See the configuration file documentation at http://docs\.puppetlabs\.com/references/latest/configuration\.html for the full list of acceptable settings\. +. +.SH "AUTHOR" +Puppet Labs +. +.SH "COPYRIGHT" +Copyright (c) 2011 Puppet Labs, LLC Licensed under the GNU General Public License version 2 diff --git a/man/man8/puppet-kick.8 b/man/man8/puppet-kick.8 new file mode 100644 index 000000000..b6a868918 --- /dev/null +++ b/man/man8/puppet-kick.8 @@ -0,0 +1,115 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-KICK" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-kick\fR \- Remotely control puppet agent +. +.SH "SYNOPSIS" +Trigger a puppet agent run on a set of hosts\. +. +.SH "USAGE" +puppet kick [\-a|\-\-all] [\-c|\-\-class \fIclass\fR] [\-d|\-\-debug] [\-f|\-\-foreground] [\-h|\-\-help] [\-\-host \fIhost\fR] [\-\-no\-fqdn] [\-\-ignoreschedules] [\-t|\-\-tag \fItag\fR] [\-\-test] [\-p|\-\-ping] \fIhost\fR [\fIhost\fR [\.\.\.]] +. +.SH "DESCRIPTION" +This script can be used to connect to a set of machines running \'puppet agent\' and trigger them to run their configurations\. The most common usage would be to specify a class of hosts and a set of tags, and \'puppet kick\' would look up in LDAP all of the hosts matching that class, then connect to each host and trigger a run of all of the objects with the specified tags\. +. +.P +If you are not storing your host configurations in LDAP, you can specify hosts manually\. +. +.P +You will most likely have to run \'puppet kick\' as root to get access to the SSL certificates\. +. +.P +\'puppet kick\' reads \'puppet master\'\'s configuration file, so that it can copy things like LDAP settings\. +. +.SH "USAGE NOTES" +\'puppet kick\' is useless unless \'puppet agent\' is listening\. See its documentation for more information, but the gist is that you must enable \'listen\' on the \'puppet agent\' daemon, either using \'\-\-listen\' on the command line or adding \'listen = true\' in its config file\. In addition, you need to set the daemons up to specifically allow connections by creating the \'namespaceauth\' file, normally at \'/etc/puppet/namespaceauth\.conf\'\. This file specifies who has access to each namespace; if you create the file you must add every namespace you want any Puppet daemon to allow \-\- it is currently global to all Puppet daemons\. +. +.P +An example file looks like this: +. +.IP "" 4 +. +.nf + +[fileserver] + allow *\.madstop\.com + +[puppetmaster] + allow *\.madstop\.com + +[puppetrunner] + allow culain\.madstop\.com +. +.fi +. +.IP "" 0 +. +.P +This is what you would install on your Puppet master; non\-master hosts could leave off the \'fileserver\' and \'puppetmaster\' namespaces\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/latest/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet master with \'\-\-genconfig\'\. +. +.TP +\-\-all +Connect to all available hosts\. Requires LDAP support at this point\. +. +.TP +\-\-class +Specify a class of machines to which to connect\. This only works if you have LDAP configured, at the moment\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-foreground +Run each configuration in the foreground; that is, when connecting to a host, do not return until the host has finished its run\. The default is false\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-host +A specific host to which to connect\. This flag can be specified more than once\. +. +.TP +\-\-ignoreschedules +Whether the client should ignore schedules when running its configuration\. This can be used to force the client to perform work it would not normally perform so soon\. The default is false\. +. +.TP +\-\-parallel +How parallel to make the connections\. Parallelization is provided by forking for each client to which to connect\. The default is 1, meaning serial execution\. +. +.TP +\-\-tag +Specify a tag for selecting the objects to apply\. Does not work with the \-\-test option\. +. +.TP +\-\-test +Print the hosts you would connect to but do not actually connect\. This option requires LDAP support at this point\. +. +.TP +\-\-ping +Do a ICMP echo against the target host\. Skip hosts that don\'t respond to ping\. +. +.SH "EXAMPLE" +. +.nf + +$ sudo puppet kick \-p 10 \-t remotefile \-t webserver host1 host2 +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-master.8 b/man/man8/puppet-master.8 new file mode 100644 index 000000000..9ed2a6ad6 --- /dev/null +++ b/man/man8/puppet-master.8 @@ -0,0 +1,63 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-MASTER" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-master\fR \- The puppet master daemon +. +.SH "SYNOPSIS" +The central puppet server\. Functions as a certificate authority by default\. +. +.SH "USAGE" +puppet master [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-h|\-\-help] [\-l|\-\-logdest \fIfile\fR|console|syslog] [\-v|\-\-verbose] [\-V|\-\-version] [\-\-compile \fInode\-name\fR] +. +.SH "DESCRIPTION" +This command starts an instance of puppet master, running as a daemon and using Ruby\'s built\-in Webrick webserver\. Puppet master can also be managed by other application servers; when this is the case, this executable is not used\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet master with \'\-\-genconfig\'\. +. +.TP +\-\-daemonize +Send the process into the background\. This is the default\. +. +.TP +\-\-no\-daemonize +Do not send the process into the background\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-help +Print this help message\. +. +.TP +\-\-logdest +Where to send messages\. Choose between syslog, the console, and a log file\. Defaults to sending messages to syslog, or the console if debugging or verbosity is enabled\. +. +.TP +\-\-verbose +Enable verbosity\. +. +.TP +\-\-version +Print the puppet version number and exit\. +. +.TP +\-\-compile +Compile a catalogue and output it in JSON from the puppet master\. Uses facts contained in the $vardir/yaml/ directory to compile the catalog\. +. +.SH "EXAMPLE" +puppet master +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-queue.8 b/man/man8/puppet-queue.8 new file mode 100644 index 000000000..7dbd683bf --- /dev/null +++ b/man/man8/puppet-queue.8 @@ -0,0 +1,55 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-QUEUE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-queue\fR \- Queuing daemon for asynchronous storeconfigs +. +.SH "SYNOPSIS" +Retrieves serialized storeconfigs records from a queue and processes them in order\. +. +.SH "USAGE" +puppet queue [\-d|\-\-debug] [\-v|\-\-verbose] +. +.SH "DESCRIPTION" +This application runs as a daemon and processes storeconfigs data, retrieving the data from a stomp server message queue and writing it to a database\. +. +.P +For more information, including instructions for properly setting up your puppet master and message queue, see the documentation on setting up asynchronous storeconfigs at: http://projects\.puppetlabs\.com/projects/1/wiki/Using_Stored_Configuration +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet queue with \'\-\-genconfig\'\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-verbose +Turn on verbose reporting\. +. +.TP +\-\-version +Print the puppet version number and exit\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet queue +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2009 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet-resource.8 b/man/man8/puppet-resource.8 new file mode 100644 index 000000000..738537e84 --- /dev/null +++ b/man/man8/puppet-resource.8 @@ -0,0 +1,84 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "PUPPET\-RESOURCE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" +. +.SH "NAME" +\fBpuppet\-resource\fR \- The resource abstraction layer shell +. +.SH "SYNOPSIS" +Uses the Puppet RAL to directly interact with the system\. +. +.SH "USAGE" +puppet resource [\-h|\-\-help] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-edit] [\-H|\-\-host \fIhost\fR] [\-p|\-\-param \fIparameter\fR] [\-t|\-\-types] \fItype\fR [\fIname\fR] [\fIattribute\fR=\fIvalue\fR \.\.\.] +. +.SH "DESCRIPTION" +This command provides simple facilities for converting current system state into Puppet code, along with some ability to modify the current state using Puppet\'s RAL\. +. +.P +By default, you must at least provide a type to list, in which case puppet resource will tell you everything it knows about all resources of that type\. You can optionally specify an instance name, and puppet resource will only describe that single instance\. +. +.P +If given a type, a name, and a series of \fIattribute\fR=\fIvalue\fR pairs, puppet resource will modify the state of the specified resource\. Alternately, if given a type, a name, and the \'\-\-edit\' flag, puppet resource will write its output to a file, open that file in an editor, and then apply the saved file as a Puppet transaction\. +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +. +.P +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-edit +Write the results of the query to a file, open the file in an editor, and read the file back in as an executable Puppet manifest\. +. +.TP +\-\-host +When specified, connect to the resource server on the named host and retrieve the list of resouces of the type specified\. +. +.TP +\-\-help +Print this help message\. +. +.TP +\-\-param +Add more parameters to be outputted from queries\. +. +.TP +\-\-types +List all available types\. +. +.TP +\-\-verbose +Print extra information\. +. +.SH "EXAMPLE" +This example uses \fBpuppet resource\fR to return a Puppet configuration for the user \fBluke\fR: +. +.IP "" 4 +. +.nf + +$ puppet resource user luke +user { \'luke\': + home => \'/home/luke\', + uid => \'100\', + ensure => \'present\', + comment => \'Luke Kanies,,,\', + gid => \'1000\', + shell => \'/bin/bash\', + groups => [\'sysadmin\',\'audio\',\'video\',\'puppet\'] +} +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppet.8 b/man/man8/puppet.8 index 513d45338..f58a54d41 100644 --- a/man/man8/puppet.8 +++ b/man/man8/puppet.8 @@ -1,10 +1,10 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPET" "8" "August 2010" "" "" +.TH "PUPPET" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . .SH "NAME" \fBpuppet\fR . .P -Usage: puppet command \fIspace separated arguments\fR Available commands are: agent, apply, cert, describe, doc, filebucket, kick, master, queue, resource +Usage: puppet command \fIspace separated arguments\fR Available commands are: agent, apply, cert, describe, doc, filebucket, inspect, kick, master, queue, resource diff --git a/man/man8/puppetca.8 b/man/man8/puppetca.8 index 62fa7a5bf..bea7596d4 100644 --- a/man/man8/puppetca.8 +++ b/man/man8/puppetca.8 @@ -1,169 +1,94 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETCA" "8" "August 2010" "" "" -Stand\-alone certificate authority\. Capable of generating certificates but mostly meant for signing certificate requests from puppet clients\.puppet cert [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] +.TH "PUPPET\-CERT" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-cert\fR \- Manage certificates and requests . -.nf - - [\-g|\-\-generate] [\-l|\-\-list] [\-s|\-\-sign] [\-r|\-\-revoke] - [\-p|\-\-print] [\-c|\-\-clean] [\-\-verify] [\-\-digest DIGEST] - [\-\-fingerprint] [host] -. -.fi -. -.IP "" 0 -Because the puppetmasterd daemon defaults to not signing client certificate requests, this script is available for signing outstanding requests\. It can be used to list outstanding requests and then either sign them individually or sign all of them\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. -. -.P -See the configuration file documentation at http://reductivelabs\.com/projects/puppet/reference/configref\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet cert with \'\-\-genconfig\'\. -. -.P -all: Operate on all items\. Currently only makes sense with +.SH "SYNOPSIS" +Standalone certificate authority\. Capable of generating certificates, but mostly used for signing certificate requests from puppet clients\. . -.IP "" 4 +.SH "USAGE" +puppet cert [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-g|\-\-generate] [\-l|\-\-list] [\-s|\-\-sign] [\-r|\-\-revoke] [\-p|\-\-print] [\-c|\-\-clean] [\-\-verify] [\-\-digest \fIdigest\fR] [\-\-fingerprint] [host] . -.nf - - \'\-\-sign\', \'\-\-clean\', or \'\-\-list\'\. +.SH "DESCRIPTION" +Because the puppet master service defaults to not signing client certificate requests, this script is available for signing outstanding requests\. It can be used to list outstanding requests and then either sign them individually or sign all of them\. . -.fi -. -.IP "" 0 +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. . .P -digest: Set the digest for fingerprinting (defaults to md5)\. Valid -. -.IP "" 4 -. -.nf - - values depends on your openssl and openssl ruby extension - version, but should contain at least md5, sha1, md2, - sha256\. -. -.fi +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet cert with \'\-\-genconfig\'\. . -.IP "" 0 +.TP +\-\-all +Operate on all items\. Currently only makes sense with \'\-\-sign\', \'\-\-clean\', or \'\-\-list\'\. . -.P -clean: Remove all files related to a host from puppet cert\'s +.TP +\-\-digest +Set the digest for fingerprinting (defaults to md5)\. Valid values depends on your openssl and openssl ruby extension version, but should contain at least md5, sha1, md2, sha256\. . -.IP "" 4 +.TP +\-\-clean +Remove all files related to a host from puppet cert\'s storage\. This is useful when rebuilding hosts, since new certificate signing requests will only be honored if puppet cert does not have a copy of a signed certificate for that host\. The certificate of the host is also revoked\. If \'\-\-all\' is specified then all host certificates, both signed and unsigned, will be removed\. . -.nf - - storage\. This is useful when rebuilding hosts, since new - certificate signing requests will only be honored if puppet - cert does not have a copy of a signed certificate for that - host\. The certificate of the host remains valid\. If \'\-\-all\' - is specified then all host certificates, both signed and - unsigned, will be removed\. +.TP +\-\-debug +Enable full debugging\. . -.fi +.TP +\-\-generate +Generate a certificate for a named client\. A certificate/keypair will be generated for each client named on the command line\. . -.IP "" 0 +.TP +\-\-help +Print this help message . -.P -debug: Enable full debugging\. +.TP +\-\-list +List outstanding certificate requests\. If \'\-\-all\' is specified, signed certificates are also listed, prefixed by \'+\', and revoked or invalid certificates are prefixed by \'\-\' (the verification outcome is printed in parenthesis)\. . -.P -generate: Generate a certificate for a named client\. A +.TP +\-\-print +Print the full\-text version of a host\'s certificate\. . -.IP "" 4 +.TP +\-\-fingerprint +Print the DIGEST (defaults to md5) fingerprint of a host\'s certificate\. . -.nf - - certificate/keypair will be generated for each client named - on the command line\. +.TP +\-\-revoke +Revoke the certificate of a client\. The certificate can be specified either by its serial number, given as a decimal number or a hexadecimal number prefixed by \'0x\', or by its hostname\. The certificate is revoked by adding it to the Certificate Revocation List given by the \'cacrl\' config parameter\. Note that the puppetmasterd needs to be restarted after revoking certificates\. . -.fi +.TP +\-\-sign +Sign an outstanding certificate request\. Unless \'\-\-all\' is specified, hosts must be listed after all flags\. . -.IP "" 0 +.TP +\-\-verbose +Enable verbosity\. . -.P -help: Print this help message +.TP +\-\-version +Print the puppet version number and exit\. . -.P -list: List outstanding certificate requests\. If \'\-\-all\' is +.TP +\-\-verify +Verify the named certificate against the local CA certificate\. . -.IP "" 4 +.SH "EXAMPLE" . .nf - specified, signed certificates are also listed, prefixed by - \'+\', and revoked or invalid certificates are prefixed by - \'\-\' (the verification outcome is printed in parenthesis)\. +$ puppet cert \-l +culain\.madstop\.com +$ puppet cert \-s culain\.madstop\.com . .fi . -.IP "" 0 -. -.P -print: Print the full\-text version of a host\'s certificate\. -. -.P -fingerprint: Print the DIGEST (defaults to md5) fingerprint of a host\'s -. -.IP "" 4 -. -.nf - - certificate\. -. -.fi -. -.IP "" 0 -. -.P -revoke: Revoke the certificate of a client\. The certificate can be -. -.IP "" 4 -. -.nf - - specified either by its serial number, given as a decimal - number or a hexadecimal number prefixed by \'0x\', or by its - hostname\. The certificate is revoked by adding it to the - Certificate Revocation List given by the \'cacrl\' config - parameter\. Note that the puppetmasterd needs to be - restarted after revoking certificates\. -. -.fi -. -.IP "" 0 -. -.P -sign: Sign an outstanding certificate request\. Unless \'\-\-all\' is -. -.IP "" 4 -. -.nf - - specified, hosts must be listed after all flags\. -. -.fi -. -.IP "" 0 -. -.P -verbose: Enable verbosity\. -. -.P -version: Print the puppet version number and exit\. -. -.P -verify: Verify the named certificate against the local CA -. -.IP "" 4 -. -.nf - - certificate\. -. -.fi +.SH "AUTHOR" +Luke Kanies . -.IP "" 0 -$ puppet cert \-l culain\.madstop\.com $ puppet cert \-s culain\.madstop\.comLuke KaniesCopyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppetd.8 b/man/man8/puppetd.8 index 861137553..3fadd9df7 100644 --- a/man/man8/puppetd.8 +++ b/man/man8/puppetd.8 @@ -1,283 +1,139 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETD" "8" "August 2010" "" "" -puppet agent [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] +.TH "PUPPET\-AGENT" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-agent\fR \- The puppet agent daemon . -.nf - - [\-\-detailed\-exitcodes] [\-\-disable] [\-\-enable] - [\-h|\-\-help] [\-\-fqdn <host name>] [\-l|\-\-logdest syslog|<file>|console] - [\-o|\-\-onetime] [\-\-serve <handler>] [\-t|\-\-test] [\-\-noop] - [\-\-digest <digest>] [\-\-fingerprint] [\-V|\-\-version] - [\-v|\-\-verbose] [\-w|\-\-waitforcert <seconds>] -. -.fi -. -.IP "" 0 -This is the main puppet client\. Its job is to retrieve the local machine\'s configuration from a remote server and apply it\. In order to successfully communicate with the remote server, the client must have a certificate signed by a certificate authority that the server trusts; the recommended method for this, at the moment, is to run a certificate authority as part of the puppet server (which is the default)\. The client will connect and request a signed certificate, and will continue connecting until it receives one\. -. -.P -Once the client has a signed certificate, it will retrieve its configuration and apply it\.+puppet agent+ does its best to find a compromise between interactive use and daemon use\. Run with no arguments and no configuration, it will go into the backgroun, attempt to get a signed certificate, and retrieve and apply its configuration every 30 minutes\. -. -.P -Some flags are meant specifically for interactive use \-\- in particular, +test+, +tags+ or +fingerprint+ are useful\. +test+ enables verbose logging, causes the daemon to stay in the foreground, exits if the server\'s configuration is invalid (this happens if, for instance, you\'ve left a syntax error on the server), and exits after running the configuration once (rather than hanging around as a long\-running process)\. -. -.P -+tags+ allows you to specify what portions of a configuration you want to apply\. Puppet elements are tagged with all of the class or definition names that contain them, and you can use the +tags+ flag to specify one of these names, causing only configuration elements contained within that class or definition to be applied\. This is very useful when you are testing new configurations \-\- for instance, if you are just starting to manage +ntpd+, you would put all of the new elements into an +ntpd+ class, and call puppet with +\-\-tags ntpd+, which would only apply that small portion of the configuration during your testing, rather than applying the whole thing\. -. -.P -+fingerprint+ is a one\-time flag\. In this mode +puppet agent+ will run once and display on the console (and in the log) the current certificate (or certificate request) fingerprint\. Providing the +\-\-digest+ option allows to use a different digest algorithm to generate the fingerprint\. The main use is to verify that before signing a certificate request on the master, the certificate request the master received is the same as the one the client sent (to prevent against man\-in\-the\-middle attacks when signing certificates)\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. -. -.P -See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet agent with \'\-\-genconfig\'\. -. -.P -daemonize: Send the process into the background\. This is the -. -.IP "" 4 -. -.nf - - default\. -. -.fi -. -.IP "" 0 -. -.P -no\-daemonize: Do not send the process into the background\. -. -.P -debug: Enable full debugging\. +.SH "SYNOPSIS" +Retrieves the client configuration from the puppet master and applies it to the local host\. . .P -digest: Change the certificate fingerprinting digest -. -.IP "" 4 -. -.nf - - algorithm\. The default is MD5\. Valid values depends - on the version of OpenSSL installed, but should - always at least contain MD5, MD2, SHA1 and SHA256\. -. -.fi -. -.IP "" 0 +This service may be run as a daemon, run periodically using cron (or something similar), or run interactively for testing purposes\. . -.P -detailed\-exitcodes: Provide transaction information via exit codes\. If -. -.IP "" 4 -. -.nf - - this is enabled, an exit code of \'2\' means there - were changes, and an exit code of \'4\' means that - there were failures during the transaction\. This - option only makes sense in conjunction with - \-\-onetime\. -. -.fi +.SH "USAGE" +puppet agent [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-\-detailed\-exitcodes] [\-\-disable] [\-\-enable] [\-h|\-\-help] [\-\-certname \fIhost name\fR] [\-l|\-\-logdest syslog|\fIfile\fR|console] [\-o|\-\-onetime] [\-\-serve \fIhandler\fR] [\-t|\-\-test] [\-\-noop] [\-\-digest \fIdigest\fR] [\-\-fingerprint] [\-V|\-\-version] [\-v|\-\-verbose] [\-w|\-\-waitforcert \fIseconds\fR] . -.IP "" 0 +.SH "DESCRIPTION" +This is the main puppet client\. Its job is to retrieve the local machine\'s configuration from a remote server and apply it\. In order to successfully communicate with the remote server, the client must have a certificate signed by a certificate authority that the server trusts; the recommended method for this, at the moment, is to run a certificate authority as part of the puppet server (which is the default)\. The client will connect and request a signed certificate, and will continue connecting until it receives one\. . .P -disable: Disable working on the local system\. This puts a -. -.IP "" 4 -. -.nf - - lock file in place, causing +puppet agent+ not to - work on the system until the lock file is removed\. - This is useful if you are testing a configuration - and do not want the central configuration to - override the local state until everything is tested - and committed\. -. -.fi +Once the client has a signed certificate, it will retrieve its configuration and apply it\. . -.IP "" 0 +.SH "USAGE NOTES" +\'puppet agent\' does its best to find a compromise between interactive use and daemon use\. Run with no arguments and no configuration, it will go into the background, attempt to get a signed certificate, and retrieve and apply its configuration every 30 minutes\. . .P -+puppet agent+ uses the same lock file while it is running, so no more than one +puppet agent+ process is working at a time\. +Some flags are meant specifically for interactive use \-\- in particular, \'test\', \'tags\' or \'fingerprint\' are useful\. \'test\' enables verbose logging, causes the daemon to stay in the foreground, exits if the server\'s configuration is invalid (this happens if, for instance, you\'ve left a syntax error on the server), and exits after running the configuration once (rather than hanging around as a long\-running process)\. . .P -+puppet agent+ exits after executing this\. +\'tags\' allows you to specify what portions of a configuration you want to apply\. Puppet elements are tagged with all of the class or definition names that contain them, and you can use the \'tags\' flag to specify one of these names, causing only configuration elements contained within that class or definition to be applied\. This is very useful when you are testing new configurations \-\- for instance, if you are just starting to manage \'ntpd\', you would put all of the new elements into an \'ntpd\' class, and call puppet with \'\-\-tags ntpd\', which would only apply that small portion of the configuration during your testing, rather than applying the whole thing\. . .P -enable: Enable working on the local system\. This removes any +\'fingerprint\' is a one\-time flag\. In this mode \'puppet agent\' will run once and display on the console (and in the log) the current certificate (or certificate request) fingerprint\. Providing the \'\-\-digest\' option allows to use a different digest algorithm to generate the fingerprint\. The main use is to verify that before signing a certificate request on the master, the certificate request the master received is the same as the one the client sent (to prevent against man\-in\-the\-middle attacks when signing certificates)\. . -.IP "" 4 -. -.nf - - lock file, causing +puppet agent+ to start managing - the local system again (although it will continue to - use its normal scheduling, so it might not start for - another half hour)\. -. -.fi -. -.IP "" 0 +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. . .P -+puppet agent+ exits after executing this\. -. -.P -fqdn: Set the fully\-qualified domain name of the client\. +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet agent with \'\-\-genconfig\'\. . -.IP "" 4 +.TP +\-\-daemonize +Send the process into the background\. This is the default\. . -.nf - - This is only used for certificate purposes, but can - be used to override the discovered hostname\. If you - need to use this flag, it is generally an indication - of a setup problem\. +.TP +\-\-no\-daemonize +Do not send the process into the background\. . -.fi +.TP +\-\-debug +Enable full debugging\. . -.IP "" 0 +.TP +\-\-digest +Change the certificate fingerprinting digest algorithm\. The default is MD5\. Valid values depends on the version of OpenSSL installed, but should always at least contain MD5, MD2, SHA1 and SHA256\. . -.P -help: Print this help message +.TP +\-\-detailed\-exitcodes +Provide transaction information via exit codes\. If this is enabled, an exit code of \'2\' means there were changes, and an exit code of \'4\' means that there were failures during the transaction\. This option only makes sense in conjunction with \-\-onetime\. . -.P -logdest: Where to send messages\. Choose between syslog, the +.TP +\-\-disable +Disable working on the local system\. This puts a lock file in place, causing \'puppet agent\' not to work on the system until the lock file is removed\. This is useful if you are testing a configuration and do not want the central configuration to override the local state until everything is tested and committed\. . -.IP "" 4 +.IP +\'puppet agent\' uses the same lock file while it is running, so no more than one \'puppet agent\' process is working at a time\. . -.nf - - console, and a log file\. Defaults to sending - messages to syslog, or the console if debugging or - verbosity is enabled\. +.IP +\'puppet agent\' exits after executing this\. . -.fi +.TP +\-\-enable +Enable working on the local system\. This removes any lock file, causing \'puppet agent\' to start managing the local system again (although it will continue to use its normal scheduling, so it might not start for another half hour)\. . -.IP "" 0 +.IP +\'puppet agent\' exits after executing this\. . -.P -no\-client: Do not create a config client\. This will cause the +.TP +\-\-certname +Set the certname (unique ID) of the client\. The master reads this unique identifying string, which is usually set to the node\'s fully\-qualified domain name, to determine which configurations the node will receive\. Use this option to debug setup problems or implement unusual node identification schemes\. . -.IP "" 4 +.TP +\-\-help +Print this help message . -.nf - - daemon to run without ever checking for its - configuration automatically, and only makes sense - when used in conjunction with \-\-listen\. +.TP +\-\-logdest +Where to send messages\. Choose between syslog, the console, and a log file\. Defaults to sending messages to syslog, or the console if debugging or verbosity is enabled\. . -.fi +.TP +\-\-no\-client +Do not create a config client\. This will cause the daemon to run without ever checking for its configuration automatically, and only makes sense . -.IP "" 0 +.TP +\-\-onetime +Run the configuration once\. Runs a single (normally daemonized) Puppet run\. Useful for interactively running puppet agent when used in conjunction with the \-\-no\-daemonize option\. . -.P -onetime: Run the configuration once\. Runs a single (normally +.TP +\-\-fingerprint +Display the current certificate or certificate signing request fingerprint and then exit\. Use the \'\-\-digest\' option to change the digest algorithm used\. . -.IP "" 4 +.TP +\-\-serve +Start another type of server\. By default, \'puppet agent\' will start a service handler that allows authenticated and authorized remote nodes to trigger the configuration to be pulled down and applied\. You can specify any handler here that does not require configuration, e\.g\., filebucket, ca, or resource\. The handlers are in \'lib/puppet/network/handler\', and the names must match exactly, both in the call to \'serve\' and in \'namespaceauth\.conf\'\. . -.nf - - daemonized) Puppet run\. Useful for interactively - running puppet agent when used in conjunction with - the \-\-no\-daemonize option\. -. -.fi -. -.IP "" 0 -. -.P -fingerprint: Display the current certificate or certificate +.TP +\-\-test +Enable the most common options used for testing\. These are \'onetime\', \'verbose\', \'ignorecache\', \'no\-daemonize\', \'no\-usecacheonfailure\', \'detailed\-exit\-codes\', \'no\-splay\', and \'show_diff\'\. . -.IP "" 4 +.TP +\-\-noop +Use \'noop\' mode where the daemon runs in a no\-op or dry\-run mode\. This is useful for seeing what changes Puppet will make without actually executing the changes\. . -.nf - - signing request fingerprint and then exit\. Use the - +\-\-digest+ option to change the digest algorithm - used\. +.TP +\-\-verbose +Turn on verbose reporting\. . -.fi +.TP +\-\-version +Print the puppet version number and exit\. . -.IP "" 0 +.TP +\-\-waitforcert +This option only matters for daemons that do not yet have certificates and it is enabled by default, with a value of 120 (seconds)\. This causes \'puppet agent\' to connect to the server every 2 minutes and ask it to sign a certificate request\. This is useful for the initial setup of a puppet client\. You can turn off waiting for certificates by specifying a time of 0\. . -.P -serve: Start another type of server\. By default, +puppet -. -.IP "" 4 +.SH "EXAMPLE" . .nf - agent+ will start a service handler that allows - authenticated and authorized remote nodes to trigger - the configuration to be pulled down and applied\. You - can specify any handler here that does not require - configuration, e\.g\., filebucket, ca, or resource\. - The handlers are in +lib/puppet/network/handler+, - and the names must match exactly, both in the call - to +serve+ and in +namespaceauth\.conf+\. +$ puppet agent \-\-server puppet\.domain\.com . .fi . -.IP "" 0 -. -.P -test: Enable the most common options used for testing\. -. -.IP "" 4 -. -.nf - - These are +onetime+, +verbose+, +ignorecache, - +no\-daemonize+, and +no\-usecacheonfailure+\. -. -.fi -. -.IP "" 0 -. -.P -noop: Use +noop+ mode where the daemon runs in a no\-op or -. -.IP "" 4 -. -.nf - - dry\-run mode\. This is useful for seeing what changes - Puppet will make without actually executing the - changes\. -. -.fi -. -.IP "" 0 -. -.P -verbose: Turn on verbose reporting\. -. -.P -version: Print the puppet version number and exit\. -. -.P -waitforcert: This option only matters for daemons that do not yet -. -.IP "" 4 -. -.nf - - have certificates and it is enabled by default, with - a value of 120 (seconds)\. This causes +puppet agent+ - to connect to the server every 2 minutes and ask it - to sign a certificate request\. This is useful for - the initial setup of a puppet client\. You can turn - off waiting for certificates by specifying a time of - 0\. -. -.fi +.SH "AUTHOR" +Luke Kanies . -.IP "" 0 -puppet agent \-\-server puppet\.domain\.comLuke KaniesCopyright (c) 2005, 2006 Puppet Labs, LLC Licensed under the GNU Public License +.SH "COPYRIGHT" +Copyright (c) 2005, 2006 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppetdoc.8 b/man/man8/puppetdoc.8 index 47df0e764..e0cabd5d1 100644 --- a/man/man8/puppetdoc.8 +++ b/man/man8/puppetdoc.8 @@ -1,108 +1,101 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETDOC" "8" "August 2010" "" "" -Generate a reference for all Puppet types\. Largely meant for internal Puppet Labs use\.puppet doc [\-a|\-\-all] [\-h|\-\-help] [\-o|\-\-outputdir \fIrdoc outputdir\fR] [\-m|\-\-mode \fItext|pdf|rdoc\fR] +.TH "PUPPET\-DOC" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-doc\fR \- Generate Puppet documentation and references . -.nf - - [\-r|\-\-reference <[type]|configuration|\.\.>] [\-\-charset CHARSET] [manifest\-file] +.SH "SYNOPSIS" +Generates a reference for all Puppet types\. Largely meant for internal Puppet Labs use\. . -.fi +.SH "USAGE" +puppet doc [\-a|\-\-all] [\-h|\-\-help] [\-o|\-\-outputdir \fIrdoc\-outputdir\fR] [\-m|\-\-mode text|pdf|rdoc] [\-r|\-\-reference \fIreference\-name\fR] [\-\-charset \fIcharset\fR] [\fImanifest\-file\fR] . -.IP "" 0 +.SH "DESCRIPTION" If mode is not \'rdoc\', then this command generates a Markdown document describing all installed Puppet types or all allowable arguments to puppet executables\. It is largely meant for internal use and is used to generate the reference document available on the Puppet Labs web site\. . .P In \'rdoc\' mode, this command generates an html RDoc hierarchy describing the manifests that are in \'manifestdir\' and \'modulepath\' configuration directives\. The generated documentation directory is doc by default but can be changed with the \'outputdir\' option\. . .P -If the command is started with \'manifest\-file\' command\-line arguments, puppet doc generate a single manifest documentation that is output on stdout\.all: Output the docs for all of the reference types\. In \'rdoc\' +If the command is run with the name of a manifest file as an argument, puppet doc will output a single manifest\'s documentation on stdout\. . -.IP "" 4 +.SH "OPTIONS" . -.nf - - modes, this also outputs documentation for all resources +.TP +\-\-all +Output the docs for all of the reference types\. In \'rdoc\' modes, this also outputs documentation for all resources . -.fi +.TP +\-\-help +Print this help message . -.IP "" 0 +.TP +\-\-outputdir +Specifies the directory where to output the rdoc documentation in \'rdoc\' mode\. . -.P -help: Print this help message +.TP +\-\-mode +Determine the output mode\. Valid modes are \'text\', \'pdf\' and \'rdoc\'\. The \'pdf\' mode creates PDF formatted files in the /tmp directory\. The default mode is \'text\'\. In \'rdoc\' mode you must provide \'manifests\-path\' . -.P -outputdir: Specifies the directory where to output the rdoc +.TP +\-\-reference +Build a particular reference\. Get a list of references by running \'puppet doc \-\-list\'\. . -.IP "" 4 +.TP +\-\-charset +Used only in \'rdoc\' mode\. It sets the charset used in the html files produced\. +. +.SH "EXAMPLE" . .nf - documentation in \'rdoc\' mode\. +$ puppet doc \-r type > /tmp/type_reference\.markdown . .fi . -.IP "" 0 -. .P -mode: Determine the output mode\. Valid modes are \'text\', \'trac\', +or . .IP "" 4 . .nf - \'pdf\' and \'rdoc\'\. The \'pdf\' mode creates PDF formatted files - in the /tmp directory\. The default mode is \'text\'\. In \'rdoc\' - mode you must provide \'manifests\-path\' +$ puppet doc \-\-outputdir /tmp/rdoc \-\-mode rdoc /path/to/manifests . .fi . .IP "" 0 . .P -reference: Build a particular reference\. Get a list of references by +or . .IP "" 4 . .nf - running +puppet doc \-\-list+\. +$ puppet doc /etc/puppet/manifests/site\.pp . .fi . .IP "" 0 . .P -charset: Used only in \'rdoc\' mode\. It sets the charset used in the +or . .IP "" 4 . .nf - html files produced\. +$ puppet doc \-m pdf \-r configuration . .fi . .IP "" 0 -$ puppet doc \-r type > /tmp/type_reference\.rst -. -.P -or -. -.P -$ puppet doc \-\-outputdir /tmp/rdoc \-\-mode rdoc /path/to/manifests . -.P -or -. -.P -$ puppet doc /etc/puppet/manifests/site\.pp +.SH "AUTHOR" +Luke Kanies . -.P -or -. -.P -$ puppet doc \-m pdf \-r configurationLuke KaniesCopyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License +.SH "COPYRIGHT" +Copyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppetmasterd.8 b/man/man8/puppetmasterd.8 index dde93a3d6..9ed2a6ad6 100644 --- a/man/man8/puppetmasterd.8 +++ b/man/man8/puppetmasterd.8 @@ -1,52 +1,63 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETMASTERD" "8" "August 2010" "" "" -The central puppet server\. Functions as a certificate authority by default\.puppet master [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-h|\-\-help] +.TH "PUPPET\-MASTER" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-master\fR \- The puppet master daemon . -.nf - - [\-l|\-\-logdest <file>|console|syslog] [\-v|\-\-verbose] [\-V|\-\-version] +.SH "SYNOPSIS" +The central puppet server\. Functions as a certificate authority by default\. . -.fi +.SH "USAGE" +puppet master [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-h|\-\-help] [\-l|\-\-logdest \fIfile\fR|console|syslog] [\-v|\-\-verbose] [\-V|\-\-version] [\-\-compile \fInode\-name\fR] . -.IP "" 0 -This is the puppet central daemon\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +.SH "DESCRIPTION" +This command starts an instance of puppet master, running as a daemon and using Ruby\'s built\-in Webrick webserver\. Puppet master can also be managed by other application servers; when this is the case, this executable is not used\. . -.P -See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppetmasterdd with \'\-\-genconfig\'\. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. . .P -daemonize: Send the process into the background\. This is the default\. +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet master with \'\-\-genconfig\'\. . -.P -no\-daemonize: Do not send the process into the background\. +.TP +\-\-daemonize +Send the process into the background\. This is the default\. . -.P -debug: Enable full debugging\. +.TP +\-\-no\-daemonize +Do not send the process into the background\. . -.P -help: Print this help message\. +.TP +\-\-debug +Enable full debugging\. . -.P -logdest: Where to send messages\. Choose between syslog, the +.TP +\-\-help +Print this help message\. . -.IP "" 4 +.TP +\-\-logdest +Where to send messages\. Choose between syslog, the console, and a log file\. Defaults to sending messages to syslog, or the console if debugging or verbosity is enabled\. . -.nf - - console, and a log file\. Defaults to sending messages to - syslog, or the console if debugging or verbosity is - enabled\. +.TP +\-\-verbose +Enable verbosity\. . -.fi +.TP +\-\-version +Print the puppet version number and exit\. . -.IP "" 0 +.TP +\-\-compile +Compile a catalogue and output it in JSON from the puppet master\. Uses facts contained in the $vardir/yaml/ directory to compile the catalog\. . -.P -verbose: Enable verbosity\. +.SH "EXAMPLE" +puppet master . -.P -version: Print the puppet version number and exit\.puppet masterLuke KaniesCopyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppetqd.8 b/man/man8/puppetqd.8 index f630c74a5..7dbd683bf 100644 --- a/man/man8/puppetqd.8 +++ b/man/man8/puppetqd.8 @@ -1,20 +1,55 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETQD" "8" "August 2010" "" "" -puppet queue [\-d|\-\-debug] [\-v|\-\-verbose]This is a simple application that just processes entities in a queue as they are recieved\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. +.TH "PUPPET\-QUEUE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.P -See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppetd with \'\-\-genconfig\'\. +.SH "NAME" +\fBpuppet\-queue\fR \- Queuing daemon for asynchronous storeconfigs . -.P -debug: Enable full debugging\. +.SH "SYNOPSIS" +Retrieves serialized storeconfigs records from a queue and processes them in order\. . -.P -help: Print this help message +.SH "USAGE" +puppet queue [\-d|\-\-debug] [\-v|\-\-verbose] +. +.SH "DESCRIPTION" +This application runs as a daemon and processes storeconfigs data, retrieving the data from a stomp server message queue and writing it to a database\. . .P -verbose: Turn on verbose reporting\. +For more information, including instructions for properly setting up your puppet master and message queue, see the documentation on setting up asynchronous storeconfigs at: http://projects\.puppetlabs\.com/projects/1/wiki/Using_Stored_Configuration +. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'server\' is a valid configuration parameter, so you can specify \'\-\-server \fIservername\fR\' as an argument\. . .P -version: Print the puppet version number and exit\.puppet queueLuke KaniesCopyright (c) 2009 Puppet Labs, LLC Licensed under the GNU Public License +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet queue with \'\-\-genconfig\'\. +. +.TP +\-\-debug +Enable full debugging\. +. +.TP +\-\-help +Print this help message +. +.TP +\-\-verbose +Turn on verbose reporting\. +. +.TP +\-\-version +Print the puppet version number and exit\. +. +.SH "EXAMPLE" +. +.nf + +$ puppet queue +. +.fi +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2009 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/puppetrun.8 b/man/man8/puppetrun.8 index 09fa31b15..b6a868918 100644 --- a/man/man8/puppetrun.8 +++ b/man/man8/puppetrun.8 @@ -1,32 +1,34 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "PUPPETRUN" "8" "August 2010" "" "" -Trigger a puppet agent run on a set of hosts\.puppet kick [\-a|\-\-all] [\-c|\-\-class \fIclass\fR] [\-d|\-\-debug] [\-f|\-\-foreground] +.TH "PUPPET\-KICK" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-kick\fR \- Remotely control puppet agent . -.nf - - [\-h|\-\-help] [\-\-host <host>] [\-\-no\-fqdn] [\-\-ignoreschedules] - [\-t|\-\-tag <tag>] [\-\-test] [\-p|\-\-ping] <host> [<host> [\.\.\.]] +.SH "SYNOPSIS" +Trigger a puppet agent run on a set of hosts\. . -.fi +.SH "USAGE" +puppet kick [\-a|\-\-all] [\-c|\-\-class \fIclass\fR] [\-d|\-\-debug] [\-f|\-\-foreground] [\-h|\-\-help] [\-\-host \fIhost\fR] [\-\-no\-fqdn] [\-\-ignoreschedules] [\-t|\-\-tag \fItag\fR] [\-\-test] [\-p|\-\-ping] \fIhost\fR [\fIhost\fR [\.\.\.]] . -.IP "" 0 -This script can be used to connect to a set of machines running +puppet agent+ and trigger them to run their configurations\. The most common usage would be to specify a class of hosts and a set of tags, and +puppet kick+ would look up in LDAP all of the hosts matching that class, then connect to each host and trigger a run of all of the objects with the specified tags\. +.SH "DESCRIPTION" +This script can be used to connect to a set of machines running \'puppet agent\' and trigger them to run their configurations\. The most common usage would be to specify a class of hosts and a set of tags, and \'puppet kick\' would look up in LDAP all of the hosts matching that class, then connect to each host and trigger a run of all of the objects with the specified tags\. . .P If you are not storing your host configurations in LDAP, you can specify hosts manually\. . .P -You will most likely have to run +puppet kick+ as root to get access to the SSL certificates\. +You will most likely have to run \'puppet kick\' as root to get access to the SSL certificates\. . .P -+puppet kick+ reads +puppet master+\'s configuration file, so that it can copy things like LDAP settings\.+puppet kick+ is useless unless +puppet agent+ is listening\. See its documentation for more information, but the gist is that you must enable +listen+ on the +puppet agent+ daemon, either using +\-\-listen+ on the command line or adding \'listen: true\' in its config file\. In addition, you need to set the daemons up to specifically allow connections by creating the +namespaceauth+ file, normally at \'/etc/puppet/namespaceauth\.conf\'\. This file specifies who has access to each namespace; if you create the file you must add every namespace you want any Puppet daemon to allow \-\- it is currently global to all Puppet daemons\. +\'puppet kick\' reads \'puppet master\'\'s configuration file, so that it can copy things like LDAP settings\. +. +.SH "USAGE NOTES" +\'puppet kick\' is useless unless \'puppet agent\' is listening\. See its documentation for more information, but the gist is that you must enable \'listen\' on the \'puppet agent\' daemon, either using \'\-\-listen\' on the command line or adding \'listen = true\' in its config file\. In addition, you need to set the daemons up to specifically allow connections by creating the \'namespaceauth\' file, normally at \'/etc/puppet/namespaceauth\.conf\'\. This file specifies who has access to each namespace; if you create the file you must add every namespace you want any Puppet daemon to allow \-\- it is currently global to all Puppet daemons\. . .P -An example file looks like this:: +An example file looks like this: . .IP "" 4 . @@ -46,128 +48,68 @@ An example file looks like this:: .IP "" 0 . .P -This is what you would install on your Puppet master; non\-master hosts could leave off the \'fileserver\' and \'puppetmaster\' namespaces\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. -. -.P -See the configuration file documentation at http://reductivelabs\.com/projects/puppet/reference/configref\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet master with \'\-\-genconfig\'\. -. -.P -all: Connect to all available hosts\. Requires LDAP support -. -.IP "" 4 -. -.nf - - at this point\. -. -.fi -. -.IP "" 0 -. -.P -class: Specify a class of machines to which to connect\. This -. -.IP "" 4 -. -.nf - - only works if you have LDAP configured, at the moment\. -. -.fi -. -.IP "" 0 -. -.P -debug: Enable full debugging\. -. -.P -foreground: Run each configuration in the foreground; that is, when -. -.IP "" 4 -. -.nf - - connecting to a host, do not return until the host has - finished its run\. The default is false\. -. -.fi -. -.IP "" 0 -. -.P -help: Print this help message +This is what you would install on your Puppet master; non\-master hosts could leave off the \'fileserver\' and \'puppetmaster\' namespaces\. . -.P -host: A specific host to which to connect\. This flag can be -. -.IP "" 4 -. -.nf - - specified more than once\. -. -.fi -. -.IP "" 0 +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. . .P -ignoreschedules: Whether the client should ignore schedules when running +See the configuration file documentation at http://docs\.puppetlabs\.com/references/latest/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet master with \'\-\-genconfig\'\. . -.IP "" 4 +.TP +\-\-all +Connect to all available hosts\. Requires LDAP support at this point\. . -.nf - - its configuration\. This can be used to force the client - to perform work it would not normally perform so soon\. - The default is false\. +.TP +\-\-class +Specify a class of machines to which to connect\. This only works if you have LDAP configured, at the moment\. . -.fi +.TP +\-\-debug +Enable full debugging\. . -.IP "" 0 +.TP +\-\-foreground +Run each configuration in the foreground; that is, when connecting to a host, do not return until the host has finished its run\. The default is false\. . -.P -parallel: How parallel to make the connections\. Parallelization +.TP +\-\-help +Print this help message . -.IP "" 4 +.TP +\-\-host +A specific host to which to connect\. This flag can be specified more than once\. . -.nf - - is provided by forking for each client to which to - connect\. The default is 1, meaning serial execution\. -. -.fi -. -.IP "" 0 -. -.P -tag: Specify a tag for selecting the objects to apply\. Does -. -.IP "" 4 +.TP +\-\-ignoreschedules +Whether the client should ignore schedules when running its configuration\. This can be used to force the client to perform work it would not normally perform so soon\. The default is false\. . -.nf - - not work with the \-\-test option\. +.TP +\-\-parallel +How parallel to make the connections\. Parallelization is provided by forking for each client to which to connect\. The default is 1, meaning serial execution\. . -.fi +.TP +\-\-tag +Specify a tag for selecting the objects to apply\. Does not work with the \-\-test option\. . -.IP "" 0 +.TP +\-\-test +Print the hosts you would connect to but do not actually connect\. This option requires LDAP support at this point\. . -.P -test: Print the hosts you would connect to but do not +.TP +\-\-ping +Do a ICMP echo against the target host\. Skip hosts that don\'t respond to ping\. . -.IP "" 4 +.SH "EXAMPLE" . .nf - actually connect\. This option requires LDAP support at - this point\. +$ sudo puppet kick \-p 10 \-t remotefile \-t webserver host1 host2 . .fi . -.IP "" 0 +.SH "AUTHOR" +Luke Kanies . -.P -ping:: -. -.P -Do a ICMP echo against the target host\. Skip hosts that don\'t respond to ping\.sudo puppet kick \-p 10 \-t remotefile \-t webserver host1 host2Luke KaniesCopyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License +.SH "COPYRIGHT" +Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/man/man8/ralsh.8 b/man/man8/ralsh.8 index bdc81e90a..738537e84 100644 --- a/man/man8/ralsh.8 +++ b/man/man8/ralsh.8 @@ -1,85 +1,84 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "RALSH" "8" "August 2010" "" "" -Use the Puppet RAL to directly interact with the system\.puppet resource [\-h|\-\-help] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-edit] +.TH "PUPPET\-RESOURCE" "8" "February 2011" "Puppet Labs, LLC" "Puppet manual" . -.IP "" 4 +.SH "NAME" +\fBpuppet\-resource\fR \- The resource abstraction layer shell . -.nf - - [\-H|\-\-host <host>] [\-p|\-\-param <param>] [\-t|\-\-types] - type <name> +.SH "SYNOPSIS" +Uses the Puppet RAL to directly interact with the system\. . -.fi +.SH "USAGE" +puppet resource [\-h|\-\-help] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-edit] [\-H|\-\-host \fIhost\fR] [\-p|\-\-param \fIparameter\fR] [\-t|\-\-types] \fItype\fR [\fIname\fR] [\fIattribute\fR=\fIvalue\fR \.\.\.] . -.IP "" 0 -This command provides simple facilities for converting current system state into Puppet code, along with some ability to use Puppet to affect the current state\. +.SH "DESCRIPTION" +This command provides simple facilities for converting current system state into Puppet code, along with some ability to modify the current state using Puppet\'s RAL\. . .P -By default, you must at least provide a type to list, which case puppet resource will tell you everything it knows about all instances of that type\. You can optionally specify an instance name, and puppet resource will only describe that single instance\. +By default, you must at least provide a type to list, in which case puppet resource will tell you everything it knows about all resources of that type\. You can optionally specify an instance name, and puppet resource will only describe that single instance\. . .P -You can also add +\-\-edit+ as an argument, and puppet resource will write its output to a file, open that file in an editor, and then apply the file as a Puppet transaction\. You can easily use this to use Puppet to make simple changes to a system\.Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. +If given a type, a name, and a series of \fIattribute\fR=\fIvalue\fR pairs, puppet resource will modify the state of the specified resource\. Alternately, if given a type, a name, and the \'\-\-edit\' flag, puppet resource will write its output to a file, open that file in an editor, and then apply the saved file as a Puppet transaction\. . -.P -See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. +.SH "OPTIONS" +Note that any configuration parameter that\'s valid in the configuration file is also a valid long argument\. For example, \'ssldir\' is a valid configuration parameter, so you can specify \'\-\-ssldir \fIdirectory\fR\' as an argument\. . .P -debug: Enable full debugging\. +See the configuration file documentation at http://docs\.puppetlabs\.com/references/stable/configuration\.html for the full list of acceptable parameters\. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'\. . -.P -edit: +.TP +\-\-debug +Enable full debugging\. . -.P +.TP +\-\-edit Write the results of the query to a file, open the file in an editor, and read the file back in as an executable Puppet manifest\. . -.P -host: -. -.P +.TP +\-\-host When specified, connect to the resource server on the named host and retrieve the list of resouces of the type specified\. . -.P -help: -. -.P +.TP +\-\-help Print this help message\. . -.P -param: -. -.P +.TP +\-\-param Add more parameters to be outputted from queries\. . -.P -types: -. -.P +.TP +\-\-types List all available types\. . -.P -verbose: +.TP +\-\-verbose +Print extra information\. . -.P -Print extra information\.This example uses \fBpuppet resource\fR to return Puppet configuration for the user \fBluke\fR: +.SH "EXAMPLE" +This example uses \fBpuppet resource\fR to return a Puppet configuration for the user \fBluke\fR: . .IP "" 4 . .nf - $ puppet resource user luke - user { \'luke\': - home => \'/home/luke\', - uid => \'100\', - ensure => \'present\', - comment => \'Luke Kanies,,,\', - gid => \'1000\', - shell => \'/bin/bash\', - groups => [\'sysadmin\',\'audio\',\'video\',\'puppet\'] - } +$ puppet resource user luke +user { \'luke\': + home => \'/home/luke\', + uid => \'100\', + ensure => \'present\', + comment => \'Luke Kanies,,,\', + gid => \'1000\', + shell => \'/bin/bash\', + groups => [\'sysadmin\',\'audio\',\'video\',\'puppet\'] +} . .fi . .IP "" 0 -Luke KaniesCopyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License +. +.SH "AUTHOR" +Luke Kanies +. +.SH "COPYRIGHT" +Copyright (c) 2005\-2007 Puppet Labs, LLC Licensed under the GNU Public License diff --git a/spec/fixtures/integration/provider/mailalias/aliases/test1 b/spec/fixtures/integration/provider/mailalias/aliases/test1 new file mode 100644 index 000000000..ecf532213 --- /dev/null +++ b/spec/fixtures/integration/provider/mailalias/aliases/test1 @@ -0,0 +1,28 @@ +# Basic system aliases -- these MUST be present +MAILER-DAEMON: postmaster +postmaster: root + +# General redirections for pseudo accounts +bin: root +daemon: root +named: root +nobody: root +uucp: root +www: root +ftp-bugs: root +postfix: root + +# Put your local aliases here. + +# Well-known aliases +manager: root +dumper: root +operator: root +abuse: postmaster + +# trap decode to catch security attacks +decode: root + +# Other tests +anothertest: "|/path/to/rt-mailgate --queue 'another test' --action correspond --url http://my.com/" +test: "|/path/to/rt-mailgate --queue 'test' --action correspond --url http://my.com/" diff --git a/spec/fixtures/unit/parser/lexer/aliastest.pp b/spec/fixtures/unit/parser/lexer/aliastest.pp new file mode 100644 index 000000000..f2b61592e --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/aliastest.pp @@ -0,0 +1,16 @@ +file { "a file": + path => "/tmp/aliastest", + ensure => file +} + +file { "another": + path => "/tmp/aliastest2", + ensure => file, + require => File["a file"] +} + +file { "a third": + path => "/tmp/aliastest3", + ensure => file, + require => File["/tmp/aliastest"] +} diff --git a/spec/fixtures/unit/parser/lexer/append.pp b/spec/fixtures/unit/parser/lexer/append.pp new file mode 100644 index 000000000..20cbda662 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/append.pp @@ -0,0 +1,11 @@ +$var=['/tmp/file1','/tmp/file2'] + +class arraytest { + $var += ['/tmp/file3', '/tmp/file4'] + file { + $var: + content => "test" + } +} + +include arraytest diff --git a/spec/fixtures/unit/parser/lexer/argumentdefaults.pp b/spec/fixtures/unit/parser/lexer/argumentdefaults.pp new file mode 100644 index 000000000..eac9dd757 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/argumentdefaults.pp @@ -0,0 +1,14 @@ +# $Id$ + +define testargs($file, $mode = 755) { + file { $file: ensure => file, mode => $mode } +} + +testargs { "testingname": + file => "/tmp/argumenttest1" +} + +testargs { "testingother": + file => "/tmp/argumenttest2", + mode => 644 +} diff --git a/spec/fixtures/unit/parser/lexer/arithmetic_expression.pp b/spec/fixtures/unit/parser/lexer/arithmetic_expression.pp new file mode 100644 index 000000000..aae98a4db --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/arithmetic_expression.pp @@ -0,0 +1,8 @@ + +$one = 1.30 +$two = 2.034e-2 + +$result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9) + + +notice("result is $result == 1295.87692307692")
\ No newline at end of file diff --git a/spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp b/spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp new file mode 100644 index 000000000..a410f9553 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp @@ -0,0 +1,3 @@ +file { + ["/tmp/arraytrailingcomma1","/tmp/arraytrailingcomma2", ]: content => "tmp" +} diff --git a/spec/fixtures/unit/parser/lexer/casestatement.pp b/spec/fixtures/unit/parser/lexer/casestatement.pp new file mode 100644 index 000000000..66ecd72b9 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/casestatement.pp @@ -0,0 +1,65 @@ +# $Id$ + +$var = "value" + +case $var { + "nope": { + file { "/tmp/fakefile": mode => 644, ensure => file } + } + "value": { + file { "/tmp/existsfile": mode => 755, ensure => file } + } +} + +$ovar = "yayness" + +case $ovar { + "fooness": { + file { "/tmp/nostillexistsfile": mode => 644, ensure => file } + } + "booness", "yayness": { + case $var { + "nep": { + file { "/tmp/noexistsfile": mode => 644, ensure => file } + } + "value": { + file { "/tmp/existsfile2": mode => 755, ensure => file } + } + } + } +} + +case $ovar { + "fooness": { + file { "/tmp/nostillexistsfile": mode => 644, ensure => file } + } + default: { + file { "/tmp/existsfile3": mode => 755, ensure => file } + } +} + +$bool = true + +case $bool { + true: { + file { "/tmp/existsfile4": mode => 755, ensure => file } + } +} + +$yay = yay +$a = yay +$b = boo + +case $yay { + $a: { file { "/tmp/existsfile5": mode => 755, ensure => file } } + $b: { file { "/tmp/existsfile5": mode => 644, ensure => file } } + default: { file { "/tmp/existsfile5": mode => 711, ensure => file } } + +} + +$regexvar = "exists regex" +case $regexvar { + "no match": { file { "/tmp/existsfile6": mode => 644, ensure => file } } + /(.*) regex$/: { file { "/tmp/${1}file6": mode => 755, ensure => file } } + default: { file { "/tmp/existsfile6": mode => 711, ensure => file } } +} diff --git a/spec/fixtures/unit/parser/lexer/classheirarchy.pp b/spec/fixtures/unit/parser/lexer/classheirarchy.pp new file mode 100644 index 000000000..36619d8b9 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/classheirarchy.pp @@ -0,0 +1,15 @@ +# $Id$ + +class base { + file { "/tmp/classheir1": ensure => file, mode => 755 } +} + +class sub1 inherits base { + file { "/tmp/classheir2": ensure => file, mode => 755 } +} + +class sub2 inherits base { + file { "/tmp/classheir3": ensure => file, mode => 755 } +} + +include sub1, sub2 diff --git a/spec/fixtures/unit/parser/lexer/classincludes.pp b/spec/fixtures/unit/parser/lexer/classincludes.pp new file mode 100644 index 000000000..bd5b44ed7 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/classincludes.pp @@ -0,0 +1,17 @@ +# $Id$ + +class base { + file { "/tmp/classincludes1": ensure => file, mode => 755 } +} + +class sub1 inherits base { + file { "/tmp/classincludes2": ensure => file, mode => 755 } +} + +class sub2 inherits base { + file { "/tmp/classincludes3": ensure => file, mode => 755 } +} + +$sub = "sub2" + +include sub1, $sub diff --git a/spec/fixtures/unit/parser/lexer/classpathtest.pp b/spec/fixtures/unit/parser/lexer/classpathtest.pp new file mode 100644 index 000000000..580333369 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/classpathtest.pp @@ -0,0 +1,11 @@ +# $Id$ + +define mytype { + file { "/tmp/classtest": ensure => file, mode => 755 } +} + +class testing { + mytype { "componentname": } +} + +include testing diff --git a/spec/fixtures/unit/parser/lexer/collection.pp b/spec/fixtures/unit/parser/lexer/collection.pp new file mode 100644 index 000000000..bc29510a9 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/collection.pp @@ -0,0 +1,10 @@ +class one { + @file { "/tmp/colltest1": content => "one" } + @file { "/tmp/colltest2": content => "two" } +} + +class two { + File <| content == "one" |> +} + +include one, two diff --git a/spec/fixtures/unit/parser/lexer/collection_override.pp b/spec/fixtures/unit/parser/lexer/collection_override.pp new file mode 100644 index 000000000..b1b39ab16 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/collection_override.pp @@ -0,0 +1,8 @@ +@file { + "/tmp/collection": + content => "whatever" +} + +File<| |> { + mode => 0600 +} diff --git a/spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp b/spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp new file mode 100644 index 000000000..3c21468b0 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp @@ -0,0 +1,20 @@ +define test($name) { + file {"/tmp/collection_within_virtual_definitions1_$name.txt": + content => "File name $name\n" + } + Test2 <||> +} + +define test2() { + file {"/tmp/collection_within_virtual_definitions2_$name.txt": + content => "This is a test\n" + } +} + +node default { + @test {"foo": + name => "foo" + } + @test2 {"foo2": } + Test <||> +} diff --git a/spec/fixtures/unit/parser/lexer/componentmetaparams.pp b/spec/fixtures/unit/parser/lexer/componentmetaparams.pp new file mode 100644 index 000000000..7d9f0c2c1 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/componentmetaparams.pp @@ -0,0 +1,11 @@ +file { "/tmp/component1": + ensure => file +} + +define thing { + file { $name: ensure => file } +} + +thing { "/tmp/component2": + require => File["/tmp/component1"] +} diff --git a/spec/fixtures/unit/parser/lexer/componentrequire.pp b/spec/fixtures/unit/parser/lexer/componentrequire.pp new file mode 100644 index 000000000..a61d2050c --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/componentrequire.pp @@ -0,0 +1,8 @@ +define testfile($mode) { + file { $name: mode => $mode, ensure => present } +} + +testfile { "/tmp/testing_component_requires2": mode => 755 } + +file { "/tmp/testing_component_requires1": mode => 755, ensure => present, + require => Testfile["/tmp/testing_component_requires2"] } diff --git a/spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp b/spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp new file mode 100644 index 000000000..249e6334d --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp @@ -0,0 +1,23 @@ +# $Id$ + +class base { + file { "/tmp/deepclassheir1": ensure => file, mode => 755 } +} + +class sub1 inherits base { + file { "/tmp/deepclassheir2": ensure => file, mode => 755 } +} + +class sub2 inherits sub1 { + file { "/tmp/deepclassheir3": ensure => file, mode => 755 } +} + +class sub3 inherits sub2 { + file { "/tmp/deepclassheir4": ensure => file, mode => 755 } +} + +class sub4 inherits sub3 { + file { "/tmp/deepclassheir5": ensure => file, mode => 755 } +} + +include sub4 diff --git a/spec/fixtures/unit/parser/lexer/defineoverrides.pp b/spec/fixtures/unit/parser/lexer/defineoverrides.pp new file mode 100644 index 000000000..c68b139e3 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/defineoverrides.pp @@ -0,0 +1,17 @@ +# $Id$ + +$file = "/tmp/defineoverrides1" + +define myfile($mode) { + file { $name: ensure => file, mode => $mode } +} + +class base { + myfile { $file: mode => 644 } +} + +class sub inherits base { + Myfile[$file] { mode => 755, } # test the end-comma +} + +include sub diff --git a/spec/fixtures/unit/parser/lexer/emptyclass.pp b/spec/fixtures/unit/parser/lexer/emptyclass.pp new file mode 100644 index 000000000..48047e748 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/emptyclass.pp @@ -0,0 +1,9 @@ +# $Id$ + +define component { +} + +class testing { +} + +include testing diff --git a/spec/fixtures/unit/parser/lexer/emptyexec.pp b/spec/fixtures/unit/parser/lexer/emptyexec.pp new file mode 100644 index 000000000..847a30d18 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/emptyexec.pp @@ -0,0 +1,3 @@ +exec { "touch /tmp/emptyexectest": + path => "/usr/bin:/bin" +} diff --git a/spec/fixtures/unit/parser/lexer/emptyifelse.pp b/spec/fixtures/unit/parser/lexer/emptyifelse.pp new file mode 100644 index 000000000..598b486ac --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/emptyifelse.pp @@ -0,0 +1,9 @@ + +if false { +} else { + # nothing here +} + +if true { + # still nothing +} diff --git a/spec/fixtures/unit/parser/lexer/falsevalues.pp b/spec/fixtures/unit/parser/lexer/falsevalues.pp new file mode 100644 index 000000000..2143b79a7 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/falsevalues.pp @@ -0,0 +1,3 @@ +$value = false + +file { "/tmp/falsevalues$value": ensure => file } diff --git a/spec/fixtures/unit/parser/lexer/filecreate.pp b/spec/fixtures/unit/parser/lexer/filecreate.pp new file mode 100644 index 000000000..d7972c234 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/filecreate.pp @@ -0,0 +1,11 @@ +# $Id$ + +file { + "/tmp/createatest": ensure => file, mode => 755; + "/tmp/createbtest": ensure => file, mode => 755 +} + +file { + "/tmp/createctest": ensure => file; + "/tmp/createdtest": ensure => file; +} diff --git a/spec/fixtures/unit/parser/lexer/fqdefinition.pp b/spec/fixtures/unit/parser/lexer/fqdefinition.pp new file mode 100644 index 000000000..ddb0675a9 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/fqdefinition.pp @@ -0,0 +1,5 @@ +define one::two($ensure) { + file { "/tmp/fqdefinition": ensure => $ensure } +} + +one::two { "/tmp/fqdefinition": ensure => file } diff --git a/spec/fixtures/unit/parser/lexer/fqparents.pp b/spec/fixtures/unit/parser/lexer/fqparents.pp new file mode 100644 index 000000000..ee2f65423 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/fqparents.pp @@ -0,0 +1,11 @@ +class base { + class one { + file { "/tmp/fqparent1": ensure => file } + } +} + +class two::three inherits base::one { + file { "/tmp/fqparent2": ensure => file } +} + +include two::three diff --git a/spec/fixtures/unit/parser/lexer/funccomma.pp b/spec/fixtures/unit/parser/lexer/funccomma.pp new file mode 100644 index 000000000..32e34f92e --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/funccomma.pp @@ -0,0 +1,5 @@ +@file { + ["/tmp/funccomma1","/tmp/funccomma2"]: content => "1" +} + +realize( File["/tmp/funccomma1"], File["/tmp/funccomma2"] , ) diff --git a/spec/fixtures/unit/parser/lexer/hash.pp b/spec/fixtures/unit/parser/lexer/hash.pp new file mode 100644 index 000000000..d33249872 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/hash.pp @@ -0,0 +1,33 @@ + +$hash = { "file" => "/tmp/myhashfile1" } + +file { + $hash["file"]: + ensure => file, content => "content"; +} + +$hash2 = { "a" => { key => "/tmp/myhashfile2" }} + +file { + $hash2["a"][key]: + ensure => file, content => "content"; +} + +define test($a = { "b" => "c" }) { + file { + $a["b"]: + ensure => file, content => "content" + } +} + +test { + "test": + a => { "b" => "/tmp/myhashfile3" } +} + +$hash3 = { mykey => "/tmp/myhashfile4" } +$key = "mykey" + +file { + $hash3[$key]: ensure => file, content => "content" +} diff --git a/spec/fixtures/unit/parser/lexer/ifexpression.pp b/spec/fixtures/unit/parser/lexer/ifexpression.pp new file mode 100644 index 000000000..29a637291 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/ifexpression.pp @@ -0,0 +1,12 @@ +$one = 1 +$two = 2 + +if ($one < $two) and (($two < 3) or ($two == 2)) { + notice("True!") +} + +if "test regex" =~ /(.*) regex/ { + file { + "/tmp/${1}iftest": ensure => file, mode => 0755 + } +} diff --git a/spec/fixtures/unit/parser/lexer/implicititeration.pp b/spec/fixtures/unit/parser/lexer/implicititeration.pp new file mode 100644 index 000000000..6f34cb29c --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/implicititeration.pp @@ -0,0 +1,15 @@ +# $Id$ + +$files = ["/tmp/iterationatest", "/tmp/iterationbtest"] + +file { $files: ensure => file, mode => 755 } + +file { ["/tmp/iterationctest", "/tmp/iterationdtest"]: + ensure => file, + mode => 755 +} + +file { + ["/tmp/iterationetest", "/tmp/iterationftest"]: ensure => file, mode => 755; + ["/tmp/iterationgtest", "/tmp/iterationhtest"]: ensure => file, mode => 755; +} diff --git a/spec/fixtures/unit/parser/lexer/multilinecomments.pp b/spec/fixtures/unit/parser/lexer/multilinecomments.pp new file mode 100644 index 000000000..f9819c020 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/multilinecomments.pp @@ -0,0 +1,10 @@ + +/* +file { + "/tmp/multilinecomments": content => "pouet" +} +*/ + +/* and another one for #2333, the whitespace after the +end comment is here on purpose */ + diff --git a/spec/fixtures/unit/parser/lexer/multipleclass.pp b/spec/fixtures/unit/parser/lexer/multipleclass.pp new file mode 100644 index 000000000..ae02edc38 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/multipleclass.pp @@ -0,0 +1,9 @@ +class one { + file { "/tmp/multipleclassone": content => "one" } +} + +class one { + file { "/tmp/multipleclasstwo": content => "two" } +} + +include one diff --git a/spec/fixtures/unit/parser/lexer/multipleinstances.pp b/spec/fixtures/unit/parser/lexer/multipleinstances.pp new file mode 100644 index 000000000..2f9b3c2e8 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/multipleinstances.pp @@ -0,0 +1,7 @@ +# $Id$ + +file { + "/tmp/multipleinstancesa": ensure => file, mode => 755; + "/tmp/multipleinstancesb": ensure => file, mode => 755; + "/tmp/multipleinstancesc": ensure => file, mode => 755; +} diff --git a/spec/fixtures/unit/parser/lexer/multisubs.pp b/spec/fixtures/unit/parser/lexer/multisubs.pp new file mode 100644 index 000000000..bcec69e2a --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/multisubs.pp @@ -0,0 +1,13 @@ +class base { + file { "/tmp/multisubtest": content => "base", mode => 644 } +} + +class sub1 inherits base { + File["/tmp/multisubtest"] { mode => 755 } +} + +class sub2 inherits base { + File["/tmp/multisubtest"] { content => sub2 } +} + +include sub1, sub2 diff --git a/spec/fixtures/unit/parser/lexer/namevartest.pp b/spec/fixtures/unit/parser/lexer/namevartest.pp new file mode 100644 index 000000000..dbee1c356 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/namevartest.pp @@ -0,0 +1,9 @@ +define filetest($mode, $ensure = file) { + file { $name: + mode => $mode, + ensure => $ensure + } +} + +filetest { "/tmp/testfiletest": mode => 644} +filetest { "/tmp/testdirtest": mode => 755, ensure => directory} diff --git a/spec/fixtures/unit/parser/lexer/scopetest.pp b/spec/fixtures/unit/parser/lexer/scopetest.pp new file mode 100644 index 000000000..331491766 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/scopetest.pp @@ -0,0 +1,13 @@ + +$mode = 640 + +define thing { + file { "/tmp/$name": ensure => file, mode => $mode } +} + +class testing { + $mode = 755 + thing {scopetest: } +} + +include testing diff --git a/spec/fixtures/unit/parser/lexer/selectorvalues.pp b/spec/fixtures/unit/parser/lexer/selectorvalues.pp new file mode 100644 index 000000000..d80d26c36 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/selectorvalues.pp @@ -0,0 +1,49 @@ +$value1 = "" +$value2 = true +$value3 = false +$value4 = yay + +$test = "yay" + +$mode1 = $value1 ? { + "" => 755, + default => 644 +} + +$mode2 = $value2 ? { + true => 755, + default => 644 +} + +$mode3 = $value3 ? { + false => 755, + default => 644 +} + +$mode4 = $value4 ? { + $test => 755, + default => 644 +} + +$mode5 = yay ? { + $test => 755, + default => 644 +} + +$mode6 = $mode5 ? { + 755 => 755 +} + +$mode7 = "test regex" ? { + /regex$/ => 755, + default => 644 +} + + +file { "/tmp/selectorvalues1": ensure => file, mode => $mode1 } +file { "/tmp/selectorvalues2": ensure => file, mode => $mode2 } +file { "/tmp/selectorvalues3": ensure => file, mode => $mode3 } +file { "/tmp/selectorvalues4": ensure => file, mode => $mode4 } +file { "/tmp/selectorvalues5": ensure => file, mode => $mode5 } +file { "/tmp/selectorvalues6": ensure => file, mode => $mode6 } +file { "/tmp/selectorvalues7": ensure => file, mode => $mode7 } diff --git a/spec/fixtures/unit/parser/lexer/simpledefaults.pp b/spec/fixtures/unit/parser/lexer/simpledefaults.pp new file mode 100644 index 000000000..63d199a68 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/simpledefaults.pp @@ -0,0 +1,5 @@ +# $Id$ + +File { mode => 755 } + +file { "/tmp/defaulttest": ensure => file } diff --git a/spec/fixtures/unit/parser/lexer/simpleselector.pp b/spec/fixtures/unit/parser/lexer/simpleselector.pp new file mode 100644 index 000000000..8b9bc7292 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/simpleselector.pp @@ -0,0 +1,38 @@ +# $Id$ + +$var = "value" + +file { "/tmp/snippetselectatest": + ensure => file, + mode => $var ? { + nottrue => 641, + value => 755 + } +} + +file { "/tmp/snippetselectbtest": + ensure => file, + mode => $var ? { + nottrue => 644, + default => 755 + } +} + +$othervar = "complex value" + +file { "/tmp/snippetselectctest": + ensure => file, + mode => $othervar ? { + "complex value" => 755, + default => 644 + } +} +$anothervar = Yayness + +file { "/tmp/snippetselectdtest": + ensure => file, + mode => $anothervar ? { + Yayness => 755, + default => 644 + } +} diff --git a/spec/fixtures/unit/parser/lexer/singleary.pp b/spec/fixtures/unit/parser/lexer/singleary.pp new file mode 100644 index 000000000..9ce56dd89 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/singleary.pp @@ -0,0 +1,19 @@ +# $Id$ + +file { "/tmp/singleary1": + ensure => file +} + +file { "/tmp/singleary2": + ensure => file +} + +file { "/tmp/singleary3": + ensure => file, + require => [File["/tmp/singleary1"], File["/tmp/singleary2"]] +} + +file { "/tmp/singleary4": + ensure => file, + require => [File["/tmp/singleary1"]] +} diff --git a/spec/fixtures/unit/parser/lexer/singlequote.pp b/spec/fixtures/unit/parser/lexer/singlequote.pp new file mode 100644 index 000000000..dc876a2f8 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/singlequote.pp @@ -0,0 +1,11 @@ +# $Id$ + +file { "/tmp/singlequote1": + ensure => file, + content => 'a $quote' +} + +file { "/tmp/singlequote2": + ensure => file, + content => 'some "\yayness\"' +} diff --git a/spec/fixtures/unit/parser/lexer/singleselector.pp b/spec/fixtures/unit/parser/lexer/singleselector.pp new file mode 100644 index 000000000..520a14017 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/singleselector.pp @@ -0,0 +1,22 @@ +$value1 = "" +$value2 = true +$value3 = false +$value4 = yay + +$test = "yay" + +$mode1 = $value1 ? { + "" => 755 +} + +$mode2 = $value2 ? { + true => 755 +} + +$mode3 = $value3 ? { + default => 755 +} + +file { "/tmp/singleselector1": ensure => file, mode => $mode1 } +file { "/tmp/singleselector2": ensure => file, mode => $mode2 } +file { "/tmp/singleselector3": ensure => file, mode => $mode3 } diff --git a/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp b/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp new file mode 100755 index 000000000..10f1d75ed --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp @@ -0,0 +1,11 @@ +#!/usr/bin/env puppet + +class one::fake { + file { "/tmp/subclass_name_duplication1": ensure => present } +} + +class two::fake { + file { "/tmp/subclass_name_duplication2": ensure => present } +} + +include one::fake, two::fake diff --git a/spec/fixtures/unit/parser/lexer/tag.pp b/spec/fixtures/unit/parser/lexer/tag.pp new file mode 100644 index 000000000..e6e770dd9 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/tag.pp @@ -0,0 +1,9 @@ +# $Id$ + +$variable = value + +tag yayness, rahness + +tag booness, $variable + +file { "/tmp/settestingness": ensure => file } diff --git a/spec/fixtures/unit/parser/lexer/tagged.pp b/spec/fixtures/unit/parser/lexer/tagged.pp new file mode 100644 index 000000000..7bf90a645 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/tagged.pp @@ -0,0 +1,35 @@ +# $Id$ + +tag testing +tag(funtest) + +class tagdefine { + $path = tagged(tagdefine) ? { + true => "true", false => "false" + } + + file { "/tmp/taggeddefine$path": ensure => file } +} + +include tagdefine + +$yayness = tagged(yayness) ? { + true => "true", false => "false" +} + +$funtest = tagged(testing) ? { + true => "true", false => "false" +} + +$both = tagged(testing, yayness) ? { + true => "true", false => "false" +} + +$bothtrue = tagged(testing, testing) ? { + true => "true", false => "false" +} + +file { "/tmp/taggedyayness$yayness": ensure => file } +file { "/tmp/taggedtesting$funtest": ensure => file } +file { "/tmp/taggedboth$both": ensure => file } +file { "/tmp/taggedbothtrue$bothtrue": ensure => file } diff --git a/spec/fixtures/unit/parser/lexer/virtualresources.pp b/spec/fixtures/unit/parser/lexer/virtualresources.pp new file mode 100644 index 000000000..a29406b84 --- /dev/null +++ b/spec/fixtures/unit/parser/lexer/virtualresources.pp @@ -0,0 +1,14 @@ +class one { + @file { "/tmp/virtualtest1": content => "one" } + @file { "/tmp/virtualtest2": content => "two" } + @file { "/tmp/virtualtest3": content => "three" } + @file { "/tmp/virtualtest4": content => "four" } +} + +class two { + File <| content == "one" |> + realize File["/tmp/virtualtest2"] + realize(File["/tmp/virtualtest3"], File["/tmp/virtualtest4"]) +} + +include one, two diff --git a/spec/fixtures/unit/provider/host/parsed/valid_hosts b/spec/fixtures/unit/provider/host/parsed/valid_hosts new file mode 100644 index 000000000..24636295d --- /dev/null +++ b/spec/fixtures/unit/provider/host/parsed/valid_hosts @@ -0,0 +1,19 @@ +# Some leading comment, that should be ignored +# The next line is empty so it should be ignored + +::1 localhost + +# We now try another delimiter: Several tabs +127.0.0.1 localhost + +# No test trailing spaces +10.0.0.1 host1 + +# Ok its time to test aliases +2001:252:0:1::2008:8 ipv6host alias1 +192.168.0.1 ipv4host alias2 alias3 + +# Testing inlinecomments now +192.168.0.2 host3 # This is host3 +192.168.0.3 host4 alias10 # This is host4 +192.168.0.4 host5 alias11 alias12 # This is host5 diff --git a/spec/fixtures/unit/provider/mount/mount-output.aix.txt b/spec/fixtures/unit/provider/mount/mount-output.aix.txt index 54edb9c1c..380dbc5ae 100644 --- a/spec/fixtures/unit/provider/mount/mount-output.aix.txt +++ b/spec/fixtures/unit/provider/mount/mount-output.aix.txt @@ -1,7 +1,7 @@ -/dev/hd4 / jfs2 Nov 11 12:11 rw,log=/dev/hd8 -/dev/hd2 /usr jfs2 Nov 11 12:11 rw,log=/dev/hd8 -/dev/hd9var /var jfs2 Nov 11 12:11 rw,log=/dev/hd8 -/dev/hd3 /tmp jfs2 Nov 11 12:11 rw,log=/dev/hd8 -/dev/hd1 /home jfs2 Nov 11 12:11 rw,log=/dev/hd8 -/proc /proc procfs Nov 11 12:11 rw -/dev/hd10opt /opt jfs2 Nov 11 12:11 rw,log=/dev/hd8 +node mounted mounted over vfs date options +---- ------- ------------ --- ------------ ------------------- + /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 + /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 +sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 diff --git a/spec/fixtures/unit/provider/mount/parsed/aix.filesystems b/spec/fixtures/unit/provider/mount/parsed/aix.filesystems new file mode 100644 index 000000000..7347f2b8c --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/aix.filesystems @@ -0,0 +1,144 @@ +* IBM_PROLOG_BEGIN_TAG +* This is an automatically generated prolog. +* +* bos61B src/bos/etc/filesystems/filesystems 1.23 +* +* Licensed Materials - Property of IBM +* +* COPYRIGHT International Business Machines Corp. 1985,1993 +* All Rights Reserved +* +* US Government Users Restricted Rights - Use, duplication or +* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +* +* @(#)filesystems @(#)29 1.23 src/bos/etc/filesystems/filesystems, cmdfs, bos61B, b2007_38A8 8/16/07 17:18:35 +* IBM_PROLOG_END_TAG +* +* COMPONENT_NAME: CMDFS +* +* FUNCTIONS: none +* +* ORIGINS: 27 +* +* (C) COPYRIGHT International Business Machines Corp. 1985, 1993 +* All Rights Reserved +* Licensed Materials - Property of IBM +* +* US Government Users Restricted Rights - Use, duplication or +* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +* +* +* +* This version of /etc/filesystems assumes that only the root file system +* is created and ready. As new file systems are added, change the check, +* mount, free, log, vol and vfs entries for the appropriate stanza. +* + +/: + dev = /dev/hd4 + vfs = jfs2 + log = /dev/hd8 + mount = automatic + check = false + type = bootfs + vol = root + free = true + quota = no + +/home: + dev = /dev/hd1 + vfs = jfs2 + log = /dev/hd8 + mount = true + check = true + vol = /home + free = false + quota = no + +/usr: + dev = /dev/hd2 + vfs = jfs2 + log = /dev/hd8 + mount = automatic + check = false + type = bootfs + vol = /usr + free = false + quota = no + +/var: + dev = /dev/hd9var + vfs = jfs2 + log = /dev/hd8 + mount = automatic + check = false + type = bootfs + vol = /var + free = false + quota = no + +/tmp: + dev = /dev/hd3 + vfs = jfs2 + log = /dev/hd8 + mount = automatic + check = false + vol = /tmp + free = false + quota = no + +/admin: + dev = /dev/hd11admin + vfs = jfs2 + log = /dev/hd8 + mount = true + check = false + vol = /admin + free = false + quota = no + +/proc: + dev = /proc + vol = "/proc" + mount = true + check = false + free = false + vfs = procfs + +/opt: + dev = /dev/hd10opt + vfs = jfs2 + log = /dev/hd8 + mount = true + check = true + vol = /opt + free = false + quota = no + +/var/adm/ras/livedump: + dev = /dev/livedump + vfs = jfs2 + log = /dev/hd8 + mount = true + account = false + quota = no + + +/stage/middleware: + dev = "/stage/middleware" + vfs = nfs + nodename = 192.168.1.11 + mount = true + type = nfs + options = ro,bg,hard,intr,sec=sys + account = false + +/home/u0010689: + dev = "/userdata/20010689" + vfs = nfs + nodename = 192.168.1.11 + mount = true + type = nfs + options = bg,hard,intr + account = false + diff --git a/spec/fixtures/unit/provider/mount/parsed/aix.mount b/spec/fixtures/unit/provider/mount/parsed/aix.mount new file mode 100644 index 000000000..380dbc5ae --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/aix.mount @@ -0,0 +1,7 @@ +node mounted mounted over vfs date options +---- ------- ------------ --- ------------ ------------------- + /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 + /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 +sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 diff --git a/spec/fixtures/unit/provider/mount/parsed/darwin.mount b/spec/fixtures/unit/provider/mount/parsed/darwin.mount new file mode 100644 index 000000000..1bdfcf89a --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/darwin.mount @@ -0,0 +1,6 @@ +/dev/disk0s2 on / (hfs, local, journaled) +devfs on /dev (devfs, local, nobrowse) +map -hosts on /net (autofs, nosuid, automounted, nobrowse) +map auto_home on /home (autofs, automounted, nobrowse) +/dev/disk0s3 on /usr (hfs, local, journaled) +/dev/fake on /ghost (hfs, local, journaled) diff --git a/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab b/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab new file mode 100644 index 000000000..41b749bff --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab @@ -0,0 +1,8 @@ +# Device Mountpoint FStype Options Dump Pass# +/dev/ad0s1b none swap sw 0 0 +/dev/ad0s1a / ufs rw 1 1 +/dev/ad0s1e /tmp ufs rw 2 2 +/dev/ad0s1f /usr ufs rw 2 2 +/dev/ad0s1d /var ufs rw 2 2 +/dev/ad0s1g /boot ufs rw 2 2 +/dev/acd0 /cdrom cd9660 ro,noauto 0 0 diff --git a/spec/fixtures/unit/provider/mount/parsed/freebsd.mount b/spec/fixtures/unit/provider/mount/parsed/freebsd.mount new file mode 100644 index 000000000..89c518c5d --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/freebsd.mount @@ -0,0 +1,3 @@ +/dev/ad0s1a on / (ufs, local, soft-updates) +/dev/ad0s1d on /ghost (ufs, local, soft-updates) +devfs on /dev (devfs, local, multilabel) diff --git a/spec/fixtures/unit/provider/mount/parsed/hpux.mount b/spec/fixtures/unit/provider/mount/parsed/hpux.mount new file mode 100644 index 000000000..d414fa47a --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/hpux.mount @@ -0,0 +1,17 @@ +/ on rpool/ROOT/opensolaris read/write/setuid/devices/dev=2d90002 on Wed Dec 31 16:00:00 1969 +/devices on /devices read/write/setuid/devices/dev=4a00000 on Thu Feb 17 14:34:02 2011 +/dev on /dev read/write/setuid/devices/dev=4a40000 on Thu Feb 17 14:34:02 2011 +/system/contract on ctfs read/write/setuid/devices/dev=4ac0001 on Thu Feb 17 14:34:02 2011 +/proc on proc read/write/setuid/devices/dev=4b00000 on Thu Feb 17 14:34:02 2011 +/etc/mnttab on mnttab read/write/setuid/devices/dev=4b40001 on Thu Feb 17 14:34:02 2011 +/etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4b80001 on Thu Feb 17 14:34:02 2011 +/system/object on objfs read/write/setuid/devices/dev=4bc0001 on Thu Feb 17 14:34:02 2011 +/etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=4c00001 on Thu Feb 17 14:34:02 2011 +/lib/libc.so.1 on /usr/lib/libc/libc_hwcap1.so.1 read/write/setuid/devices/dev=2d90002 on Thu Feb 17 14:34:14 2011 +/dev/fd on fd read/write/setuid/devices/dev=4d00001 on Thu Feb 17 14:34:18 2011 +/tmp on swap read/write/setuid/devices/xattr/dev=4b80002 on Thu Feb 17 14:34:19 2011 +/var/run on swap read/write/setuid/devices/xattr/dev=4b80003 on Thu Feb 17 14:34:19 2011 +/export on rpool/export read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90006 on Thu Feb 17 14:37:48 2011 +/export/home on rpool/export/home read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90007 on Thu Feb 17 14:37:48 2011 +/rpool on rpool read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011 +/ghost on /dev/fake read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011 diff --git a/spec/fixtures/unit/provider/mount/parsed/linux.fstab b/spec/fixtures/unit/provider/mount/parsed/linux.fstab new file mode 100644 index 000000000..b1debff9c --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/linux.fstab @@ -0,0 +1,11 @@ +# A sample fstab, typical for a Fedora system +/dev/vg00/lv00 / ext3 defaults 1 1 +LABEL=/boot /boot ext3 defaults 1 2 +devpts /dev/pts devpts gid=5,mode=620 0 +tmpfs /dev/shm tmpfs defaults 0 +LABEL=/home /home ext3 defaults 1 2 +/home /homes auto bind 0 2 +proc /proc proc defaults 0 0 +/dev/vg00/lv01 /spare ext3 defaults 1 2 +sysfs /sys sysfs defaults 0 0 +LABEL=SWAP-hda6 swap swap defaults 0 0 diff --git a/spec/fixtures/unit/provider/mount/parsed/linux.mount b/spec/fixtures/unit/provider/mount/parsed/linux.mount new file mode 100644 index 000000000..75dd71fd4 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/linux.mount @@ -0,0 +1,5 @@ +/dev/root on / type jfs (rw,noatime) +rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) +sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) +/dev/sda9 on /usr/portage type jfs (rw) +/dev/fake on /ghost type jfs (rw) diff --git a/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab b/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab new file mode 100644 index 000000000..ca3ca8450 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab @@ -0,0 +1,9 @@ +# Device Mountpoint FStype Options Dump Pass# +/dev/ad0s1b none swap sw 0 0 +/dev/ad0s1a / ufs rw 1 1 +/dev/ad0s1e /tmp ufs rw 2 2 +/dev/ad0s1f /usr ufs rw 2 2 +/dev/ad0s1d /var ufs rw 2 2 +/dev/ad3s1b none swap sw 0 0 +/dev/ad3s1e /data ufs rw 2 2 +/dev/ad3s1g /boot ufs rw 2 2 diff --git a/spec/fixtures/unit/provider/mount/parsed/netbsd.mount b/spec/fixtures/unit/provider/mount/parsed/netbsd.mount new file mode 100644 index 000000000..dfdc26a34 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/netbsd.mount @@ -0,0 +1,8 @@ +/dev/ad0s1a on / (ufs, local) +devfs on /dev (devfs, local) +/dev/ad0s1e on /tmp (ufs, local, soft-updates) +/dev/ad0s1f on /usr (ufs, local, soft-updates) +/dev/ad0s1d on /var (ufs, local, soft-updates) +/dev/ad3s1e on /data (ufs, local, soft-updates) +/dev/ad3s1h on /ghost (ufs, local, soft-updates) +devfs on /var/named/dev (devfs, local) diff --git a/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab b/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab new file mode 100644 index 000000000..44c83eed1 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab @@ -0,0 +1,4 @@ +/dev/wd0a / ffs rw 1 1 +/dev/wd0e /home ffs rw,nodev,nosuid 1 2 +/dev/wd0d /usr ffs rw,nodev 1 2 +/dev/wd0f /boot ffs rw,nodev 1 2 diff --git a/spec/fixtures/unit/provider/mount/parsed/openbsd.mount b/spec/fixtures/unit/provider/mount/parsed/openbsd.mount new file mode 100644 index 000000000..367475783 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/openbsd.mount @@ -0,0 +1,4 @@ +/dev/wd0a on / type ffs (local) +/dev/wd0e on /home type ffs (local, nodev, nosuid) +/dev/wd0d on /usr type ffs (local, nodev) +/dev/wd0g on /ghost type ffs (local, nodev) diff --git a/spec/fixtures/unit/provider/mount/parsed/solaris.fstab b/spec/fixtures/unit/provider/mount/parsed/solaris.fstab new file mode 100644 index 000000000..54afc898c --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/solaris.fstab @@ -0,0 +1,11 @@ +#device device mount FS fsck mount mount +#to mount to fsck point type pass at boot options +# +fd - /dev/fd fd - no - +/proc - /proc proc - no - +/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 / ufs 1 no - +/dev/dsk/c0d0p0:boot - /boot pcfs - no - +/devices - /devices devfs - no - +ctfs - /system/contract ctfs - no - +objfs - /system/object objfs - no - +#swap - /tmp tmpfs - yes - diff --git a/spec/fixtures/unit/provider/mount/parsed/solaris.mount b/spec/fixtures/unit/provider/mount/parsed/solaris.mount new file mode 100644 index 000000000..26fabc575 --- /dev/null +++ b/spec/fixtures/unit/provider/mount/parsed/solaris.mount @@ -0,0 +1,6 @@ +/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200000 on Mon Mar 18 08:48:45 2002 +/proc on /proc read/write/setuid/dev=4300000 on Mon Mar 18 08:48:44 2002 +/etc/mnttab on mnttab read/write/setuid/dev=43c0000 on Mon Mar 18 08:48:44 2002 +/tmp on swap read/write/setuid/xattr/dev=2 on Mon Mar 18 08:48:52 2002 +/export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 +/ghost on /dev/dsk/c0t1d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 diff --git a/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys new file mode 100644 index 000000000..b22329dca --- /dev/null +++ b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys @@ -0,0 +1,7 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= francois.deppierraz@nimag.net +ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz <francois@ctrlaltdel.ch> +from="192.168.1.1",command="/bin/false",no-pty,no-port-forwarding ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz +from="192.168.1.1, www.reductivelabs.com",command="/bin/false",no-pty,no-port-forwarding ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Vi+TdC3iOGYcIo5vGTvC9P9rjHl9RxCuZmSfn+YDFQ35RXf0waijtjp9I7GYh6R4hBjA5z0u/Pzi95LET5NfRM0Gdc0DJyvBI7K+ALBxIT383Iz6Yz4iKxe1TEJgHGM2he4+7BHkjc3kdIZqIpZjucCk4VsXSxujO4MKKvtaKK2l+kahlLQHHw/vZkDpIgL52iGVsjW9l8RLJaKHZ4mDHJN/Q/Rzn2W4EvcdHUzwhvGMwZlm8clDwITBrSsawYtnivJrQSYcmTRqJuS8wprNDrLIhTGjrwFg5WpruUuMt6fLuCqwe6TeEL+nh3DQ4g554c5aRp3oU6LGBKTvNZGWQ== francois@korn +ssh-dss AAAAB3NzaC1kc3MAAACBAMPpCYnjywOemd8LqbbmC+bePNR3/H1rXsiFwjSLhYE3bbOpvclvOzN1DruFc34m0FopVnMkP+aubjdIYF8pijl+5hg9ggB7Kno2dl0Dd1rGN/swvmhA8OpLAQv7Qt7UnXKVho3as08zYZsrHxYFu0wlnkdbsv4cy4aXyQKd4MPVAAAAFQDSyQFWg8Qt3wU05buhZ10psoR7tQAAAIEAmAhguXwUnI3P2FF5NAW/mpJUmUERdL4pyZARUyAgpf7ezwrh9TJqrvGTQNBF97Xqaivyncm5JWQdMIsTBxEFaXZGkmBta02KnWcn447qvIh7iv8XpNL6M9flCkBEZOJ4t9El0ytTSHHaiCz8A20Et+E8evWyi1kXkFDt8ML2dGgAAACBAK0X4ympbdEjgV/ZyOc+BU22u7vOnfSOUJmyar4Ax1MIDNnoyNWKnGvxRutydQcQOKQHZEU0fE8MhPFn6nLF6CoVfEl/oz0EYz3hjV4WPFpHrF5DY/rhvNj8iuneKJ5P0dy/rG6m5qey25PnHyGFVoIRlkHJvBCJT40dHs40YEjI francois@korn +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAut8aOSxenjOqF527dlsdHWV4MNoAsX14l9M297+SQXaQ5Z3BedIxZaoQthkDALlV/25A1COELrg9J2MqJNQc8Xe9XQOIkBQWWinUlD/BXwoOTWEy8C8zSZPHZ3getMMNhGTBO+q/O+qiJx3y5cA4MTbw2zSxukfWC87qWwcZ64UUlegIM056vPsdZWFclS9hsROVEa57YUMrehQ1EGxT4Z5j6zIopufGFiAPjZigq/vqgcAqhAKP6yu4/gwO6S9tatBeEjZ8fafvj1pmvvIplZeMr96gHE7xS3pEEQqnB3nd4RY7AF6j9kFixnsytAUO7STPh/M3pLiVQBN89TvWPQ== diff --git a/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1 b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1 new file mode 100644 index 000000000..7aa0647ca --- /dev/null +++ b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1 @@ -0,0 +1,3 @@ +1024 35 167576894966720957580065952882142495543043407324667405194097438434880798807651864847570827148390962746149410384891026772700627764845955493549511618975091512997118590589399665757714186775228807376424903966072778732134483862302766419277581465932186641863495699668069439475320990051723279127881281145164415361627 francois@korn +2048 35 27332429396020032283276339339051507284036000350350092862949624519871013308460312287866673933080560923221560798334008554200019645416448528663000202951887890525621015333936122655294782671001073795264378070156670395703161543893088138531854776737799752600933431638059304355933305878665812555436198516842364330938321746086651639330436648850787370397302524667456837036413634152938122227368132322078811602953517461933179827432019932348409533535942749570969101453655028606209719023224268890314608444789012688070463327764203306501923404494017305972543000091038543051645924928018568725584728655193415567703220002707737714942757 francois@korn +from="192.168.1.1",command="/bin/false",no-pty,no-port-forwarding 2048 35 27332429396020032283276339339051507284036000350350092862949624519871013308460312287866673933080560923221560798334008554200019645416448528663000202951887890525621015333936122655294782671001073795264378070156670395703161543893088138531854776737799752600933431638059304355933305878665812555436198516842364330938321746086651639330436648850787370397302524667456837036413634152938122227368132322078811602953517461933179827432019932348409533535942749570969101453655028606209719023224268890314608444789012688070463327764203306501923404494017305972543000091038543051645924928018568725584728655193415567703220002707737714942757 francois@korn diff --git a/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2 b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2 new file mode 100644 index 000000000..9bf830112 --- /dev/null +++ b/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2 @@ -0,0 +1 @@ +false ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz diff --git a/spec/fixtures/unit/reports/tagmail/tagmail_failers.conf b/spec/fixtures/unit/reports/tagmail/tagmail_failers.conf new file mode 100644 index 000000000..d116b5fc7 --- /dev/null +++ b/spec/fixtures/unit/reports/tagmail/tagmail_failers.conf @@ -0,0 +1,3 @@ +tag: +: abuse@domain.com +invalid!tag: abuse@domain.com diff --git a/spec/fixtures/unit/reports/tagmail/tagmail_passers.conf b/spec/fixtures/unit/reports/tagmail/tagmail_passers.conf new file mode 100644 index 000000000..ae6d2e7f2 --- /dev/null +++ b/spec/fixtures/unit/reports/tagmail/tagmail_passers.conf @@ -0,0 +1,30 @@ +# A comment +# or maybe two +# plus some blank lines + # with some blanks plus a comment + +# a simple tag report +one: abuse@domain.com + +# with weird spacing + one : abuse@domain.com + +# with multiple tags +one, two: abuse@domain.com + +# again with the weird syntax + one , two : abuse@domain.com + +# Some negations +one, !two: abuse@domain.com + +# some oddly-formatted tags +one, two-three, !four-five, !six: abuse@domain.com + +# multiple addresses +one, two: abuse@domain.com, testing@domain.com + +# and with weird spacing +one, two: abuse@domain.com , testing@domain.com + +# and a trailing comment diff --git a/spec/fixtures/unit/util/rdoc/basic.pp b/spec/fixtures/unit/util/rdoc/basic.pp new file mode 100644 index 000000000..5616503c1 --- /dev/null +++ b/spec/fixtures/unit/util/rdoc/basic.pp @@ -0,0 +1,16 @@ +# im a class +class foo { + file { '/tmp/foo' : + ensure => present, + } +} + +# im a node +node gar { +} + +# im a define +define baz { } + +# im a resource +host { 'cow' : } diff --git a/spec/integration/configurer_spec.rb b/spec/integration/configurer_spec.rb index 825b6322e..05b3d6146 100755 --- a/spec/integration/configurer_spec.rb +++ b/spec/integration/configurer_spec.rb @@ -50,7 +50,12 @@ describe Puppet::Configurer do Puppet[:lastrunfile] = tmpfile("lastrunfile") Puppet[:report] = true + # We only record integer seconds in the timestamp, and truncate + # backwards, so don't use a more accurate timestamp in the test. + # --daniel 2011-03-07 + t1 = Time.now.tv_sec @configurer.run :catalog => @catalog, :report => report + t2 = Time.now.tv_sec summary = nil File.open(Puppet[:lastrunfile], "r") do |fd| @@ -62,7 +67,7 @@ describe Puppet::Configurer do summary.should be_key(key) end summary["time"].should be_key("notify") - summary["time"]["last_run"].should >= Time.now.tv_sec + summary["time"]["last_run"].should be_between(t1, t2) end end end diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb index ec084b441..b7dfcc3e0 100755 --- a/spec/integration/parser/parser_spec.rb +++ b/spec/integration/parser/parser_spec.rb @@ -111,5 +111,12 @@ describe Puppet::Parser::Parser do it "should correctly set the arrow type of a relationship" do "Notify[foo] <~ Notify[bar]".should parse_with { |rel| rel.arrow == "<~" } end + + it "should be able to parse deep hash access" do + %q{ + $hash = { 'a' => { 'b' => { 'c' => 'it works' } } } + $out = $hash['a']['b']['c'] + }.should parse_with { |v| v.value.is_a?(Puppet::Parser::AST::ASTHash) } + end end end diff --git a/spec/integration/provider/mailalias/aliases_spec.rb b/spec/integration/provider/mailalias/aliases_spec.rb index bce9374c1..19e430ba1 100755 --- a/spec/integration/provider/mailalias/aliases_spec.rb +++ b/spec/integration/provider/mailalias/aliases_spec.rb @@ -1,24 +1,10 @@ #!/usr/bin/env ruby - require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') - -require 'puppettest/support/utils' -require 'puppettest/fileparsing' +require 'shared_behaviours/all_parsedfile_providers' provider_class = Puppet::Type.type(:mailalias).provider(:aliases) describe provider_class do - include PuppetTest::FileParsing - include PuppetTest::Support::Utils - - before :each do - @provider = provider_class - end - - # #1560 - it "should be able to parse the mailalias examples" do - fakedata("data/providers/mailalias/aliases").each { |file| - fakedataparse(file) - } - end + # #1560, in which we corrupt the format of complex mail aliases. + it_should_behave_like "all parsedfile providers", provider_class end diff --git a/spec/integration/provider/mount_spec.rb b/spec/integration/provider/mount_spec.rb new file mode 100644 index 000000000..d6f25fe1d --- /dev/null +++ b/spec/integration/provider/mount_spec.rb @@ -0,0 +1,151 @@ +require File.dirname(__FILE__) + '/../../spec_helper' + +require 'puppet/file_bucket/dipper' + +describe "mount provider (integration)" do + include PuppetSpec::Files + + def create_fake_fstab(initially_contains_entry) + File.open(@fake_fstab, 'w') do |f| + if initially_contains_entry + f.puts("/dev/disk1s1\t/Volumes/foo_disk\tmsdos\tlocal\t0\t0") + end + end + end + + before :each do + @fake_fstab = tmpfile('fstab') + @current_options = "local" + @current_device = "/dev/disk1s1" + Puppet::Type.type(:mount).defaultprovider.stubs(:default_target).returns(@fake_fstab) + Facter.stubs(:value).with(:operatingsystem).returns('Darwin') + Puppet::Util::ExecutionStub.set do |command, options| + case command[0] + when %r{/s?bin/mount} + if command.length == 1 + if @mounted + "#{@current_device} on /Volumes/foo_disk (msdos, #{@current_options})\n" + else + '' + end + else + command.length.should == 4 + command[1].should == '-o' + command[3].should == '/Volumes/foo_disk' + @mounted.should == false # verify that we don't try to call "mount" redundantly + @current_options = command[2] + @current_device = check_fstab(true) + @mounted = true + '' + end + when %r{/s?bin/umount} + command.length.should == 2 + command[1].should == '/Volumes/foo_disk' + @mounted.should == true # "umount" doesn't work when device not mounted (see #6632) + @mounted = false + '' + else + fail "Unexpected command #{command.inspect} executed" + end + end + end + + after :each do + Puppet::Type::Mount::ProviderParsed.clear # Work around bug #6628 + end + + def check_fstab(expected_to_be_present) + # Verify that the fake fstab has the expected data in it + fstab_contents = File.read(@fake_fstab).lines.map(&:chomp).reject { |x| x =~ /^#|^$/ } + if expected_to_be_present + fstab_contents.length().should == 1 + device, rest_of_line = fstab_contents[0].split(/\t/,2) + rest_of_line.should == "/Volumes/foo_disk\tmsdos\t#{@desired_options}\t0\t0" + device + else + fstab_contents.length().should == 0 + nil + end + end + + def run_in_catalog(settings) + resource = Puppet::Type.type(:mount).new(settings.merge(:name => "/Volumes/foo_disk", + :device => "/dev/disk1s1", :fstype => "msdos")) + Puppet::FileBucket::Dipper.any_instance.stubs(:backup) # Don't backup to the filebucket + resource.expects(:err).never + catalog = Puppet::Resource::Catalog.new + catalog.host_config = false # Stop Puppet from doing a bunch of magic + catalog.add_resource resource + catalog.apply + end + + [false, true].each do |initial_state| + describe "When initially #{initial_state ? 'mounted' : 'unmounted'}" do + before :each do + @mounted = initial_state + end + + [false, true].each do |initial_fstab_entry| + describe "When there is #{initial_fstab_entry ? 'an' : 'no'} initial fstab entry" do + before :each do + create_fake_fstab(initial_fstab_entry) + end + + [:defined, :present, :mounted, :unmounted, :absent].each do |ensure_setting| + expected_final_state = case ensure_setting + when :mounted + true + when :unmounted, :absent + false + when :defined, :present + initial_state + else + fail "Unknown ensure_setting #{ensure_setting}" + end + expected_fstab_data = (ensure_setting != :absent) + describe "When setting ensure => #{ensure_setting}" do + ["local", "journaled"].each do |options_setting| + describe "When setting options => #{options_setting}" do + it "should leave the system in the #{expected_final_state ? 'mounted' : 'unmounted'} state, #{expected_fstab_data ? 'with' : 'without'} data in /etc/fstab" do + @desired_options = options_setting + run_in_catalog(:ensure=>ensure_setting, :options => options_setting) + @mounted.should == expected_final_state + if expected_fstab_data + check_fstab(expected_fstab_data).should == "/dev/disk1s1" + else + check_fstab(expected_fstab_data).should == nil + end + if @mounted + if ![:defined, :present].include?(ensure_setting) + @current_options.should == @desired_options + elsif initial_fstab_entry + @current_options.should == @desired_options + else + @current_options.should == 'local' #Workaround for #6645 + end + end + end + end + end + end + end + end + end + end + end + + describe "When the wrong device is mounted" do + it "should remount the correct device" do + pending "Due to bug 6309" + @mounted = true + @current_device = "/dev/disk2s2" + create_fake_fstab(true) + @desired_options = "local" + run_in_catalog(:ensure=>:mounted, :options=>'local') + @current_device.should=="/dev/disk1s1" + @mounted.should==true + @current_options.should=='local' + check_fstab(true).should == "/dev/disk1s1" + end + end +end diff --git a/spec/integration/type/file_spec.rb b/spec/integration/type/file_spec.rb index c2702ee7a..46900a0f1 100755 --- a/spec/integration/type/file_spec.rb +++ b/spec/integration/type/file_spec.rb @@ -173,7 +173,12 @@ describe Puppet::Type.type(:file) do it "should be able to recurse over a nonexistent file" do @path = tmpfile("file_integration_tests") - @file = Puppet::Type::File.new(:name => @path, :mode => 0644, :recurse => true, :backup => false) + @file = Puppet::Type::File.new( + :name => @path, + :mode => 0644, + :recurse => true, + :backup => false + ) @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file @@ -186,7 +191,12 @@ describe Puppet::Type.type(:file) do build_path(@path) - @file = Puppet::Type::File.new(:name => @path, :mode => 0644, :recurse => true, :backup => false) + @file = Puppet::Type::File.new( + :name => @path, + :mode => 0644, + :recurse => true, + :backup => false + ) @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @file @@ -393,10 +403,8 @@ describe Puppet::Type.type(:file) do dest = tmpfile("files_with_content") - file = Puppet::Type.type(:file).new( - - :name => dest, - + file = Puppet::Type.type(:file).new( + :name => dest, :content => "this is some content, yo" ) @@ -411,11 +419,9 @@ describe Puppet::Type.type(:file) do dest = tmpfile("files_with_content") - file = Puppet::Type.type(:file).new( - - :name => dest, - :ensure => "file", - + file = Puppet::Type.type(:file).new( + :name => dest, + :ensure => "file", :content => "this is some content, yo" ) @@ -433,12 +439,10 @@ describe Puppet::Type.type(:file) do File.open(dest, "w") { |f| f.puts "boo" } - file = Puppet::Type.type(:file).new( - - :name => dest, + file = Puppet::Type.type(:file).new( + :name => dest, :ensure => :absent, :source => source, - :backup => false ) @@ -465,24 +469,23 @@ describe Puppet::Type.type(:file) do File.open(@purgee, "w") { |f| f.puts "footest" } - @lfobj = Puppet::Type.newfile( - - :title => "localfile", - :path => @localfile, + @lfobj = Puppet::Type.newfile( + :title => "localfile", + :path => @localfile, :content => "rahtest\n", - :ensure => :file, - - :backup => false + :ensure => :file, + :backup => false ) - @destobj = Puppet::Type.newfile( - :title => "destdir", :path => @destdir, - :source => @sourcedir, - :backup => false, - :purge => true, - - :recurse => true) + @destobj = Puppet::Type.newfile( + :title => "destdir", + :path => @destdir, + :source => @sourcedir, + :backup => false, + :purge => true, + :recurse => true + ) @catalog = Puppet::Resource::Catalog.new @catalog.add_resource @lfobj, @destobj diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb index 52ed903ec..38c51a572 100644 --- a/spec/lib/puppet_spec/files.rb +++ b/spec/lib/puppet_spec/files.rb @@ -3,6 +3,29 @@ require 'tempfile' # A support module for testing files. module PuppetSpec::Files + def self.cleanup + if defined?($tmpfiles) + $tmpfiles.each do |file| + file = File.expand_path(file) + if Puppet.features.posix? and file !~ /^\/tmp/ and file !~ /^\/var\/folders/ + puts "Not deleting tmpfile #{file} outside of /tmp or /var/folders" + next + elsif Puppet.features.microsoft_windows? + tempdir = File.expand_path(File.join(Dir::LOCAL_APPDATA, "Temp")) + if file !~ /^#{tempdir}/ + puts "Not deleting tmpfile #{file} outside of #{tempdir}" + next + end + end + if FileTest.exist?(file) + system("chmod -R 755 '#{file}'") + system("rm -rf '#{file}'") + end + end + $tmpfiles.clear + end + end + def tmpfile(name) source = Tempfile.new(name) path = source.path diff --git a/spec/lib/puppet_spec/fixtures.rb b/spec/lib/puppet_spec/fixtures.rb new file mode 100644 index 000000000..7f6bc2a8f --- /dev/null +++ b/spec/lib/puppet_spec/fixtures.rb @@ -0,0 +1,28 @@ +module PuppetSpec::Fixtures + def fixtures(*rest) + File.join(PuppetSpec::FIXTURE_DIR, *rest) + end + def my_fixture_dir + callers = caller + while line = callers.shift do + next unless found = line.match(%r{/spec/(.*)_spec\.rb:}) + return fixtures(found[1]) + end + fail "sorry, I couldn't work out your path from the caller stack!" + end + def my_fixture(name) + file = File.join(my_fixture_dir, name) + unless File.readable? file then + fail Puppet::DevError, "fixture '#{name}' for #{my_fixture_dir} is not readable" + end + return file + end + def my_fixtures(glob = '*', flags = 0) + files = Dir.glob(File.join(my_fixture_dir, glob), flags) + unless files.length > 0 then + fail Puppet::DevError, "fixture '#{glob}' for #{my_fixture_dir} had no files!" + end + block_given? and files.each do |file| yield file end + files + end +end diff --git a/spec/shared_behaviours/all_parsedfile_providers.rb b/spec/shared_behaviours/all_parsedfile_providers.rb new file mode 100644 index 000000000..9cb199b5f --- /dev/null +++ b/spec/shared_behaviours/all_parsedfile_providers.rb @@ -0,0 +1,21 @@ +shared_examples_for "all parsedfile providers" do |provider, *files| + if files.empty? then + files = my_fixtures + end + + files.flatten.each do |file| + it "should rewrite #{file} reasonably unchanged" do + provider.stubs(:default_target).returns(file) + provider.prefetch + + text = provider.to_file(provider.target_records(file)) + text.gsub!(/^# HEADER.+\n/, '') + + oldlines = File.readlines(file) + newlines = text.chomp.split "\n" + oldlines.zip(newlines).each do |old, new| + new.gsub(/\s+/, '').should == old.chomp.gsub(/\s+/, '') + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 84ef3f279..d7f546b0b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,6 @@ dir = File.expand_path(File.dirname(__FILE__)) $LOAD_PATH.unshift("#{dir}/") $LOAD_PATH.unshift("#{dir}/lib") # a spec-specific test lib dir $LOAD_PATH.unshift("#{dir}/../lib") -$LOAD_PATH.unshift("#{dir}/../test/lib") # Don't want puppet getting the command line arguments for rake or autotest ARGV.clear @@ -20,50 +19,21 @@ module PuppetSpec FIXTURE_DIR = File.join(dir = File.expand_path(File.dirname(__FILE__)), "fixtures") unless defined?(FIXTURE_DIR) end -module PuppetTest -end - require 'lib/puppet_spec/files' +require 'lib/puppet_spec/fixtures' require 'monkey_patches/alias_should_to_must' require 'monkey_patches/publicize_methods' RSpec.configure do |config| - config.mock_with :mocha - - config.after :each do - Puppet.settings.clear - Puppet::Node::Environment.clear - Puppet::Util::Storage.clear - - if defined?($tmpfiles) - $tmpfiles.each do |file| - file = File.expand_path(file) - if Puppet.features.posix? and file !~ /^\/tmp/ and file !~ /^\/var\/folders/ - puts "Not deleting tmpfile #{file} outside of /tmp or /var/folders" - next - elsif Puppet.features.microsoft_windows? - tempdir = File.expand_path(File.join(Dir::LOCAL_APPDATA, "Temp")) - if file !~ /^#{tempdir}/ - puts "Not deleting tmpfile #{file} outside of #{tempdir}" - next - end - end - if FileTest.exist?(file) - system("chmod -R 755 '#{file}'") - system("rm -rf '#{file}'") - end - end - $tmpfiles.clear - end + include PuppetSpec::Fixtures - @logs.clear - Puppet::Util::Log.close_all - end + config.mock_with :mocha config.before :each do # these globals are set by Application $puppet_application_mode = nil $puppet_application_name = nil + Signal.stubs(:trap) # Set the confdir and vardir to gibberish so that tests # have to be correctly mocked. @@ -76,6 +46,18 @@ RSpec.configure do |config| @logs = [] Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs)) end + + config.after :each do + Puppet.settings.clear + Puppet::Node::Environment.clear + Puppet::Util::Storage.clear + Puppet::Util::ExecutionStub.reset + + PuppetSpec::Files.cleanup + + @logs.clear + Puppet::Util::Log.close_all + end end end diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb index cee6a0d1a..cc745d1fc 100755 --- a/spec/unit/application/agent_spec.rb +++ b/spec/unit/application/agent_spec.rb @@ -51,12 +51,8 @@ describe Puppet::Application::Agent do end describe "in preinit" do - before :each do - @puppetd.stubs(:trap) - end - it "should catch INT" do - @puppetd.expects(:trap).with { |arg,block| arg == :INT } + Signal.expects(:trap).with { |arg,block| arg == :INT } @puppetd.preinit end @@ -537,11 +533,11 @@ describe Puppet::Application::Agent do @puppetd.onetime end - it "should always exit with 0 if --noop" do + it "should exit with the report's computer exit status, even if --noop is set." do Puppet[:noop] = true report = stub 'report', :exit_status => 666 @agent.stubs(:run).returns(report) - @puppetd.expects(:exit).with(0) + @puppetd.expects(:exit).with(666) @puppetd.onetime end diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index 8aaa5d8f9..0c6df2cf8 100755 --- a/spec/unit/application/apply_spec.rb +++ b/spec/unit/application/apply_spec.rb @@ -52,7 +52,6 @@ describe Puppet::Application::Apply do before :each do Puppet::Log.stubs(:newdestination) - Puppet.stubs(:trap) Puppet::Log.stubs(:level=) Puppet.stubs(:parse_config) Puppet::FileBucket::Dipper.stubs(:new) @@ -79,7 +78,7 @@ describe Puppet::Application::Apply do end it "should set INT trap" do - @apply.expects(:trap).with(:INT) + Signal.expects(:trap).with(:INT) @apply.setup end @@ -172,6 +171,13 @@ describe Puppet::Application::Apply do @apply.expects(:exit).with(1) @apply.parseonly end + + it "should exit with exit code 1 if error, even if --noop is set" do + Puppet[:noop] = true + @environment.stubs(:perform_initial_import).raises(Puppet::ParseError) + @apply.expects(:exit).with(1) + @apply.parseonly + end end describe "the main command" do @@ -342,6 +348,15 @@ describe Puppet::Application::Apply do @apply.main end + it "should exit with report's computed exit status, even if --noop is set" do + Puppet.stubs(:[]).with(:noop).returns(true) + @apply.options.stubs(:[]).with(:detailed_exitcodes).returns(true) + Puppet::Transaction::Report.any_instance.stubs(:exit_status).returns(666) + @apply.expects(:exit).with(666) + + @apply.main + end + it "should always exit with 0 if option is disabled" do Puppet.stubs(:[]).with(:noop).returns(false) @apply.options.stubs(:[]).with(:detailed_exitcodes).returns(false) diff --git a/spec/unit/application/cert_spec.rb b/spec/unit/application/cert_spec.rb index c7f463ea2..4315bb8d8 100755 --- a/spec/unit/application/cert_spec.rb +++ b/spec/unit/application/cert_spec.rb @@ -51,7 +51,7 @@ describe Puppet::Application::Cert do it "should set cert_mode to :destroy for --clean" do @cert_app.handle_clean(0) - @cert_app.cert_mode.should == :destroy + @cert_app.subcommand.should == :destroy end it "should set all to true for --all" do @@ -68,7 +68,7 @@ describe Puppet::Application::Cert do it "should set cert_mode to #{method} with option --#{method}" do @cert_app.send("handle_#{method}".to_sym, nil) - @cert_app.cert_mode.should == method + @cert_app.subcommand.should == method end end @@ -114,19 +114,19 @@ describe Puppet::Application::Cert do end it "should set the ca_location to :local if the cert_mode is generate" do - @cert_app.find_mode('--generate') + @cert_app.subcommand = 'generate' Puppet::SSL::Host.expects(:ca_location=).with(:local) @cert_app.setup end it "should set the ca_location to :local if the cert_mode is destroy" do - @cert_app.find_mode('--destroy') + @cert_app.subcommand = 'destroy' Puppet::SSL::Host.expects(:ca_location=).with(:local) @cert_app.setup end it "should set the ca_location to :only if the cert_mode is print" do - @cert_app.find_mode('--print') + @cert_app.subcommand = 'print' Puppet::SSL::Host.expects(:ca_location=).with(:only) @cert_app.setup end @@ -171,24 +171,64 @@ describe Puppet::Application::Cert do @cert_app.main end - it "should delegate to ca.apply with current set cert_mode" do - @cert_app.cert_mode = "currentmode" + it "should revoke cert if cert_mode is clean" do + @cert_app.subcommand = :destroy @cert_app.command_line.stubs(:args).returns(["host"]) - @ca.expects(:apply).with { |cert_mode,to| cert_mode == "currentmode" } + @ca.expects(:apply).with { |cert_mode,to| cert_mode == :revoke } + @ca.expects(:apply).with { |cert_mode,to| cert_mode == :destroy } @cert_app.main end + end - it "should revoke cert if cert_mode is clean" do - @cert_app.cert_mode = :destroy - @cert_app.command_line.stubs(:args).returns(["host"]) + describe "when identifying subcommands" do + before :each do + @cert_app.all = false + @ca = stub_everything 'ca' + @cert_app.ca = @ca + end - @ca.expects(:apply).with { |cert_mode,to| cert_mode == :revoke } - @ca.expects(:apply).with { |cert_mode,to| cert_mode == :destroy } + it "should SystemExit after printing help message" do + # Make the help method silent for testing; this is a bit nasty, but we + # can't identify a cleaner method. Help welcome. --daniel 2011-02-22 + Puppet.features.stubs(:usage?).returns(false) + @cert_app.stubs(:puts) - @cert_app.main + @cert_app.command_line.stubs(:args).returns([]) + expect { @cert_app.parse_options }.should raise_error SystemExit end + %w{list revoke generate sign print verify fingerprint}.each do |cmd| + short = cmd[0,1] + [cmd, "--#{cmd}", "-#{short}"].each do |option| + # In our command line '-v' was eaten by 'verbose', so we can't consume + # it here; this is a special case from our otherwise standard + # processing. --daniel 2011-02-22 + next if option == "-v" + + it "should recognise '#{option}'" do + args = [option, "fun.example.com"] + + @cert_app.command_line.stubs(:args).returns(args) + @cert_app.parse_options + @cert_app.subcommand.should == cmd.to_sym + + args.should == ["fun.example.com"] + end + end + end + + %w{clean --clean -c}.each do |ugly| + it "should recognise the '#{ugly}' option as destroy" do + args = [ugly, "fun.example.com"] + + @cert_app.command_line.stubs(:args).returns(args) + @cert_app.parse_options + @cert_app.subcommand.should == :destroy + + args.should == ["fun.example.com"] + end + end end end diff --git a/spec/unit/application/filebucket_spec.rb b/spec/unit/application/filebucket_spec.rb index 8b811d7c5..013e358d8 100644 --- a/spec/unit/application/filebucket_spec.rb +++ b/spec/unit/application/filebucket_spec.rb @@ -56,7 +56,7 @@ describe Puppet::Application::Filebucket do end it "should trap INT" do - @filebucket.expects(:trap).with(:INT) + Signal.expects(:trap).with(:INT) @filebucket.setup end diff --git a/spec/unit/application/inspect_spec.rb b/spec/unit/application/inspect_spec.rb index 1d99c6ca9..d334a87ee 100644..100755 --- a/spec/unit/application/inspect_spec.rb +++ b/spec/unit/application/inspect_spec.rb @@ -174,7 +174,7 @@ describe Puppet::Application::Inspect do @inspect.run_command - @report.logs.count.should == 1 + @report.logs.first.should_not == nil @report.logs.first.message.should =~ /Could not back up/ end end diff --git a/spec/unit/application/queue_spec.rb b/spec/unit/application/queue_spec.rb index 2ff9001af..bb485ac3c 100755 --- a/spec/unit/application/queue_spec.rb +++ b/spec/unit/application/queue_spec.rb @@ -29,12 +29,8 @@ describe Puppet::Application::Queue do end describe "in preinit" do - before :each do - @queue.stubs(:trap) - end - it "should catch INT" do - @queue.expects(:trap).with { |arg,block| arg == :INT } + Signal.expects(:trap).with { |arg,block| arg == :INT } @queue.preinit end diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index 65f06169c..befc4f510 100755 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -46,6 +46,48 @@ describe Puppet::Application do end end + it "should sadly and frighteningly allow run_mode to change at runtime" do + class TestApp < Puppet::Application + run_mode :master + def run_command + # This is equivalent to calling these methods externally to the + # instance, but since this is what "real world" code is likely to do + # (and we need the class anyway) we may as well test that. --daniel 2011-02-03 + set_run_mode self.class.run_mode "agent" + end + end + + Puppet[:run_mode].should == "user" + + expect { + app = TestApp.new + + Puppet[:run_mode].should == "master" + + app.run + + app.class.run_mode.name.should == :agent + $puppet_application_mode.name.should == :agent + }.should_not raise_error + + Puppet[:run_mode].should == "agent" + end + + it "it should not allow run mode to be set multiple times" do + pending "great floods of tears, you can do this right now" # --daniel 2011-02-03 + app = Puppet::Application.new + expect { + app.set_run_mode app.class.run_mode "master" + $puppet_application_mode.name.should == :master + app.set_run_mode app.class.run_mode "agent" + $puppet_application_mode.name.should == :agent + }.should raise_error + end + + it "should explode when an invalid run mode is set at runtime, for great victory" + # ...but you can, and while it will explode, that only happens too late for + # us to easily test. --daniel 2011-02-03 + it "should have a run entry-point" do @app.should respond_to(:run) end @@ -241,11 +283,11 @@ describe Puppet::Application do @app.parse_options end - describe "when using --help", :if => Puppet.features.usage? do + describe "when using --help" do - it "should call RDoc::usage and exit" do + it "should call exit" do @app.expects(:exit) - RDoc.expects(:usage).returns(true) + @app.stubs(:puts) @app.handle_help(nil) end diff --git a/spec/unit/configurer/downloader_spec.rb b/spec/unit/configurer/downloader_spec.rb index b2485ccc8..266a96b03 100755 --- a/spec/unit/configurer/downloader_spec.rb +++ b/spec/unit/configurer/downloader_spec.rb @@ -5,6 +5,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'puppet/configurer/downloader' describe Puppet::Configurer::Downloader do + require 'puppet_spec/files' + include PuppetSpec::Files it "should require a name" do lambda { Puppet::Configurer::Downloader.new }.should raise_error(ArgumentError) end @@ -96,25 +98,35 @@ describe Puppet::Configurer::Downloader do describe "when creating the catalog to do the downloading" do before do - @dler = Puppet::Configurer::Downloader.new("foo", "path", "source") + @dler = Puppet::Configurer::Downloader.new("foo", "/download/path", "source") end it "should create a catalog and add the file to it" do - file = mock 'file' - catalog = mock 'catalog' - - @dler.expects(:file).returns file - - Puppet::Resource::Catalog.expects(:new).returns catalog - catalog.expects(:add_resource).with(file) + catalog = @dler.catalog + catalog.resources.size.should == 1 + catalog.resources.first.class.should == Puppet::Type::File + catalog.resources.first.name.should == "/download/path" + end - @dler.catalog.should equal(catalog) + it "should specify that it is not managing a host catalog" do + @dler.catalog.host_config.should == false end + end describe "when downloading" do before do - @dler = Puppet::Configurer::Downloader.new("foo", "path", "source") + @dl_name = tmpfile("downloadpath") + source_name = tmpfile("source") + File.open(source_name, 'w') {|f| f.write('hola mundo') } + @dler = Puppet::Configurer::Downloader.new("foo", @dl_name, source_name) + end + + it "should not skip downloaded resources when filtering on tags" do + Puppet[:tags] = 'maytag' + @dler.evaluate + + File.exists?(@dl_name).should be_true end it "should log that it is downloading" do diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb index 282a2bcbf..4de76b728 100755 --- a/spec/unit/daemon_spec.rb +++ b/spec/unit/daemon_spec.rb @@ -29,13 +29,9 @@ describe Puppet::Daemon do end describe "when setting signal traps" do - before do - @daemon.stubs(:trap) - end - {:INT => :stop, :TERM => :stop, :HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs}.each do |signal, method| it "should log and call #{method} when it receives #{signal}" do - @daemon.expects(:trap).with(signal).yields + Signal.expects(:trap).with(signal).yields Puppet.expects(:notice) diff --git a/spec/unit/file_bucket/dipper_spec.rb b/spec/unit/file_bucket/dipper_spec.rb index 189a3d870..4dabb722b 100755 --- a/spec/unit/file_bucket/dipper_spec.rb +++ b/spec/unit/file_bucket/dipper_spec.rb @@ -92,7 +92,7 @@ describe Puppet::FileBucket::Dipper do [request1, request2].each do |r| r.server.should == 'puppetmaster' r.port.should == 31337 - r.key.should == "md5/#{checksum}" + r.key.should == "md5/#{checksum}#{real_path}" end end diff --git a/spec/unit/file_bucket/file_spec.rb b/spec/unit/file_bucket/file_spec.rb index 6873264df..d79345736 100644 --- a/spec/unit/file_bucket/file_spec.rb +++ b/spec/unit/file_bucket/file_spec.rb @@ -56,30 +56,6 @@ describe Puppet::FileBucket::File do end end - describe "when saving files" do - it "should save the contents to the calculated path" do - ::File.stubs(:directory?).with(@dir).returns(true) - ::File.expects(:exist?).with("#{@dir}/contents").returns false - - mockfile = mock "file" - mockfile.expects(:print).with(@contents) - ::File.expects(:open).with("#{@dir}/contents", ::File::WRONLY|::File::CREAT, 0440).yields(mockfile) - - Puppet::FileBucket::File.indirection.save(Puppet::FileBucket::File.new(@contents)) - end - - it "should make any directories necessary for storage" do - FileUtils.expects(:mkdir_p).with do |arg| - ::File.umask == 0007 and arg == @dir - end - ::File.expects(:directory?).with(@dir).returns(false) - ::File.expects(:open).with("#{@dir}/contents", ::File::WRONLY|::File::CREAT, 0440) - ::File.expects(:exist?).with("#{@dir}/contents").returns false - - Puppet::FileBucket::File.indirection.save(Puppet::FileBucket::File.new(@contents)) - end - end - it "should return a url-ish name" do Puppet::FileBucket::File.new(@contents).name.should == "md5/4a8ec4fa5f01b4ab1a0ab8cbccb709f0" end @@ -97,17 +73,6 @@ describe Puppet::FileBucket::File do Puppet::FileBucket::File.from_pson({"contents"=>"file contents"}).contents.should == "file contents" end - it "should save a file" do - ::File.expects(:exist?).with("#{@dir}/contents").returns false - ::File.expects(:directory?).with(@dir).returns false - ::FileUtils.expects(:mkdir_p).with(@dir) - ::File.expects(:open).with("#{@dir}/contents", ::File::WRONLY|::File::CREAT, 0440) - - bucketfile = Puppet::FileBucket::File.new(@contents) - Puppet::FileBucket::File.indirection.save(bucketfile) - - end - def make_bucketed_file FileUtils.mkdir_p(@dir) File.open("#{@dir}/contents", 'w') { |f| f.write @contents } diff --git a/spec/unit/indirector/facts/inventory_active_record_spec.rb b/spec/unit/indirector/facts/inventory_active_record_spec.rb new file mode 100644 index 000000000..43b9fa397 --- /dev/null +++ b/spec/unit/indirector/facts/inventory_active_record_spec.rb @@ -0,0 +1,164 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../../spec_helper' +require 'sqlite3' rescue nil +require 'tempfile' +require 'puppet/rails' + +describe "Puppet::Node::Facts::InventoryActiveRecord", :if => (Puppet.features.rails? and defined? SQLite3) do + let(:terminus) { Puppet::Node::Facts::InventoryActiveRecord.new } + + before :all do + require 'puppet/indirector/facts/inventory_active_record' + @dbfile = Tempfile.new("testdb") + @dbfile.close + end + + after :all do + Puppet::Node::Facts.indirection.reset_terminus_class + @dbfile.unlink + end + + before :each do + Puppet::Node::Facts.indirection.terminus_class = :inventory_active_record + Puppet[:dbadapter] = 'sqlite3' + Puppet[:dblocation] = @dbfile.path + Puppet[:railslog] = "/dev/null" + Puppet::Rails.init + end + + after :each do + Puppet::Rails.teardown + end + + describe "#save" do + it "should use an existing node if possible" do + node = Puppet::Rails::InventoryNode.new(:name => "foo", :timestamp => Time.now) + node.save + facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin") + Puppet::Node::Facts.indirection.save(facts) + + Puppet::Rails::InventoryNode.count.should == 1 + Puppet::Rails::InventoryNode.first.should == node + end + + it "should create a new node if one can't be found" do + # This test isn't valid if there are nodes to begin with + Puppet::Rails::InventoryNode.count.should == 0 + + facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin") + Puppet::Node::Facts.indirection.save(facts) + + Puppet::Rails::InventoryNode.count.should == 1 + Puppet::Rails::InventoryNode.first.name.should == "foo" + end + + it "should save the facts" do + facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin") + Puppet::Node::Facts.indirection.save(facts) + + Puppet::Rails::InventoryFact.all.map{|f| [f.name,f.value]}.should =~ [["uptime_days","60"],["kernel","Darwin"]] + end + + it "should remove the previous facts for an existing node" do + facts = Puppet::Node::Facts.new("foo", "uptime_days" => "30", "kernel" => "Darwin") + Puppet::Node::Facts.indirection.save(facts) + bar_facts = Puppet::Node::Facts.new("bar", "uptime_days" => "35", "kernel" => "Linux") + foo_facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "is_virtual" => "false") + Puppet::Node::Facts.indirection.save(bar_facts) + Puppet::Node::Facts.indirection.save(foo_facts) + + Puppet::Node::Facts.indirection.find("bar").should == bar_facts + Puppet::Node::Facts.indirection.find("foo").should == foo_facts + Puppet::Rails::InventoryFact.all.map{|f| [f.name,f.value]}.should_not include(["uptime_days", "30"], ["kernel", "Darwin"]) + end + end + + describe "#find" do + before do + @foo_facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin") + @bar_facts = Puppet::Node::Facts.new("bar", "uptime_days" => "30", "kernel" => "Linux") + Puppet::Node::Facts.indirection.save(@foo_facts) + Puppet::Node::Facts.indirection.save(@bar_facts) + end + + it "should identify facts by node name" do + Puppet::Node::Facts.indirection.find("foo").should == @foo_facts + end + + it "should return nil if no node instance can be found" do + Puppet::Node::Facts.indirection.find("non-existent node").should == nil + end + end + + describe "#search" do + def search_request(conditions) + Puppet::Indirector::Request.new(:facts, :search, nil, conditions) + end + + before :each do + @now = Time.now + @foo = Puppet::Node::Facts.new("foo", "fact1" => "value1", "fact2" => "value2", "uptime_days" => "30") + @bar = Puppet::Node::Facts.new("bar", "fact1" => "value1", "uptime_days" => "60") + @baz = Puppet::Node::Facts.new("baz", "fact1" => "value2", "fact2" => "value1", "uptime_days" => "90") + @bat = Puppet::Node::Facts.new("bat") + @foo.timestamp = @now - 3600*1 + @bar.timestamp = @now - 3600*3 + @baz.timestamp = @now - 3600*5 + @bat.timestamp = @now - 3600*7 + [@foo, @bar, @baz, @bat].each {|facts| Puppet::Node::Facts.indirection.save(facts)} + end + + it "should return node names that match 'equal' constraints" do + request = search_request('facts.fact1.eq' => 'value1', + 'facts.fact2.eq' => 'value2') + terminus.search(request).should == ["foo"] + end + + it "should return node names that match 'not equal' constraints" do + request = search_request('facts.fact1.ne' => 'value2') + terminus.search(request).should == ["bar","foo"] + end + + it "should return node names that match strict inequality constraints" do + request = search_request('facts.uptime_days.gt' => '20', + 'facts.uptime_days.lt' => '70') + terminus.search(request).should == ["bar","foo"] + end + + it "should return node names that match non-strict inequality constraints" do + request = search_request('facts.uptime_days.ge' => '30', + 'facts.uptime_days.le' => '60') + terminus.search(request).should == ["bar","foo"] + end + + it "should return node names whose facts are within a given timeframe" do + request = search_request('meta.timestamp.ge' => @now - 3600*5, + 'meta.timestamp.le' => @now - 3600*1) + terminus.search(request).should == ["bar","baz","foo"] + end + + it "should return node names whose facts are from a specific time" do + request = search_request('meta.timestamp.eq' => @now - 3600*3) + terminus.search(request).should == ["bar"] + end + + it "should return node names whose facts are not from a specific time" do + request = search_request('meta.timestamp.ne' => @now - 3600*1) + terminus.search(request).should == ["bar","bat","baz"] + end + + it "should perform strict searches on nodes by timestamp" do + request = search_request('meta.timestamp.gt' => @now - 3600*5, + 'meta.timestamp.lt' => @now - 3600*1) + terminus.search(request).should == ["bar"] + end + + it "should search nodes based on both facts and timestamp values" do + request = search_request('facts.uptime_days.gt' => '45', + 'meta.timestamp.lt' => @now - 3600*4) + terminus.search(request).should == ["baz"] + end + end +end + diff --git a/spec/unit/indirector/facts/yaml_spec.rb b/spec/unit/indirector/facts/yaml_spec.rb index ae1e97812..c266df18f 100755 --- a/spec/unit/indirector/facts/yaml_spec.rb +++ b/spec/unit/indirector/facts/yaml_spec.rb @@ -23,4 +23,218 @@ describe Puppet::Node::Facts::Yaml do it "should have its name set to :yaml" do Puppet::Node::Facts::Yaml.name.should == :yaml end + + describe "#search" do + def assert_search_matches(matching, nonmatching, query) + request = Puppet::Indirector::Request.new(:inventory, :search, nil, query) + + Dir.stubs(:glob).returns(matching.keys + nonmatching.keys) + [matching, nonmatching].each do |examples| + examples.each do |key, value| + YAML.stubs(:load_file).with(key).returns value + end + end + Puppet::Node::Facts::Yaml.new.search(request).should =~ matching.values.map {|facts| facts.name} + end + + it "should return node names that match the search query options" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '4'), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "i386", 'processor_count' => '4', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '4'), + "/path/to/nonmatching1.yaml" => Puppet::Node::Facts.new("nonmatchingnode1", "architecture" => "powerpc", 'processor_count' => '5'), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5'), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3", 'processor_count' => '4'), + }, + {'facts.architecture' => 'i386', 'facts.processor_count' => '4'} + ) + end + + it "should return empty array when no nodes match the search query options" do + assert_search_matches({}, { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '10'), + "/path/to/nonmatching1.yaml" => Puppet::Node::Facts.new("nonmatchingnode1", "architecture" => "powerpc", 'processor_count' => '5'), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5'), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3", 'processor_count' => '4'), + }, + {'facts.processor_count.lt' => '4', 'facts.processor_count.gt' => '4'} + ) + end + + + it "should return node names that match the search query options with the greater than operator" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '10', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '4'), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '3'), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ), + }, + {'facts.processor_count.gt' => '4'} + ) + end + + it "should return node names that match the search query options with the less than operator" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '30', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '50' ), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '100'), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ), + }, + {'facts.processor_count.lt' => '50'} + ) + end + + it "should return node names that match the search query options with the less than or equal to operator" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '50', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '100' ), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5000'), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ), + }, + {'facts.processor_count.le' => '50'} + ) + end + + it "should return node names that match the search query options with the greater than or equal to operator" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '100'), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '50', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '40'), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '9' ), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ), + }, + {'facts.processor_count.ge' => '50'} + ) + end + + it "should return node names that match the search query options with the not equal operator" do + assert_search_matches({ + '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => 'arm' ), + '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => 'powerpc', 'randomfact' => 'foo') + }, + { + "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "i386" ), + "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '9' ), + "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ), + }, + {'facts.architecture.ne' => 'i386'} + ) + end + + def apply_timestamp(facts, timestamp) + facts.timestamp = timestamp + facts + end + + it "should be able to query based on meta.timestamp.gt" do + assert_search_matches({ + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + }, + { + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + {'meta.timestamp.gt' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp.le" do + assert_search_matches({ + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + { + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + }, + {'meta.timestamp.le' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp.lt" do + assert_search_matches({ + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + }, + { + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + {'meta.timestamp.lt' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp.ge" do + assert_search_matches({ + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + { + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + }, + {'meta.timestamp.ge' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp.eq" do + assert_search_matches({ + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + { + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + }, + {'meta.timestamp.eq' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp" do + assert_search_matches({ + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + { + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + }, + {'meta.timestamp' => '2010-10-15'} + ) + end + + it "should be able to query based on meta.timestamp.ne" do + assert_search_matches({ + '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")), + '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")), + '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")), + '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")), + }, + { + '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")), + }, + {'meta.timestamp.ne' => '2010-10-15'} + ) + end + end end diff --git a/spec/unit/indirector/file_bucket_file/file_spec.rb b/spec/unit/indirector/file_bucket_file/file_spec.rb index edf537a43..1423cb2e3 100755 --- a/spec/unit/indirector/file_bucket_file/file_spec.rb +++ b/spec/unit/indirector/file_bucket_file/file_spec.rb @@ -22,13 +22,97 @@ describe Puppet::FileBucketFile::File do Puppet[:bucketdir] = tmpdir('bucketdir') end - describe "when diffing files" do - def save_bucket_file(contents) - bucket_file = Puppet::FileBucket::File.new(contents) - Puppet::FileBucket::File.indirection.save(bucket_file) - bucket_file.checksum_data + def save_bucket_file(contents, path = "/who_cares") + bucket_file = Puppet::FileBucket::File.new(contents) + Puppet::FileBucket::File.indirection.save(bucket_file, "md5/#{Digest::MD5.hexdigest(contents)}#{path}") + bucket_file.checksum_data + end + + describe "when servicing a save request" do + describe "when supplying a path" do + it "should store the path if not already stored" do + checksum = save_bucket_file("stuff", "/foo/bar") + dir_path = "#{Puppet[:bucketdir]}/c/1/3/d/8/8/c/b/c13d88cb4cb02003daedb8a84e5d272a" + File.read("#{dir_path}/contents").should == "stuff" + File.read("#{dir_path}/paths").should == "foo/bar\n" + end + + it "should leave the paths file alone if the path is already stored" do + checksum = save_bucket_file("stuff", "/foo/bar") + checksum = save_bucket_file("stuff", "/foo/bar") + dir_path = "#{Puppet[:bucketdir]}/c/1/3/d/8/8/c/b/c13d88cb4cb02003daedb8a84e5d272a" + File.read("#{dir_path}/contents").should == "stuff" + File.read("#{dir_path}/paths").should == "foo/bar\n" + end + + it "should store an additional path if the new path differs from those already stored" do + checksum = save_bucket_file("stuff", "/foo/bar") + checksum = save_bucket_file("stuff", "/foo/baz") + dir_path = "#{Puppet[:bucketdir]}/c/1/3/d/8/8/c/b/c13d88cb4cb02003daedb8a84e5d272a" + File.read("#{dir_path}/contents").should == "stuff" + File.read("#{dir_path}/paths").should == "foo/bar\nfoo/baz\n" + end + end + + describe "when not supplying a path" do + it "should save the file and create an empty paths file" do + checksum = save_bucket_file("stuff", "") + dir_path = "#{Puppet[:bucketdir]}/c/1/3/d/8/8/c/b/c13d88cb4cb02003daedb8a84e5d272a" + File.read("#{dir_path}/contents").should == "stuff" + File.read("#{dir_path}/paths").should == "" + end + end + end + + describe "when servicing a head/find request" do + describe "when supplying a path" do + it "should return false/nil if the file isn't bucketed" do + Puppet::FileBucket::File.indirection.head("md5/0ae2ec1980410229885fe72f7b44fe55/foo/bar").should == false + Puppet::FileBucket::File.indirection.find("md5/0ae2ec1980410229885fe72f7b44fe55/foo/bar").should == nil + end + + it "should return false/nil if the file is bucketed but with a different path" do + checksum = save_bucket_file("I'm the contents of a file", '/foo/bar') + Puppet::FileBucket::File.indirection.head("md5/#{checksum}/foo/baz").should == false + Puppet::FileBucket::File.indirection.find("md5/#{checksum}/foo/baz").should == nil + end + + it "should return true/file if the file is already bucketed with the given path" do + contents = "I'm the contents of a file" + checksum = save_bucket_file(contents, '/foo/bar') + Puppet::FileBucket::File.indirection.head("md5/#{checksum}/foo/bar").should == true + find_result = Puppet::FileBucket::File.indirection.find("md5/#{checksum}/foo/bar") + find_result.should be_a(Puppet::FileBucket::File) + find_result.checksum.should == "{md5}#{checksum}" + find_result.to_s.should == contents + end + end + + describe "when not supplying a path" do + [false, true].each do |trailing_slash| + describe "#{trailing_slash ? 'with' : 'without'} a trailing slash" do + trailing_string = trailing_slash ? '/' : '' + + it "should return false/nil if the file isn't bucketed" do + Puppet::FileBucket::File.indirection.head("md5/0ae2ec1980410229885fe72f7b44fe55#{trailing_string}").should == false + Puppet::FileBucket::File.indirection.find("md5/0ae2ec1980410229885fe72f7b44fe55#{trailing_string}").should == nil + end + + it "should return true/file if the file is already bucketed" do + contents = "I'm the contents of a file" + checksum = save_bucket_file(contents, '/foo/bar') + Puppet::FileBucket::File.indirection.head("md5/#{checksum}#{trailing_string}").should == true + find_result = Puppet::FileBucket::File.indirection.find("md5/#{checksum}#{trailing_string}") + find_result.should be_a(Puppet::FileBucket::File) + find_result.checksum.should == "{md5}#{checksum}" + find_result.to_s.should == contents + end + end + end end + end + describe "when diffing files" do it "should generate an empty string if there is no diff" do checksum = save_bucket_file("I'm the contents of a file") Puppet::FileBucket::File.indirection.find("md5/#{checksum}", :diff_with => checksum).should == '' @@ -102,7 +186,7 @@ HERE key = "md5/#{@digest}" if supply_path - key += "//path/to/file" + key += "/path/to/file" end @request = Puppet::Indirector::Request.new(:indirection_name, :find, key, request_options) @@ -116,10 +200,15 @@ HERE it "should return an instance of Puppet::FileBucket::File created with the content if the file exists" do make_bucketed_file - bucketfile = @store.find(@request) - bucketfile.should be_a(Puppet::FileBucket::File) - bucketfile.contents.should == @contents - @store.head(@request).should == true + if supply_path + @store.find(@request).should == nil + @store.head(@request).should == false # because path didn't match + else + bucketfile = @store.find(@request) + bucketfile.should be_a(Puppet::FileBucket::File) + bucketfile.contents.should == @contents + @store.head(@request).should == true + end end it "should return nil if no file is found" do diff --git a/spec/unit/indirector/queue_spec.rb b/spec/unit/indirector/queue_spec.rb index 7732e411a..49e5e1015 100755 --- a/spec/unit/indirector/queue_spec.rb +++ b/spec/unit/indirector/queue_spec.rb @@ -42,8 +42,7 @@ describe Puppet::Indirector::Queue, :if => Puppet.features.pson? do @subject = @subject_class.new @subject.name = :me - Puppet.settings.stubs(:value).returns("bogus setting data") - Puppet.settings.stubs(:value).with(:queue_type).returns(:test_client) + Puppet[:queue_type] = :test_client Puppet::Util::Queue.stubs(:queue_type_to_class).with(:test_client).returns(Puppet::Indirector::Queue::TestClient) @request = stub 'request', :key => :me, :instance => @subject @@ -112,9 +111,12 @@ describe Puppet::Indirector::Queue, :if => Puppet.features.pson? do it "should log but not propagate errors" do @store_class.client.expects(:subscribe).yields("foo") - @store_class.expects(:intern).raises ArgumentError - Puppet.expects(:err) - @store_class.subscribe {|o| o } + @store_class.expects(:intern).raises(ArgumentError) + expect { @store_class.subscribe {|o| o } }.should_not raise_error + + @logs.length.should == 1 + @logs.first.message.should =~ /Error occured with subscription to queue my_queue for indirection my_queue: ArgumentError/ + @logs.first.level.should == :err end end end diff --git a/spec/unit/module_spec.rb b/spec/unit/module_spec.rb index 8f1c794b2..54f5444ee 100755 --- a/spec/unit/module_spec.rb +++ b/spec/unit/module_spec.rb @@ -367,9 +367,9 @@ describe Puppet::Module do mod.stubs(:path).returns "/a/foo" FileTest.expects(:exist?).with("/a/foo/plugins").returns true - mod.expects(:warning) - mod.plugin_directory.should == "/a/foo/plugins" + @logs.first.message.should == "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" + @logs.first.level.should == :warning end it "should default to 'lib' for the plugins directory" do diff --git a/spec/unit/network/handler/fileserver_spec.rb b/spec/unit/network/handler/fileserver_spec.rb index b1306c69e..014b82e69 100644 --- a/spec/unit/network/handler/fileserver_spec.rb +++ b/spec/unit/network/handler/fileserver_spec.rb @@ -158,7 +158,7 @@ describe Puppet::Network::Handler::FileServer do end it "should not fail for inexistant plugins type" do - lambda { @mount.list("puppet/parser",true,false) }.should_not raise_error + @mount.list("puppet/parser",true,false) end end diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb index a1cb75841..25f6d8fe2 100644 --- a/spec/unit/network/http/api/v1_spec.rb +++ b/spec/unit/network/http/api/v1_spec.rb @@ -88,6 +88,34 @@ describe Puppet::Network::HTTP::API::V1 do @tester.uri2indirection("GET", "/env/inventory/search", {})[1].should == :search end + it "should choose 'find' as the indirection method if the http method is a GET and the indirection name is facts" do + @tester.uri2indirection("GET", "/env/facts/bar", {})[1].should == :find + end + + it "should choose 'save' as the indirection method if the http method is a PUT and the indirection name is facts" do + @tester.uri2indirection("PUT", "/env/facts/bar", {})[1].should == :save + end + + it "should choose 'search' as the indirection method if the http method is a GET and the indirection name is inventory" do + @tester.uri2indirection("GET", "/env/inventory/search", {})[1].should == :search + end + + it "should choose 'search' as the indirection method if the http method is a GET and the indirection name is facts_search" do + @tester.uri2indirection("GET", "/env/facts_search/bar", {})[1].should == :search + end + + it "should change indirection name to 'facts' if the http method is a GET and the indirection name is facts_search" do + @tester.uri2indirection("GET", "/env/facts_search/bar", {})[0].should == 'facts' + end + + it "should not change indirection name from 'facts' if the http method is a GET and the indirection name is facts" do + @tester.uri2indirection("GET", "/env/facts/bar", {})[0].should == 'facts' + end + + it "should change indirection name to 'status' if the http method is a GET and the indirection name is statuses" do + @tester.uri2indirection("GET", "/env/statuses/bar", {})[0].should == 'status' + end + it "should choose 'delete' as the indirection method if the http method is a DELETE and the indirection name is singular" do @tester.uri2indirection("DELETE", "/env/foo/bar", {})[1].should == :destroy end diff --git a/spec/unit/network/http/compression_spec.rb b/spec/unit/network/http/compression_spec.rb index d44c5f1bb..85c62f358 100644..100755 --- a/spec/unit/network/http/compression_spec.rb +++ b/spec/unit/network/http/compression_spec.rb @@ -178,7 +178,7 @@ describe "http compression" do end it "should raise the error the second time" do - @inflater.expects(:inflate).raises(Zlib::DataError.new("not a zlib stream")) + @inflater.stubs(:inflate).raises(Zlib::DataError.new("not a zlib stream")) Zlib::Inflate.expects(:new).with.returns(@inflater) lambda { @adapter.uncompress("chunk") }.should raise_error end diff --git a/spec/unit/parser/ast/collection_spec.rb b/spec/unit/parser/ast/collection_spec.rb index a495bca15..99abc998d 100755 --- a/spec/unit/parser/ast/collection_spec.rb +++ b/spec/unit/parser/ast/collection_spec.rb @@ -4,20 +4,21 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe Puppet::Parser::AST::Collection do before :each do - @scope = stub_everything 'scope' - @mytype = stub_everything('mytype') - @scope.stubs(:find_resource_type).returns @mytype - @compiler = stub_everything 'compile' - @scope.stubs(:compiler).returns(@compiler) + @mytype = Puppet::Resource::Type.new(:definition, "mytype") + @environment = Puppet::Node::Environment.new + @environment.known_resource_types.add @mytype + + @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foonode", :environment => @environment)) + @scope = Puppet::Parser::Scope.new(:compiler => @compiler) @overrides = stub_everything 'overrides' @overrides.stubs(:is_a?).with(Puppet::Parser::AST).returns(true) - end it "should evaluate its query" do query = mock 'query' collection = Puppet::Parser::AST::Collection.new :query => query, :form => :virtual + collection.type = 'mytype' query.expects(:safeevaluate).with(@scope) @@ -26,8 +27,8 @@ describe Puppet::Parser::AST::Collection do it "should instantiate a Collector for this type" do collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test" - @test_type = stub 'type', :name => 'test' - @scope.expects(:find_resource_type).with('test').returns @test_type + @test_type = Puppet::Resource::Type.new(:definition, "test") + @environment.known_resource_types.add @test_type Puppet::Parser::Collector.expects(:new).with(@scope, "test", nil, nil, :virtual) @@ -35,7 +36,7 @@ describe Puppet::Parser::AST::Collection do end it "should tell the compiler about this collector" do - collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test" + collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype" Puppet::Parser::Collector.stubs(:new).returns("whatever") @compiler.expects(:add_collection).with("whatever") @@ -45,7 +46,7 @@ describe Puppet::Parser::AST::Collection do it "should evaluate overriden paramaters" do collector = stub_everything 'collector' - collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test", :override => @overrides + collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype", :override => @overrides Puppet::Parser::Collector.stubs(:new).returns(collector) @overrides.expects(:safeevaluate).with(@scope) @@ -55,7 +56,7 @@ describe Puppet::Parser::AST::Collection do it "should tell the collector about overrides" do collector = mock 'collector' - collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test", :override => @overrides + collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype", :override => @overrides Puppet::Parser::Collector.stubs(:new).returns(collector) collector.expects(:add_override) @@ -63,5 +64,8 @@ describe Puppet::Parser::AST::Collection do collection.evaluate(@scope) end - + it "should fail when evaluating undefined resource types" do + collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "bogus" + lambda { collection.evaluate(@scope) }.should raise_error "Resource type bogus doesn't exist" + end end diff --git a/spec/unit/parser/functions/defined_spec.rb b/spec/unit/parser/functions/defined_spec.rb index 0dd1dadb8..0113c3233 100755 --- a/spec/unit/parser/functions/defined_spec.rb +++ b/spec/unit/parser/functions/defined_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the 'defined' function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do Puppet::Node::Environment.stubs(:current).returns(nil) diff --git a/spec/unit/parser/functions/extlookup_spec.rb b/spec/unit/parser/functions/extlookup_spec.rb index a476dc844..46cd3cc27 100755 --- a/spec/unit/parser/functions/extlookup_spec.rb +++ b/spec/unit/parser/functions/extlookup_spec.rb @@ -4,12 +4,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') require 'tempfile' describe "the extlookup function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new - @scope.stubs(:environment).returns(Puppet::Node::Environment.new('production')) - Puppet::Parser::Functions.function("extlookup") end it "should exist" do diff --git a/spec/unit/parser/functions/fqdn_rand_spec.rb b/spec/unit/parser/functions/fqdn_rand_spec.rb index 151ebac9a..be2e6fa76 100644..100755 --- a/spec/unit/parser/functions/fqdn_rand_spec.rb +++ b/spec/unit/parser/functions/fqdn_rand_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the fqdn_rand function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/generate_spec.rb b/spec/unit/parser/functions/generate_spec.rb index 12f454210..d25015b56 100755 --- a/spec/unit/parser/functions/generate_spec.rb +++ b/spec/unit/parser/functions/generate_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the generate function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/include_spec.rb b/spec/unit/parser/functions/include_spec.rb index 67227e7d9..cfaadfbb6 100644..100755 --- a/spec/unit/parser/functions/include_spec.rb +++ b/spec/unit/parser/functions/include_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the 'include' function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do Puppet::Node::Environment.stubs(:current).returns(nil) diff --git a/spec/unit/parser/functions/inline_template_spec.rb b/spec/unit/parser/functions/inline_template_spec.rb index 36d53778d..712c68c69 100755 --- a/spec/unit/parser/functions/inline_template_spec.rb +++ b/spec/unit/parser/functions/inline_template_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the inline_template function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new @@ -56,4 +59,4 @@ describe "the inline_template function" do lambda { @scope.function_inline_template("1") }.should raise_error(Puppet::ParseError) end -end
\ No newline at end of file +end diff --git a/spec/unit/parser/functions/realize_spec.rb b/spec/unit/parser/functions/realize_spec.rb index 899f69b01..3106c42b6 100755 --- a/spec/unit/parser/functions/realize_spec.rb +++ b/spec/unit/parser/functions/realize_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the realize function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @collector = stub_everything 'collector' diff --git a/spec/unit/parser/functions/regsubst_spec.rb b/spec/unit/parser/functions/regsubst_spec.rb index 09aa92d28..1fb8e410c 100755 --- a/spec/unit/parser/functions/regsubst_spec.rb +++ b/spec/unit/parser/functions/regsubst_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the regsubst function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/require_spec.rb b/spec/unit/parser/functions/require_spec.rb index 4afbd5a63..edcbc4ae6 100755 --- a/spec/unit/parser/functions/require_spec.rb +++ b/spec/unit/parser/functions/require_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the require function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @catalog = stub 'catalog' diff --git a/spec/unit/parser/functions/shellquote_spec.rb b/spec/unit/parser/functions/shellquote_spec.rb index c8b0d650d..55302b97b 100755 --- a/spec/unit/parser/functions/shellquote_spec.rb +++ b/spec/unit/parser/functions/shellquote_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the shellquote function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/split_spec.rb b/spec/unit/parser/functions/split_spec.rb index 39710003b..b892a5c2a 100755 --- a/spec/unit/parser/functions/split_spec.rb +++ b/spec/unit/parser/functions/split_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the split function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/sprintf_spec.rb b/spec/unit/parser/functions/sprintf_spec.rb index 4f29012b3..69fbb5e97 100755 --- a/spec/unit/parser/functions/sprintf_spec.rb +++ b/spec/unit/parser/functions/sprintf_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the sprintf function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/tag_spec.rb b/spec/unit/parser/functions/tag_spec.rb index e9b5122c7..b6bb45252 100755 --- a/spec/unit/parser/functions/tag_spec.rb +++ b/spec/unit/parser/functions/tag_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the 'tag' function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/functions/template_spec.rb b/spec/unit/parser/functions/template_spec.rb index 9dd5cc947..7eaf3554d 100755 --- a/spec/unit/parser/functions/template_spec.rb +++ b/spec/unit/parser/functions/template_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the template function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new @@ -59,4 +62,4 @@ describe "the template function" do lambda { @scope.function_template("1") }.should raise_error(Puppet::ParseError) end -end
\ No newline at end of file +end diff --git a/spec/unit/parser/functions/versioncmp_spec.rb b/spec/unit/parser/functions/versioncmp_spec.rb index 2bc7be801..ddc79cd85 100755 --- a/spec/unit/parser/functions/versioncmp_spec.rb +++ b/spec/unit/parser/functions/versioncmp_spec.rb @@ -3,6 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') describe "the versioncmp function" do + before :all do + Puppet::Parser::Functions.autoloader.loadall + end before :each do @scope = Puppet::Parser::Scope.new diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb index 58978ff03..96df61348 100755 --- a/spec/unit/parser/lexer_spec.rb +++ b/spec/unit/parser/lexer_spec.rb @@ -529,6 +529,22 @@ describe Puppet::Parser::Lexer, "when lexing comments" do @lexer.fullscan end + it "should add a new comment stack level on LPAREN" do + @lexer.string = "(" + + @lexer.expects(:commentpush) + + @lexer.fullscan + end + + it "should pop the current comment on RPAREN" do + @lexer.string = ")" + + @lexer.expects(:commentpop) + + @lexer.fullscan + end + it "should return the current comments on getcomment" do @lexer.string = "# comment" @lexer.fullscan @@ -651,11 +667,8 @@ describe "Puppet::Parser::Lexer in the old tests" do end end -require File.dirname(__FILE__) + '/../../../test/lib/puppettest' -require File.dirname(__FILE__) + '/../../../test/lib/puppettest/support/utils' describe "Puppet::Parser::Lexer in the old tests when lexing example files" do - extend PuppetTest::Support::Utils - textfiles do |file| + my_fixtures('*.pp') do |file| it "should correctly lex #{file}" do lexer = Puppet::Parser::Lexer.new lexer.file = file diff --git a/spec/unit/parser/parser_spec.rb b/spec/unit/parser/parser_spec.rb index f5df3041c..01cdcb976 100755 --- a/spec/unit/parser/parser_spec.rb +++ b/spec/unit/parser/parser_spec.rb @@ -78,6 +78,12 @@ describe Puppet::Parser do end + describe "when parsing selector" do + it "should support hash access on the left hand side" do + lambda { @parser.parse("$h = { 'a' => 'b' } $a = $h['a'] ? { 'b' => 'd', default => undef }") }.should_not raise_error + end + end + describe "when parsing 'if'" do it "not, it should create the correct ast objects" do Puppet::Parser::AST::Not.expects(:new).with { |h| h[:value].is_a?(Puppet::Parser::AST::Boolean) } @@ -258,7 +264,7 @@ describe Puppet::Parser do before do @lexer = stub 'lexer', :line => 50, :file => "/foo/bar", :getcomment => "whev" @parser.stubs(:lexer).returns @lexer - @class = stub 'class', :use_docs => false + @class = Puppet::Resource::Type.new(:hostclass, "myclass", :use_docs => false) end it "should return a new instance of the provided class created with the provided options" do @@ -281,7 +287,7 @@ describe Puppet::Parser do it "should include docs when the AST class uses them" do @class.expects(:use_docs).returns true @class.stubs(:new) - @parser.expects(:ast_context).with{ |a| a[0] == true }.returns({}) + @parser.expects(:ast_context).with{ |docs, line| docs == true }.returns({}) @parser.ast(@class, :file => "/bar") end diff --git a/spec/unit/provider/host/parsed_spec.rb b/spec/unit/provider/host/parsed_spec.rb index 5704304ba..048d77ba2 100644..100755 --- a/spec/unit/provider/host/parsed_spec.rb +++ b/spec/unit/provider/host/parsed_spec.rb @@ -1,17 +1,14 @@ #!/usr/bin/env ruby require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') +require 'shared_behaviours/all_parsedfile_providers' require 'puppet_spec/files' -require 'puppettest/support/utils' -require 'puppettest/fileparsing' provider_class = Puppet::Type.type(:host).provider(:parsed) describe provider_class do include PuppetSpec::Files - extend PuppetTest::Support::Utils - include PuppetTest::FileParsing before do @host_class = Puppet::Type.type(:host) @@ -132,11 +129,8 @@ describe provider_class do end describe "when operating on /etc/hosts like files" do - fakedata("data/providers/host/parsed","valid*").each do |file| - it "should be able to parse #{file}" do - fakedataparse(file) - end - end + it_should_behave_like "all parsedfile providers", + provider_class, my_fixtures('valid*') it "should be able to generate a simple hostfile entry" do host = mkhost( diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb index fc4df97ab..b63c0751f 100755 --- a/spec/unit/provider/mount/parsed_spec.rb +++ b/spec/unit/provider/mount/parsed_spec.rb @@ -4,189 +4,249 @@ # Copyright (c) 2006. All rights reserved. require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') +require 'shared_behaviours/all_parsedfile_providers' -require 'puppettest/support/utils' -require 'puppettest/fileparsing' - -module ParsedMountTesting - include PuppetTest::Support::Utils - include PuppetTest::FileParsing - - def fake_fstab - os = Facter['operatingsystem'] - if os == "Solaris" - name = "solaris.fstab" - elsif os == "FreeBSD" - name = "freebsd.fstab" - else - # Catchall for other fstabs - name = "linux.fstab" - end - oldpath = @provider_class.default_target - fakefile(File::join("data/types/mount", name)) - end +provider_class = Puppet::Type.type(:mount).provider(:parsed) - def mkmountargs - mount = nil +describe provider_class do - if defined?(@pcount) - @pcount += 1 - else - @pcount = 1 - end - args = { - :name => "/fspuppet#{@pcount}", - :device => "/dev/dsk#{@pcount}", - } + before :each do + @mount_class = Puppet::Type.type(:mount) + @provider = @mount_class.provider(:parsed) + end - @provider_class.fields(:parsed).each do |field| - args[field] = "fake#{field}#{@pcount}" unless args.include? field - end + # LAK:FIXME I can't mock Facter because this test happens at parse-time. + it "should default to /etc/vfstab on Solaris" do + pending "This test only works on Solaris" unless Facter.value(:operatingsystem) == 'Solaris' + Puppet::Type.type(:mount).provider(:parsed).default_target.should == '/etc/vfstab' + end - args + it "should default to /etc/fstab on anything else" do + pending "This test does not work on Solaris" if Facter.value(:operatingsystem) == 'Solaris' + Puppet::Type.type(:mount).provider(:parsed).default_target.should == '/etc/fstab' end - def mkmount - hash = mkmountargs - #hash[:provider] = @provider_class.name + describe "when parsing a line" do - fakeresource = stub :type => :mount, :name => hash[:name] - fakeresource.stubs(:[]).with(:name).returns(hash[:name]) - fakeresource.stubs(:should).with(:target).returns(nil) + it "should not crash on incomplete lines in fstab" do + parse = @provider.parse <<-FSTAB +/dev/incomplete +/dev/device name +FSTAB + lambda{ @provider.to_line(parse[0]) }.should_not raise_error + end - mount = @provider_class.new(fakeresource) - hash[:record_type] = :parsed - hash[:ensure] = :present - mount.property_hash = hash +# it_should_behave_like "all parsedfile providers", +# provider_class, my_fixtures('*.fstab') - mount - end + describe "on Solaris", :if => Facter.value(:operatingsystem) == 'Solaris' do - # Here we just create a fake host type that answers to all of the methods - # but does not modify our actual system. - def mkfaketype - @provider.stubs(:filetype).returns(Puppet::Util::FileType.filetype(:ram)) - end -end + before :each do + @example_line = "/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 \t\t / \t ufs 1 no\t-" + end -provider_class = Puppet::Type.type(:mount).provider(:parsed) + it "should extract device from the first field" do + @provider.parse_line(@example_line)[:device].should == '/dev/dsk/c0d0s0' + end -describe provider_class do - before :each do - @mount_class = Puppet::Type.type(:mount) - @provider_class = @mount_class.provider(:parsed) - end + it "should extract blockdevice from second field" do + @provider.parse_line(@example_line)[:blockdevice].should == "/dev/rdsk/c0d0s0" + end + it "should extract name from third field" do + @provider.parse_line(@example_line)[:name].should == "/" + end - describe provider_class do - include ParsedMountTesting + it "should extract fstype from fourth field" do + @provider.parse_line(@example_line)[:fstype].should == "ufs" + end - it "should be able to parse all of the example mount tabs" do - tab = fake_fstab - @provider = @provider_class + it "should extract pass from fifth field" do + @provider.parse_line(@example_line)[:pass].should == "1" + end - # LAK:FIXME Again, a relatively bad test, but I don't know how to rspec-ify this. - # I suppose this is more of an integration test? I dunno. - fakedataparse(tab) do - # Now just make we've got some mounts we know will be there - hashes = @provider_class.target_records(tab).find_all { |i| i.is_a? Hash } - (hashes.length > 0).should be_true - root = hashes.find { |i| i[:name] == "/" } + it "should extract atboot from sixth field" do + @provider.parse_line(@example_line)[:atboot].should == "no" + end - proc { @provider_class.to_file(hashes) }.should_not raise_error + it "should extract options from seventh field" do + @provider.parse_line(@example_line)[:options].should == "-" end - end - # LAK:FIXME I can't mock Facter because this test happens at parse-time. - it "should default to /etc/vfstab on Solaris and /etc/fstab everywhere else" do - should = case Facter.value(:operatingsystem) - when "Solaris"; "/etc/vfstab" - else - "/etc/fstab" - end - Puppet::Type.type(:mount).provider(:parsed).default_target.should == should end - it "should not crash on incomplete lines in fstab" do - parse = @provider_class.parse <<-FSTAB -/dev/incomplete -/dev/device name - FSTAB + describe "on other platforms than Solaris", :if => Facter.value(:operatingsystem) != 'Solaris' do - lambda{ @provider_class.to_line(parse[0]) }.should_not raise_error - end - end + before :each do + @example_line = "/dev/vg00/lv01\t/spare \t \t ext3 defaults\t1 2" + end - describe provider_class, " when mounting an absent filesystem" do - include ParsedMountTesting + it "should extract device from the first field" do + @provider.parse_line(@example_line)[:device].should == '/dev/vg00/lv01' + end - # #730 - Make sure 'flush' is called when a mount is moving from absent to mounted - it "should flush the fstab to disk" do - mount = mkmount + it "should extract name from second field" do + @provider.parse_line(@example_line)[:name].should == "/spare" + end - # Mark the mount as absent - mount.property_hash[:ensure] = :absent + it "should extract fstype from third field" do + @provider.parse_line(@example_line)[:fstype].should == "ext3" + end - mount.stubs(:mountcmd) # just so we don't actually try to mount anything + it "should extract options from fourth field" do + @provider.parse_line(@example_line)[:options].should == "defaults" + end - mount.expects(:flush) - mount.mount - end - end + it "should extract dump from fifth field" do + @provider.parse_line(@example_line)[:dump].should == "1" + end - describe provider_class, " when modifying the filesystem tab" do - include ParsedMountTesting - before do - Puppet.settings.stubs(:use) - # Never write to disk, only to RAM. - #@provider_class.stubs(:filetype).returns(Puppet::Util::FileType.filetype(:ram)) - @provider_class.stubs(:target_object).returns(Puppet::Util::FileType.filetype(:ram).new("eh")) - @provider_class.clear - - @mount = mkmount - @target = @provider_class.default_target - end + it "should extract options from sixth field" do + @provider.parse_line(@example_line)[:pass].should == "2" + end - it "should write the mount to disk when :flush is called" do - old_text = @provider_class.target_object(@provider_class.default_target).read + end - @mount.flush + end - text = @provider_class.target_object(@provider_class.default_target).read - text.should == old_text + @mount.class.to_line(@mount.property_hash) + "\n" + describe "mountinstances" do + it "should get name from mountoutput found on Solaris" do + Facter.stubs(:value).with(:operatingsystem).returns 'Solaris' + @provider.stubs(:mountcmd).returns(File.read(my_fixture('solaris.mount'))) + mounts = @provider.mountinstances + mounts.size.should == 6 + mounts[0].should == { :name => '/', :mounted => :yes } + mounts[1].should == { :name => '/proc', :mounted => :yes } + mounts[2].should == { :name => '/etc/mnttab', :mounted => :yes } + mounts[3].should == { :name => '/tmp', :mounted => :yes } + mounts[4].should == { :name => '/export/home', :mounted => :yes } + mounts[5].should == { :name => '/ghost', :mounted => :yes } end - end - describe provider_class, " when parsing information about the root filesystem", :if => Facter["operatingsystem"].value != "Darwin" do - include ParsedMountTesting + it "should get name from mountoutput found on HP-UX" do + Facter.stubs(:value).with(:operatingsystem).returns 'HP-UX' + @provider.stubs(:mountcmd).returns(File.read(my_fixture('hpux.mount'))) + mounts = @provider.mountinstances + mounts.size.should == 17 + mounts[0].should == { :name => '/', :mounted => :yes } + mounts[1].should == { :name => '/devices', :mounted => :yes } + mounts[2].should == { :name => '/dev', :mounted => :yes } + mounts[3].should == { :name => '/system/contract', :mounted => :yes } + mounts[4].should == { :name => '/proc', :mounted => :yes } + mounts[5].should == { :name => '/etc/mnttab', :mounted => :yes } + mounts[6].should == { :name => '/etc/svc/volatile', :mounted => :yes } + mounts[7].should == { :name => '/system/object', :mounted => :yes } + mounts[8].should == { :name => '/etc/dfs/sharetab', :mounted => :yes } + mounts[9].should == { :name => '/lib/libc.so.1', :mounted => :yes } + mounts[10].should == { :name => '/dev/fd', :mounted => :yes } + mounts[11].should == { :name => '/tmp', :mounted => :yes } + mounts[12].should == { :name => '/var/run', :mounted => :yes } + mounts[13].should == { :name => '/export', :mounted => :yes } + mounts[14].should == { :name => '/export/home', :mounted => :yes } + mounts[15].should == { :name => '/rpool', :mounted => :yes } + mounts[16].should == { :name => '/ghost', :mounted => :yes } + end - before do - @mount = @mount_class.new :name => "/" - @provider = @mount.provider + it "should get name from mountoutput found on Darwin" do + Facter.stubs(:value).with(:operatingsystem).returns 'Darwin' + @provider.stubs(:mountcmd).returns(File.read(my_fixture('darwin.mount'))) + mounts = @provider.mountinstances + mounts.size.should == 6 + mounts[0].should == { :name => '/', :mounted => :yes } + mounts[1].should == { :name => '/dev', :mounted => :yes } + mounts[2].should == { :name => '/net', :mounted => :yes } + mounts[3].should == { :name => '/home', :mounted => :yes } + mounts[4].should == { :name => '/usr', :mounted => :yes } + mounts[5].should == { :name => '/ghost', :mounted => :yes } end - it "should have a filesystem tab" do - FileTest.should be_exist(@provider_class.default_target) + it "should get name from mountoutput found on Linux" do + Facter.stubs(:value).with(:operatingsystem).returns 'Gentoo' + @provider.stubs(:mountcmd).returns(File.read(my_fixture('linux.mount'))) + mounts = @provider.mountinstances + mounts[0].should == { :name => '/', :mounted => :yes } + mounts[1].should == { :name => '/lib64/rc/init.d', :mounted => :yes } + mounts[2].should == { :name => '/sys', :mounted => :yes } + mounts[3].should == { :name => '/usr/portage', :mounted => :yes } + mounts[4].should == { :name => '/ghost', :mounted => :yes } end - it "should find the root filesystem" do - @provider_class.prefetch("/" => @mount) - @mount.provider.property_hash[:ensure].should == :present + it "should get name from mountoutput found on AIX" do + Facter.stubs(:value).with(:operatingsystem).returns 'AIX' + @provider.stubs(:mountcmd).returns(File.read(my_fixture('aix.mount'))) + mounts = @provider.mountinstances + mounts[0].should == { :name => '/', :mounted => :yes } + mounts[1].should == { :name => '/tmp', :mounted => :yes } + mounts[2].should == { :name => '/home', :mounted => :yes } + mounts[3].should == { :name => '/usr', :mounted => :yes } + mounts[4].should == { :name => '/usr/code', :mounted => :yes } end - it "should determine that the root fs is mounted" do - @provider_class.prefetch("/" => @mount) - @mount.provider.should be_mounted + it "should raise an error if a line is not understandable" do + @provider.stubs(:mountcmd).returns("bazinga!") + lambda { @provider.mountinstances }.should raise_error Puppet::Error end + end - describe provider_class, " when mounting and unmounting" do - include ParsedMountTesting + it "should support AIX's paragraph based /etc/filesystems" - it "should call the 'mount' command to mount the filesystem" + my_fixtures('*.fstab').each do |fstab| + platform = File.basename(fstab, '.fstab') + describe "when prefetching on #{platform}" do + before :each do + if Facter[:operatingsystem] == "Solaris" then + platform == 'solaris' or + pending "We need to stub the operatingsystem fact at load time, but can't" + else + platform != 'solaris' or + pending "We need to stub the operatingsystem fact at load time, but can't" + end + + # Stub the mount output to our fixture. + begin + mount = my_fixture(platform + '.mount') + @provider.stubs(:mountcmd).returns File.read(mount) + rescue + pending "is #{platform}.mount missing at this point?" + end - it "should call the 'unmount' command to unmount the filesystem" + # Note: we have to stub default_target before creating resources + # because it is used by Puppet::Type::Mount.new to populate the + # :target property. + @provider.stubs(:default_target).returns fstab + + @res_ghost = Puppet::Type::Mount.new(:name => '/ghost') # in no fake fstab + @res_mounted = Puppet::Type::Mount.new(:name => '/') # in every fake fstab + @res_unmounted = Puppet::Type::Mount.new(:name => '/boot') # in every fake fstab + @res_absent = Puppet::Type::Mount.new(:name => '/absent') # in no fake fstab + + # Simulate transaction.rb:prefetch + @resource_hash = {} + [@res_ghost, @res_mounted, @res_unmounted, @res_absent].each do |resource| + @resource_hash[resource.name] = resource + end + end - it "should specify the filesystem when remounting a filesystem" + it "should set :ensure to :unmounted if found in fstab but not mounted" do + @provider.prefetch(@resource_hash) + @res_unmounted.provider.get(:ensure).should == :unmounted + end + + it "should set :ensure to :ghost if not found in fstab but mounted" do + @provider.prefetch(@resource_hash) + @res_ghost.provider.get(:ensure).should == :ghost + end + + it "should set :ensure to :mounted if found in fstab and mounted" do + @provider.prefetch(@resource_hash) + @res_mounted.provider.get(:ensure).should == :mounted + end + + it "should set :ensure to :absent if not found in fstab and not mounted" do + @provider.prefetch(@resource_hash) + @res_absent.provider.get(:ensure).should == :absent + end + end end end diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb index 256295574..9cadfc403 100755 --- a/spec/unit/provider/mount_spec.rb +++ b/spec/unit/provider/mount_spec.rb @@ -19,18 +19,13 @@ describe Puppet::Provider::Mount do describe Puppet::Provider::Mount, " when mounting" do - it "should use the 'mountcmd' method to mount" do - @mounter.stubs(:options).returns(nil) - @mounter.expects(:mountcmd) - - @mounter.mount + before :each do + @mounter.stubs(:get).with(:ensure).returns(:mounted) end - it "should flush before mounting if a flush method exists" do - @mounter.meta_def(:flush) { } - @mounter.expects(:flush) - @mounter.stubs(:mountcmd) + it "should use the 'mountcmd' method to mount" do @mounter.stubs(:options).returns(nil) + @mounter.expects(:mountcmd) @mounter.mount end @@ -48,6 +43,23 @@ describe Puppet::Provider::Mount do @mounter.mount end + + it "should update the :ensure state to :mounted if it was :unmounted before" do + @mounter.expects(:mountcmd) + @mounter.stubs(:options).returns(nil) + @mounter.expects(:get).with(:ensure).returns(:unmounted) + @mounter.expects(:set).with(:ensure => :mounted) + @mounter.mount + end + + it "should update the :ensure state to :ghost if it was :absent before" do + @mounter.expects(:mountcmd) + @mounter.stubs(:options).returns(nil) + @mounter.expects(:get).with(:ensure).returns(:absent) + @mounter.expects(:set).with(:ensure => :ghost) + @mounter.mount + end + end describe Puppet::Provider::Mount, " when remounting" do @@ -77,69 +89,58 @@ describe Puppet::Provider::Mount do describe Puppet::Provider::Mount, " when unmounting" do + before :each do + @mounter.stubs(:get).with(:ensure).returns(:unmounted) + end + it "should call the :umount command with the resource name" do @mounter.expects(:umount).with(@name) @mounter.unmount end - end - - describe Puppet::Provider::Mount, " when determining if it is mounted" do - - it "should parse the results of running the mount command with no arguments" do - Facter.stubs(:value).returns("whatever") - @mounter.expects(:mountcmd).returns("") - @mounter.mounted? + it "should update the :ensure state to :absent if it was :ghost before" do + @mounter.expects(:umount).with(@name).returns true + @mounter.expects(:get).with(:ensure).returns(:ghost) + @mounter.expects(:set).with(:ensure => :absent) + @mounter.unmount end - it "should match ' on /private/var/automount<name>' if the operating system is Darwin" do - Facter.stubs(:value).with("operatingsystem").returns("Darwin") - @mounter.expects(:mountcmd).returns("/dev/whatever on /private/var/automount/\ndevfs on /dev") - - @mounter.should be_mounted + it "should update the :ensure state to :unmounted if it was :mounted before" do + @mounter.expects(:umount).with(@name).returns true + @mounter.expects(:get).with(:ensure).returns(:mounted) + @mounter.expects(:set).with(:ensure => :unmounted) + @mounter.unmount end - it "should match ' on <name>' if the operating system is Darwin" do - Facter.stubs(:value).with("operatingsystem").returns("Darwin") - @mounter.expects(:mountcmd).returns("/dev/disk03 on / (local, journaled)\ndevfs on /dev") - - @mounter.should be_mounted - end + end - it "should match '^<name> on' if the operating system is Solaris" do - Facter.stubs(:value).with("operatingsystem").returns("Solaris") - @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other") + describe Puppet::Provider::Mount, " when determining if it is mounted" do - @mounter.should be_mounted + it "should query the property_hash" do + @mounter.expects(:get).with(:ensure).returns(:mounted) + @mounter.mounted? end - it "should match '^<name> on' if the operating system is HP-UX" do - Facter.stubs(:value).with("operatingsystem").returns("HP-UX") - @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other") - - @mounter.should be_mounted + it "should return true if prefetched value is :mounted" do + @mounter.stubs(:get).with(:ensure).returns(:mounted) + @mounter.mounted? == true end - it "should match mounted devices if the operating system is AIX" do - Facter.stubs(:value).with("operatingsystem").returns("AIX") - mount_data = File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'unit', 'provider', 'mount', 'mount-output.aix.txt')) - @mounter.expects(:mountcmd).returns(mount_data) - - @mounter.should be_mounted + it "should return true if prefetched value is :ghost" do + @mounter.stubs(:get).with(:ensure).returns(:ghost) + @mounter.mounted? == true end - it "should match ' on <name>' if the operating system is not Darwin, Solaris, or HP-UX" do - Facter.stubs(:value).with("operatingsystem").returns("Debian") - @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on / and stuff\n/dev/other/disk on /var and stuff") - - @mounter.should be_mounted + it "should return false if prefetched value is :absent" do + @mounter.stubs(:get).with(:ensure).returns(:absent) + @mounter.mounted? == false end - it "should not be considered mounted if it did not match the mount output" do - Facter.stubs(:value).with("operatingsystem").returns("Debian") - @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on /something/else and stuff\n/dev/other/disk on /var and stuff") - - @mounter.should_not be_mounted + it "should return false if prefetched value is :unmounted" do + @mounter.stubs(:get).with(:ensure).returns(:unmounted) + @mounter.mounted? == false end + end + end diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb index fb4c64926..3ac57facc 100755 --- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb @@ -1,19 +1,13 @@ #!/usr/bin/env ruby require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') - +require 'shared_behaviours/all_parsedfile_providers' require 'puppet_spec/files' -require 'puppettest/support/utils' -require 'puppettest/fileparsing' -require 'puppettest/fakes' provider_class = Puppet::Type.type(:ssh_authorized_key).provider(:parsed) describe provider_class do include PuppetSpec::Files - extend PuppetTest::Support::Utils - include PuppetTest - include PuppetTest::FileParsing before :each do @sshauthkey_class = Puppet::Type.type(:ssh_authorized_key) @@ -29,15 +23,13 @@ describe provider_class do end def mkkey(args) - fakeresource = fakeresource(:ssh_authorized_key, args[:name]) - fakeresource.stubs(:should).with(:user).returns @user - fakeresource.stubs(:should).with(:target).returns @keyfile - - key = @provider.new(fakeresource) + args[:target] = @keyfile + args[:user] = @user + resource = Puppet::Type.type(:ssh_authorized_key).new(args) + key = @provider.new(resource) args.each do |p,v| key.send(p.to_s + "=", v) end - key end @@ -50,38 +42,28 @@ describe provider_class do @provider.target_object(@keyfile).read end - fakedata("data/providers/ssh_authorized_key/parsed").each { |file| - it "should be able to parse example data in #{file}" do - fakedataparse(file) - end - } + it_should_behave_like "all parsedfile providers", provider_class it "should be able to generate a basic authorized_keys file" do - key = mkkey( - { - :name => "Just Testing", - :key => "AAAAfsfddsjldjgksdflgkjsfdlgkj", - :type => "ssh-dss", - :ensure => :present, - - :options => [:absent] - }) + key = mkkey(:name => "Just Testing", + :key => "AAAAfsfddsjldjgksdflgkjsfdlgkj", + :type => "ssh-dss", + :ensure => :present, + :options => [:absent] + ) genkey(key).should == "ssh-dss AAAAfsfddsjldjgksdflgkjsfdlgkj Just Testing\n" end it "should be able to generate a authorized_keys file with options" do - key = mkkey( - { - :name => "root@localhost", - :key => "AAAAfsfddsjldjgksdflgkjsfdlgkj", - :type => "ssh-rsa", - :ensure => :present, - - :options => ['from="192.168.1.1"', "no-pty", "no-X11-forwarding"] - }) + key = mkkey(:name => "root@localhost", + :key => "AAAAfsfddsjldjgksdflgkjsfdlgkj", + :type => "ssh-rsa", + :ensure => :present, + :options => ['from="192.168.1.1"', "no-pty", "no-X11-forwarding"] + ) genkey(key).should == "from=\"192.168.1.1\",no-pty,no-X11-forwarding ssh-rsa AAAAfsfddsjldjgksdflgkjsfdlgkj root@localhost\n" end @@ -104,6 +86,7 @@ describe provider_class do before :each do @resource = stub("resource", :name => "foo") @resource.stubs(:[]).returns "foo" + @resource.class.stubs(:key_attributes).returns( [:name] ) @provider = provider_class.new(@resource) provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam) diff --git a/spec/unit/provider/user/user_role_add_spec.rb b/spec/unit/provider/user/user_role_add_spec.rb index 9cd0feb12..12a71d25a 100644 --- a/spec/unit/provider/user/user_role_add_spec.rb +++ b/spec/unit/provider/user/user_role_add_spec.rb @@ -115,6 +115,7 @@ describe provider_class do describe "when allow duplicate is enabled" do before do @resource.expects(:allowdupe?).returns true + @resource.stubs(:system?) @provider.stubs(:is_role?).returns(false) @provider.stubs(:execute) @provider.expects(:execute).with { |args| args.include?("-o") } diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb index f9babe6aa..b1719eeaf 100755 --- a/spec/unit/provider/user/useradd_spec.rb +++ b/spec/unit/provider/user/useradd_spec.rb @@ -15,6 +15,7 @@ describe provider_class do # #1360 it "should add -o when allowdupe is enabled and the user is being created" do @resource.expects(:allowdupe?).returns true + @resource.expects(:system?).returns true @provider.stubs(:execute) @provider.expects(:execute).with { |args| args.include?("-o") } @provider.create @@ -27,6 +28,14 @@ describe provider_class do @provider.uid = 150 end + it "should add -r when system is enabled" do + @resource.expects(:allowdupe?).returns true + @resource.expects(:system?).returns true + @provider.stubs(:execute) + @provider.expects(:execute).with { |args| args.include?("-r") } + @provider.create + end + it "should set password age rules" do provider_class.has_feature :manages_password_age @resource = Puppet::Type.type(:user).new :name => "myuser", :password_min_age => 5, :password_max_age => 10, :provider => :useradd @@ -53,6 +62,23 @@ describe provider_class do end end + describe "when checking to add system users" do + it "should check system users" do + @resource.expects(:system?) + @provider.check_system_users + end + + it "should return an array with a flag if it's a system user" do + @resource.stubs(:system?).returns true + @provider.check_system_users.must == ["-r"] + end + + it "should return an empty array if it's not a system user" do + @resource.stubs(:system?).returns false + @provider.check_system_users.must == [] + end + end + describe "when checking manage home" do it "should check manage home" do @resource.expects(:managehome?) @@ -88,6 +114,7 @@ describe provider_class do before do @resource.stubs(:allowdupe?).returns true @resource.stubs(:managehome?).returns true + @resource.stubs(:system?).returns true end it "should call command with :add" do @@ -115,20 +142,32 @@ describe provider_class do @provider.addcmd end + it "should return an array with -r if system? is true" do + resource = Puppet::Type.type(:user).new( :name => "bob", :system => true) + + provider_class.new( resource ).addcmd.should include("-r") + end + + it "should return an array without -r if system? is false" do + resource = Puppet::Type.type(:user).new( :name => "bob", :system => false) + + provider_class.new( resource ).addcmd.should_not include("-r") + end + it "should return an array with full command" do @provider.stubs(:command).with(:add).returns("useradd") @provider.stubs(:add_properties).returns(["-G", "somegroup"]) @resource.stubs(:[]).with(:name).returns("someuser") @resource.stubs(:[]).with(:expiry).returns("somedate") - @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", '-e somedate', "someuser"] + @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", '-e somedate', "-r", "someuser"] end - it "should return an array without -e if expery is undefined full command" do + it "should return an array without -e if expiry is undefined full command" do @provider.stubs(:command).with(:add).returns("useradd") @provider.stubs(:add_properties).returns(["-G", "somegroup"]) @resource.stubs(:[]).with(:name).returns("someuser") @resource.stubs(:[]).with(:expiry).returns nil - @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", "someuser"] + @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", "-r", "someuser"] end end @@ -136,6 +175,7 @@ describe provider_class do before do @resource.stubs(:allowdupe?).returns true @resource.stubs(:managehome?).returns true + @resource.stubs(:system?).returns true end it "should call command with :pass" do diff --git a/spec/unit/provider/zpool/solaris_spec.rb b/spec/unit/provider/zpool/solaris_spec.rb index 805dd54df..e2a0e16c8 100755 --- a/spec/unit/provider/zpool/solaris_spec.rb +++ b/spec/unit/provider/zpool/solaris_spec.rb @@ -76,6 +76,13 @@ describe provider_class do end end + describe "when the vdev is a single mirror on solaris 10u9 or later" do + it "should call create_multi_array with mirror" do + @zpool_data = ["mirrorpool", "mirror-0", "disk1", "disk2"] + @provider.process_zpool_data(@zpool_data)[:mirror].should == ["disk1 disk2"] + end + end + describe "when the vdev is a double mirror" do it "should call create_multi_array with mirror" do @zpool_data = ["mirrorpool", "mirror", "disk1", "disk2", "mirror", "disk3", "disk4"] @@ -83,6 +90,13 @@ describe provider_class do end end + describe "when the vdev is a double mirror on solaris 10u9 or later" do + it "should call create_multi_array with mirror" do + @zpool_data = ["mirrorpool", "mirror-0", "disk1", "disk2", "mirror-1", "disk3", "disk4"] + @provider.process_zpool_data(@zpool_data)[:mirror].should == ["disk1 disk2", "disk3 disk4"] + end + end + describe "when the vdev is a raidz1" do it "should call create_multi_array with raidz1" do @zpool_data = ["mirrorpool", "raidz1", "disk1", "disk2"] @@ -90,6 +104,13 @@ describe provider_class do end end + describe "when the vdev is a raidz1 on solaris 10u9 or later" do + it "should call create_multi_array with raidz1" do + @zpool_data = ["mirrorpool", "raidz1-0", "disk1", "disk2"] + @provider.process_zpool_data(@zpool_data)[:raidz].should == ["disk1 disk2"] + end + end + describe "when the vdev is a raidz2" do it "should call create_multi_array with raidz2 and set the raid_parity" do @zpool_data = ["mirrorpool", "raidz2", "disk1", "disk2"] @@ -98,6 +119,15 @@ describe provider_class do pool[:raid_parity].should == "raidz2" end end + + describe "when the vdev is a raidz2 on solaris 10u9 or later" do + it "should call create_multi_array with raidz2 and set the raid_parity" do + @zpool_data = ["mirrorpool", "raidz2-0", "disk1", "disk2"] + pool = @provider.process_zpool_data(@zpool_data) + pool[:raidz].should == ["disk1 disk2"] + pool[:raid_parity].should == "raidz2" + end + end end describe "when calling the getters and setters" do diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb index 1acb5badd..9d9042386 100644 --- a/spec/unit/reports/store_spec.rb +++ b/spec/unit/reports/store_spec.rb @@ -11,7 +11,7 @@ describe processor do describe "#process" do include PuppetSpec::Files before :each do - Puppet[:reportdir] = tmpdir('reports') + Puppet[:reportdir] = tmpdir('reports') << '/reports' @report = YAML.load_file(File.join(PuppetSpec::FIXTURE_DIR, 'yaml/report2.6.x.yaml')).extend processor end diff --git a/spec/unit/reports/tagmail_spec.rb b/spec/unit/reports/tagmail_spec.rb index 1dadfc7cd..fa8990ebb 100755 --- a/spec/unit/reports/tagmail_spec.rb +++ b/spec/unit/reports/tagmail_spec.rb @@ -3,26 +3,23 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") } require 'puppet/reports' -require 'puppettest/support/utils' tagmail = Puppet::Reports.report(:tagmail) describe tagmail do - extend PuppetTest::Support::Utils - before do @processor = Puppet::Transaction::Report.new("apply") @processor.extend(Puppet::Reports.report(:tagmail)) end - passers = File.join(datadir, "reports", "tagmail_passers.conf") + passers = my_fixture "tagmail_passers.conf" File.readlines(passers).each do |line| it "should be able to parse '#{line.inspect}'" do @processor.parse(line) end end - failers = File.join(datadir, "reports", "tagmail_failers.conf") + failers = my_fixture "tagmail_failers.conf" File.readlines(failers).each do |line| it "should not be able to parse '#{line.inspect}'" do lambda { @processor.parse(line) }.should raise_error(ArgumentError) diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb index 8b7bfc3e6..916741d1a 100755 --- a/spec/unit/resource_spec.rb +++ b/spec/unit/resource_spec.rb @@ -99,11 +99,11 @@ describe Puppet::Resource do end it 'should fail if strict is set and type does not exist' do - lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo') + lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo') end it 'should fail if strict is set and class does not exist' do - lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo') + lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo') end it "should fail if the title is a hash and the type is not a valid resource reference string" do @@ -463,6 +463,28 @@ describe Puppet::Resource do end end + describe "when loading 0.25.x storedconfigs YAML" do + before :each do + @old_storedconfig_yaml = %q{--- !ruby/object:Puppet::Resource::Reference +builtin_type: +title: /tmp/bar +type: File +} + end + + it "should deserialize a Puppet::Resource::Reference without exceptions" do + lambda { YAML.load(@old_storedconfig_yaml) }.should_not raise_error + end + + it "should deserialize as a Puppet::Resource::Reference as a Puppet::Resource" do + YAML.load(@old_storedconfig_yaml).class.should == Puppet::Resource + end + + it "should to_hash properly" do + YAML.load(@old_storedconfig_yaml).to_hash.should == { :path => "/tmp/bar" } + end + end + describe "when converting to a RAL resource" do it "should use the resource type's :new method to create the resource if the resource is of a builtin type" do resource = Puppet::Resource.new("file", @basepath+"/my/file") @@ -486,19 +508,23 @@ describe Puppet::Resource do describe "when converting to puppet code" do before do - @resource = Puppet::Resource.new("one::two", "/my/file", :parameters => {:noop => true, :foo => %w{one two}}) - end - - it "should print the type and title" do - @resource.to_manifest.should be_include("one::two { '/my/file':\n") - end - - it "should print each parameter, with the value single-quoted" do - @resource.to_manifest.should be_include(" noop => 'true'") + @resource = Puppet::Resource.new("one::two", "/my/file", + :parameters => { + :noop => true, + :foo => %w{one two}, + :ensure => 'present', + } + ) end - it "should print array values appropriately" do - @resource.to_manifest.should be_include(" foo => ['one','two']") + it "should align, sort and add trailing commas to attributes with ensure first" do + @resource.to_manifest.should == <<-HEREDOC.gsub(/^\s{8}/, '').gsub(/\n$/, '') + one::two { '/my/file': + ensure => 'present', + foo => ['one', 'two'], + noop => 'true', + } + HEREDOC end end diff --git a/spec/unit/simple_graph_spec.rb b/spec/unit/simple_graph_spec.rb index e49811ea7..c106f550b 100755 --- a/spec/unit/simple_graph_spec.rb +++ b/spec/unit/simple_graph_spec.rb @@ -303,6 +303,109 @@ describe Puppet::SimpleGraph do proc { @graph.topsort }.should_not raise_error end + it "should produce the correct relationship text" do + add_edges :a => :b, :b => :a + # cycle detection starts from a or b randomly + # so we need to check for either ordering in the error message + want = %r{Found 1 dependency cycle:\n\((a => b => a|b => a => b)\)\nTry} + expect { @graph.topsort }.to raise_error(Puppet::Error, want) + end + + it "cycle discovery should be the minimum cycle for a simple graph" do + add_edges "a" => "b" + add_edges "b" => "a" + add_edges "b" => "c" + + cycles = nil + expect { cycles = @graph.find_cycles_in_graph.sort }.should_not raise_error + cycles.should be == [["a", "b"]] + end + + it "cycle discovery should handle two distinct cycles" do + add_edges "a" => "a1", "a1" => "a" + add_edges "b" => "b1", "b1" => "b" + + cycles = nil + expect { cycles = @graph.find_cycles_in_graph.sort }.should_not raise_error + cycles.should be == [["a", "a1"], ["b", "b1"]] + end + + it "cycle discovery should handle two cycles in a connected graph" do + add_edges "a" => "b", "b" => "c", "c" => "d" + add_edges "a" => "a1", "a1" => "a" + add_edges "c" => "c1", "c1" => "c2", "c2" => "c3", "c3" => "c" + + cycles = nil + expect { cycles = @graph.find_cycles_in_graph.sort }.should_not raise_error + cycles.should be == [%w{a a1}, %w{c c1 c2 c3}] + end + + it "cycle discovery should handle a complicated cycle" do + add_edges "a" => "b", "b" => "c" + add_edges "a" => "c" + add_edges "c" => "c1", "c1" => "a" + add_edges "c" => "c2", "c2" => "b" + + cycles = nil + expect { cycles = @graph.find_cycles_in_graph.sort }.should_not raise_error + cycles.should be == [%w{a b c c1 c2}] + end + + it "cycle discovery should not fail with large data sets" do + limit = 3000 + (1..(limit - 1)).each do |n| add_edges n.to_s => (n+1).to_s end + + cycles = nil + expect { cycles = @graph.find_cycles_in_graph.sort }.should_not raise_error + cycles.should be == [] + end + + it "path finding should work with a simple cycle" do + add_edges "a" => "b", "b" => "c", "c" => "a" + + cycles = @graph.find_cycles_in_graph.sort + paths = @graph.paths_in_cycle(cycles.first, 100) + paths.should be == [%w{a b c a}] + end + + it "path finding should work with two independent cycles" do + add_edges "a" => "b1" + add_edges "a" => "b2" + add_edges "b1" => "a", "b2" => "a" + + cycles = @graph.find_cycles_in_graph.sort + cycles.length.should be == 1 + + paths = @graph.paths_in_cycle(cycles.first, 100) + paths.sort.should be == [%w{a b1 a}, %w{a b2 a}] + end + + it "path finding should prefer shorter paths in cycles" do + add_edges "a" => "b", "b" => "c", "c" => "a" + add_edges "b" => "a" + + cycles = @graph.find_cycles_in_graph.sort + cycles.length.should be == 1 + + paths = @graph.paths_in_cycle(cycles.first, 100) + paths.should be == [%w{a b a}, %w{a b c a}] + end + + it "path finding should respect the max_path value" do + (1..20).each do |n| add_edges "a" => "b#{n}", "b#{n}" => "a" end + + cycles = @graph.find_cycles_in_graph.sort + cycles.length.should be == 1 + + (1..20).each do |n| + paths = @graph.paths_in_cycle(cycles.first, n) + paths.length.should be == n + end + + paths = @graph.paths_in_cycle(cycles.first, 21) + paths.length.should be == 20 + end + # Our graph's add_edge method is smart enough not to add # duplicate edges, so we use the objects, which it doesn't # check. diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb index 9178c94bf..bd2b2adaf 100755 --- a/spec/unit/type/file/content_spec.rb +++ b/spec/unit/type/file/content_spec.rb @@ -4,15 +4,14 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f content = Puppet::Type.type(:file).attrclass(:content) describe content do + include PuppetSpec::Files before do - @resource = Puppet::Type.type(:file).new :path => "/foo/bar" + @filename = tmpfile('testfile') + @resource = Puppet::Type.type(:file).new :path => @filename + File.open(@filename, 'w') {|f| f.write "initial file content"} content.stubs(:standalone?).returns(false) end - it "should be a subclass of Property" do - content.superclass.must == Puppet::Property - end - describe "when determining the checksum type" do it "should use the type specified in the source checksum if a source is set" do @resource[:source] = "/foo" @@ -249,10 +248,10 @@ describe content do describe "when writing" do before do @content = content.new(:resource => @resource) - @fh = stub_everything end it "should attempt to read from the filebucket if no actual content nor source exists" do + @fh = File.open(@filename, 'w') @content.should = "{md5}foo" @content.resource.bucket.class.any_instance.stubs(:getfile).returns "foo" @content.write(@fh) @@ -302,166 +301,68 @@ describe content do describe "from local source" do before(:each) do - @content.stubs(:actual_content).returns(nil) - @source = stub_everything 'source', :local? => true, :full_path => "/path/to/source" - @resource.stubs(:parameter).with(:source).returns @source - - @sum = stub_everything 'sum' - @resource.stubs(:parameter).with(:checksum).returns(@sum) - - @digest = stub_everything 'digest' - @sum.stubs(:sum_stream).yields(@digest) - - @file = stub_everything 'file' - File.stubs(:open).yields(@file) - @file.stubs(:read).with(8192).returns("chunk1").then.returns("chunk2").then.returns(nil) - end - - it "should open the local file" do - File.expects(:open).with("/path/to/source", "r") - @content.write(@fh) - end - - it "should read the local file by chunks" do - @file.expects(:read).with(8192).returns("chunk1").then.returns(nil) - @content.write(@fh) - end + @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false + @sourcename = tmpfile('source') + @source_content = "source file content"*10000 + @sourcefile = File.open(@sourcename, 'w') {|f| f.write @source_content} - it "should write each chunk to the file" do - @fh.expects(:print).with("chunk1").then.with("chunk2") - @content.write(@fh) + @content = @resource.newattr(:content) + @source = @resource.newattr(:source) + @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file') end - it "should pass each chunk to the current sum stream" do - @digest.expects(:<<).with("chunk1").then.with("chunk2") - @content.write(@fh) + it "should copy content from the source to the file" do + @resource.write(@source) + File.read(@filename).should == @source_content end it "should return the checksum computed" do - @sum.stubs(:sum_stream).yields(@digest).returns("checksum") - @content.write(@fh).should == "checksum" + File.open(@filename, 'w') do |file| + @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}" + end end end describe "from remote source" do before(:each) do - @response = stub_everything 'mock response', :code => "404" + @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false + @response = stub_everything 'response', :code => "200" + @source_content = "source file content"*10000 + @response.stubs(:read_body).multiple_yields(*(["source file content"]*10000)) + @conn = stub_everything 'connection' @conn.stubs(:request_get).yields(@response) Puppet::Network::HttpPool.stubs(:http_instance).returns @conn - @content.stubs(:actual_content).returns(nil) - @source = stub_everything 'source', :local? => false, :full_path => "/path/to/source", :server => "server", :port => 1234 - @resource.stubs(:parameter).with(:source).returns @source - - @sum = stub_everything 'sum' - @resource.stubs(:parameter).with(:checksum).returns(@sum) - - @digest = stub_everything 'digest' - @sum.stubs(:sum_stream).yields(@digest) - end - - it "should open a network connection to source server and port" do - Puppet::Network::HttpPool.expects(:http_instance).with("server", 1234).returns @conn - @content.write(@fh) + @content = @resource.newattr(:content) + @sourcename = "puppet:///test/foo" + @source = @resource.newattr(:source) + @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file') end - it "should send the correct indirection uri" do - @conn.expects(:request_get).with { |uri,headers| uri == "/production/file_content/path/to/source" }.yields(@response) - @content.write(@fh) - end - - it "should return nil if source is not found" do - @response.expects(:code).returns("404") - @content.write(@fh).should == nil + it "should write the contents to the file" do + @resource.write(@source) + File.read(@filename).should == @source_content end it "should not write anything if source is not found" do - @response.expects(:code).returns("404") - @fh.expects(:print).never - @content.write(@fh).should == nil + @response.stubs(:code).returns("404") + lambda {@resource.write(@source)}.should raise_error(Net::HTTPError) { |e| e.message =~ /404/ } + File.read(@filename).should == "initial file content" end it "should raise an HTTP error in case of server error" do - @response.expects(:code).returns("500") - lambda { @content.write(@fh) }.should raise_error - end - - it "should write content by chunks" do - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - @fh.expects(:print).with("chunk1").then.with("chunk2") - @content.write(@fh) - end - - it "should pass each chunk to the current sum stream" do - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - @digest.expects(:<<).with("chunk1").then.with("chunk2") - @content.write(@fh) + @response.stubs(:code).returns("500") + lambda { @content.write(@fh) }.should raise_error { |e| e.message.include? @source_content } end it "should return the checksum computed" do - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - @sum.expects(:sum_stream).yields(@digest).returns("checksum") - @content.write(@fh).should == "checksum" - end - - it "should get the current accept encoding header value" do - @content.expects(:add_accept_encoding) - @content.write(@fh) - end - - it "should uncompress body on error" do - @response.expects(:code).returns("500") - @response.expects(:body).returns("compressed body") - @content.expects(:uncompress_body).with(@response).returns("uncompressed") - lambda { @content.write(@fh) }.should raise_error { |e| e.message =~ /uncompressed/ } - end - - it "should uncompress chunk by chunk" do - uncompressor = stub_everything 'uncompressor' - @content.expects(:uncompress).with(@response).yields(uncompressor) - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - - uncompressor.expects(:uncompress).with("chunk1").then.with("chunk2") - @content.write(@fh) - end - - it "should write uncompressed chunks to the file" do - uncompressor = stub_everything 'uncompressor' - @content.expects(:uncompress).with(@response).yields(uncompressor) - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - - uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1") - uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2") - - @fh.expects(:print).with("uncompressed1") - @fh.expects(:print).with("uncompressed2") - - @content.write(@fh) - end - - it "should pass each uncompressed chunk to the current sum stream" do - uncompressor = stub_everything 'uncompressor' - @content.expects(:uncompress).with(@response).yields(uncompressor) - @response.expects(:code).returns("200") - @response.expects(:read_body).multiple_yields("chunk1","chunk2") - - uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1") - uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2") - - @digest.expects(:<<).with("uncompressed1").then.with("uncompressed2") - @content.write(@fh) + File.open(@filename, 'w') do |file| + @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}" + end end end - describe "from a filebucket" do - end - # These are testing the implementation rather than the desired behaviour; while that bites, there are a whole # pile of other methods in the File type that depend on intimate details of this implementation and vice-versa. # If these blow up, you are gonna have to review the callers to make sure they don't explode! --daniel 2011-02-01 @@ -474,17 +375,38 @@ describe content do @content.each_chunk_from('i_am_a_string') { |chunk| chunk.should == 'i_am_a_string' } end + # The following manifest is a case where source and content.should are both set + # file { "/tmp/mydir" : + # source => '/tmp/sourcedir', + # recurse => true, + # } + it "when content checksum comes from source" do + source_param = Puppet::Type.type(:file).attrclass(:source) + source = source_param.new(:resource => @resource) + @content.should = "{md5}123abcd" + + @content.expects(:chunk_file_from_source).returns('from_source') + @content.each_chunk_from(source) { |chunk| chunk.should == 'from_source' } + end + it "when no content, source, but ensure present" do @resource[:ensure] = :present @content.each_chunk_from(nil) { |chunk| chunk.should == '' } end + # you might do this if you were just auditing it "when no content, source, but ensure file" do @resource[:ensure] = :file @content.each_chunk_from(nil) { |chunk| chunk.should == '' } end - it "when no content or source" do + it "when source_or_content is nil and content not a checksum" do + @content.each_chunk_from(nil) { |chunk| chunk.should == '' } + end + + # the content is munged so that if it's a checksum nil gets passed in + it "when content is a checksum it should try to read from filebucket" do + @content.should = "{md5}123abcd" @content.expects(:read_file_from_filebucket).once.returns('im_a_filebucket') @content.each_chunk_from(nil) { |chunk| chunk.should == 'im_a_filebucket' } end diff --git a/spec/unit/type/file/selinux_spec.rb b/spec/unit/type/file/selinux_spec.rb index 043471dec..a2444acd9 100644 --- a/spec/unit/type/file/selinux_spec.rb +++ b/spec/unit/type/file/selinux_spec.rb @@ -66,6 +66,11 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f @sel.default.must == expectedresult end + it "should return nil for defaults if selinux_ignore_defaults is true" do + @resource[:selinux_ignore_defaults] = :true + @sel.default.must be_nil + end + it "should be able to set a new context" do stat = stub 'stat', :ftype => "foo" @sel.should = %w{newone} diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb index 539782fd4..b15d41d4b 100755 --- a/spec/unit/type/file_spec.rb +++ b/spec/unit/type/file_spec.rb @@ -379,8 +379,6 @@ describe Puppet::Type.type(:file) do end describe "when managing links" do - require 'puppettest/support/assertions' - include PuppetTest require 'tempfile' if @real_posix @@ -394,13 +392,7 @@ describe Puppet::Type.type(:file) do File.open(@file, "w", 0644) { |f| f.puts "yayness"; f.flush } File.symlink(@file, @link) - - @resource = Puppet::Type.type(:file).new( - - :path => @link, - - :mode => "755" - ) + @resource = Puppet::Type.type(:file).new(:path => @link, :mode => "755") @catalog.add_resource @resource end diff --git a/spec/unit/type/mount_spec.rb b/spec/unit/type/mount_spec.rb index 3df8de903..4638e9a2e 100755 --- a/spec/unit/type/mount_spec.rb +++ b/spec/unit/type/mount_spec.rb @@ -11,10 +11,14 @@ describe Puppet::Type.type(:mount) do mount = Puppet::Type.type(:mount).new(:name => "yay") mount.should(:ensure).should be_nil end + + it "should have :name as the only keyattribut" do + Puppet::Type.type(:mount).key_attributes.should == [:name] + end end describe Puppet::Type.type(:mount), "when validating attributes" do - [:name, :remounts].each do |param| + [:name, :remounts, :provider].each do |param| it "should have a #{param} parameter" do Puppet::Type.type(:mount).attrtype(param).should == :param end @@ -38,9 +42,16 @@ describe Puppet::Type.type(:mount)::Ensure, "when validating values" do mount.should(:ensure).should == :defined end + it "should support :present as a value to :ensure" do + Puppet::Type.type(:mount).new(:name => "yay", :ensure => :present) + end + + it "should support :defined as a value to :ensure" do + Puppet::Type.type(:mount).new(:name => "yay", :ensure => :defined) + end + it "should support :unmounted as a value to :ensure" do - mount = Puppet::Type.type(:mount).new(:name => "yay", :ensure => :unmounted) - mount.should(:ensure).should == :unmounted + Puppet::Type.type(:mount).new(:name => "yay", :ensure => :unmounted) end it "should support :absent as a value to :ensure" do @@ -54,7 +65,8 @@ end describe Puppet::Type.type(:mount)::Ensure do before :each do - @provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock + provider_properties = {} + @provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock, :property_hash => provider_properties Puppet::Type.type(:mount).defaultprovider.stubs(:new).returns(@provider) @mount = Puppet::Type.type(:mount).new(:name => "yay", :check => :ensure) @@ -74,178 +86,196 @@ describe Puppet::Type.type(:mount)::Ensure do end end - describe Puppet::Type.type(:mount)::Ensure, "when retrieving its current state" do - - it "should return the provider's value if it is :absent" do - @provider.expects(:ensure).returns(:absent) - @ensure.retrieve.should == :absent - end - - it "should return :mounted if the provider indicates it is mounted and the value is not :absent" do - @provider.expects(:ensure).returns(:present) - @provider.expects(:mounted?).returns(true) - @ensure.retrieve.should == :mounted - end - - it "should return :unmounted if the provider indicates it is not mounted and the value is not :absent" do - @provider.expects(:ensure).returns(:present) - @provider.expects(:mounted?).returns(false) - @ensure.retrieve.should == :unmounted - end - end - describe Puppet::Type.type(:mount)::Ensure, "when changing the host" do - it "should destroy itself if it should be absent" do - @provider.stubs(:mounted?).returns(false) - @provider.expects(:destroy) - @ensure.should = :absent - @ensure.sync - end - - it "should unmount itself before destroying if it is mounted and should be absent" do - @provider.expects(:mounted?).returns(true) - @provider.expects(:unmount) - @provider.expects(:destroy) - @ensure.should = :absent - @ensure.sync - end - - it "should create itself if it is absent and should be defined" do - @provider.stubs(:ensure).returns(:absent) - @provider.stubs(:mounted?).returns(true) - - @provider.stubs(:mounted?).returns(false) - @provider.expects(:create) - @ensure.should = :defined - @ensure.sync - end - - it "should not unmount itself if it is mounted and should be defined" do - @provider.stubs(:ensure).returns(:mounted) - @provider.stubs(:mounted?).returns(true) - - @provider.stubs(:create) + def test_ensure_change(options) + @provider.stubs(:get).with(:ensure).returns options[:from] + @provider.stubs(:ensure).returns options[:from] + @provider.stubs(:mounted?).returns([:mounted,:ghost].include? options[:from]) + @provider.expects(:create).times(options[:create] || 0) + @provider.expects(:destroy).times(options[:destroy] || 0) @provider.expects(:mount).never - @provider.expects(:unmount).never - @ensure.should = :defined - @ensure.sync - end - - it "should not mount itself if it is unmounted and should be defined" do - @provider.stubs(:ensure).returns(:unmounted) - @provider.stubs(:mounted?).returns(false) - - @ensure.stubs(:syncothers) - @provider.stubs(:create) - @provider.expects(:mount).never - @provider.expects(:unmount).never - @ensure.should = :present - @ensure.sync - end - - it "should unmount itself if it is mounted and should be unmounted" do - @provider.stubs(:ensure).returns(:present) - @provider.stubs(:mounted?).returns(true) - + @provider.expects(:unmount).times(options[:unmount] || 0) @ensure.stubs(:syncothers) - @provider.expects(:unmount) - @ensure.should = :unmounted + @ensure.should = options[:to] @ensure.sync - end - - it "should create and mount itself if it does not exist and should be mounted" do - @provider.stubs(:ensure).returns(:absent) - @provider.stubs(:mounted?).returns(false) - @provider.expects(:create) - @ensure.stubs(:syncothers) - @provider.expects(:mount) - @ensure.should = :mounted - @ensure.sync - end - - it "should mount itself if it is present and should be mounted" do - @provider.stubs(:ensure).returns(:present) - @provider.stubs(:mounted?).returns(false) - @ensure.stubs(:syncothers) - @provider.expects(:mount) - @ensure.should = :mounted - @ensure.sync - end + (!!@provider.property_hash[:needs_mount]).should == (!!options[:mount]) + end + + it "should create itself when changing from :ghost to :present" do + test_ensure_change(:from => :ghost, :to => :present, :create => 1) + end + + it "should create itself when changing from :absent to :present" do + test_ensure_change(:from => :absent, :to => :present, :create => 1) + end - it "should create but not mount itself if it is absent and mounted and should be mounted" do - @provider.stubs(:ensure).returns(:absent) - @provider.stubs(:mounted?).returns(true) - @ensure.stubs(:syncothers) - @provider.expects(:create) - @ensure.should = :mounted - @ensure.sync - end + it "should create itself and unmount when changing from :ghost to :unmounted" do + test_ensure_change(:from => :ghost, :to => :unmounted, :create => 1, :unmount => 1) + end + + it "should unmount resource when changing from :mounted to :unmounted" do + test_ensure_change(:from => :mounted, :to => :unmounted, :unmount => 1) + end + + it "should create itself when changing from :absent to :unmounted" do + test_ensure_change(:from => :absent, :to => :unmounted, :create => 1) + end + + it "should unmount resource when changing from :ghost to :absent" do + test_ensure_change(:from => :ghost, :to => :absent, :unmount => 1) + end + + it "should unmount and destroy itself when changing from :mounted to :absent" do + test_ensure_change(:from => :mounted, :to => :absent, :destroy => 1, :unmount => 1) + end + + it "should destroy itself when changing from :unmounted to :absent" do + test_ensure_change(:from => :unmounted, :to => :absent, :destroy => 1) + end + + it "should create itself when changing from :ghost to :mounted" do + test_ensure_change(:from => :ghost, :to => :mounted, :create => 1) + end + + it "should create itself and mount when changing from :absent to :mounted" do + test_ensure_change(:from => :absent, :to => :mounted, :create => 1, :mount => 1) + end + + it "should mount resource when changing from :unmounted to :mounted" do + test_ensure_change(:from => :unmounted, :to => :mounted, :mount => 1) + end + + + it "should be in sync if it is :absent and should be :absent" do + @ensure.should = :absent + @ensure.safe_insync?(:absent).should == true + end + + it "should be out of sync if it is :absent and should be :defined" do + @ensure.should = :defined + @ensure.safe_insync?(:absent).should == false + end + + it "should be out of sync if it is :absent and should be :mounted" do + @ensure.should = :mounted + @ensure.safe_insync?(:absent).should == false + end + + it "should be out of sync if it is :absent and should be :unmounted" do + @ensure.should = :unmounted + @ensure.safe_insync?(:absent).should == false + end + + it "should be out of sync if it is :mounted and should be :absent" do + @ensure.should = :absent + @ensure.safe_insync?(:mounted).should == false + end + + it "should be in sync if it is :mounted and should be :defined" do + @ensure.should = :defined + @ensure.safe_insync?(:mounted).should == true + end + + it "should be in sync if it is :mounted and should be :mounted" do + @ensure.should = :mounted + @ensure.safe_insync?(:mounted).should == true + end + + it "should be out in sync if it is :mounted and should be :unmounted" do + @ensure.should = :unmounted + @ensure.safe_insync?(:mounted).should == false + end + + + it "should be out of sync if it is :unmounted and should be :absent" do + @ensure.should = :absent + @ensure.safe_insync?(:unmounted).should == false + end + + it "should be in sync if it is :unmounted and should be :defined" do + @ensure.should = :defined + @ensure.safe_insync?(:unmounted).should == true + end + + it "should be out of sync if it is :unmounted and should be :mounted" do + @ensure.should = :mounted + @ensure.safe_insync?(:unmounted).should == false + end + + it "should be in sync if it is :unmounted and should be :unmounted" do + @ensure.should = :unmounted + @ensure.safe_insync?(:unmounted).should == true + end - it "should be insync if it is mounted and should be defined" do - @ensure.should = :defined - @ensure.safe_insync?(:mounted).should == true - end - it "should be insync if it is unmounted and should be defined" do - @ensure.should = :defined - @ensure.safe_insync?(:unmounted).should == true - end + it "should be out of sync if it is :ghost and should be :absent" do + @ensure.should = :absent + @ensure.safe_insync?(:ghost).should == false + end - it "should be insync if it is mounted and should be present" do - @ensure.should = :present - @ensure.safe_insync?(:mounted).should == true - end + it "should be out of sync if it is :ghost and should be :defined" do + @ensure.should = :defined + @ensure.safe_insync?(:ghost).should == false + end + + it "should be out of sync if it is :ghost and should be :mounted" do + @ensure.should = :mounted + @ensure.safe_insync?(:ghost).should == false + end + + it "should be out of sync if it is :ghost and should be :unmounted" do + @ensure.should = :unmounted + @ensure.safe_insync?(:ghost).should == false + end - it "should be insync if it is unmounted and should be present" do - @ensure.should = :present - @ensure.safe_insync?(:unmounted).should == true - end - end + end describe Puppet::Type.type(:mount), "when responding to refresh" do + pending "2.6.x specifies slightly different behavior and the desired behavior needs to be clarified and revisited. See ticket #4904" do - it "should remount if it is supposed to be mounted" do - @mount[:ensure] = "mounted" - @provider.expects(:remount) + it "should remount if it is supposed to be mounted" do + @mount[:ensure] = "mounted" + @provider.expects(:remount) - @mount.refresh - end + @mount.refresh + end - it "should not remount if it is supposed to be present" do - @mount[:ensure] = "present" - @provider.expects(:remount).never + it "should not remount if it is supposed to be present" do + @mount[:ensure] = "present" + @provider.expects(:remount).never - @mount.refresh - end + @mount.refresh + end - it "should not remount if it is supposed to be absent" do - @mount[:ensure] = "absent" - @provider.expects(:remount).never + it "should not remount if it is supposed to be absent" do + @mount[:ensure] = "absent" + @provider.expects(:remount).never - @mount.refresh - end + @mount.refresh + end - it "should not remount if it is supposed to be defined" do - @mount[:ensure] = "defined" - @provider.expects(:remount).never + it "should not remount if it is supposed to be defined" do + @mount[:ensure] = "defined" + @provider.expects(:remount).never - @mount.refresh - end + @mount.refresh + end - it "should not remount if it is supposed to be unmounted" do - @mount[:ensure] = "unmounted" - @provider.expects(:remount).never + it "should not remount if it is supposed to be unmounted" do + @mount[:ensure] = "unmounted" + @provider.expects(:remount).never - @mount.refresh - end + @mount.refresh + end - it "should not remount swap filesystems" do - @mount[:ensure] = "mounted" - @mount[:fstype] = "swap" - @provider.expects(:remount).never + it "should not remount swap filesystems" do + @mount[:ensure] = "mounted" + @mount[:fstype] = "swap" + @provider.expects(:remount).never - @mount.refresh + @mount.refresh + end end end end @@ -280,4 +310,21 @@ describe Puppet::Type.type(:mount), "when modifying an existing mount entry" do @catalog.apply end + + it "should umount before flushing changes to disk" do + syncorder = sequence('syncorder') + @mount.provider.expects(:options).returns 'soft' + @mount.provider.expects(:ensure).returns :mounted + + @mount.provider.expects(:unmount).in_sequence(syncorder) + @mount.provider.expects(:options=).in_sequence(syncorder).with 'hard' + @mount.expects(:flush).in_sequence(syncorder) # Call inside syncothers + @mount.expects(:flush).in_sequence(syncorder) # I guess transaction or anything calls flush again + + @mount[:ensure] = :unmounted + @mount[:options] = 'hard' + + @catalog.apply + end + end diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb index 117c90f1c..6421e6049 100755 --- a/spec/unit/type/user_spec.rb +++ b/spec/unit/type/user_spec.rb @@ -43,6 +43,10 @@ describe user do user.provider_feature(:manages_password_age).should_not be_nil end + it "should have a system_users feature" do + user.provider_feature(:system_users).should_not be_nil + end + describe "instances" do it "should have a valid provider" do user.new(:name => "foo").provider.class.ancestors.should be_include(Puppet::Provider) diff --git a/spec/unit/type/zone_spec.rb b/spec/unit/type/zone_spec.rb index 726ccc28d..a3e748bde 100755 --- a/spec/unit/type/zone_spec.rb +++ b/spec/unit/type/zone_spec.rb @@ -57,4 +57,24 @@ describe zone do zone.new(:name => "dummy", :path => "/dummy", :ip => "if", :iptype => :exclusive) end + it "should auto-require :dataset entries" do + fs = 'random-pool/some-zfs' + + # ick + provider = stub 'zfs::provider' + provider.stubs(:name).returns(:solaris) + Puppet::Type.type(:zfs).stubs(:defaultprovider).returns(provider) + + catalog = Puppet::Resource::Catalog.new + zfs_instance = Puppet::Type.type(:zfs).new(:name => fs) + catalog.add_resource zfs_instance + + zone_instance = zone.new(:name => "dummy", + :path => "/foo", + :ip => 'en1:1.0.0.0', + :dataset => fs) + catalog.add_resource zone_instance + + catalog.relationship_graph.dependencies(zone_instance).should == [zfs_instance] + end end diff --git a/spec/unit/type_spec.rb b/spec/unit/type_spec.rb index d1143d92e..f9372fced 100755 --- a/spec/unit/type_spec.rb +++ b/spec/unit/type_spec.rb @@ -434,7 +434,7 @@ describe Puppet::Type do patterns.length.should == 1 patterns[0].length.should == 2 end - + it "should have a regexp that captures the entire string" do patterns = @type_class.title_patterns string = "abc\n\tdef" @@ -570,4 +570,15 @@ describe Puppet::Type.metaparamclass(:audit) do @resource[:audit] = :noop @resource.parameter(:noop).should be_nil end + + describe "when generating the uniqueness key" do + it "should include all of the key_attributes in alphabetical order by attribute name" do + Puppet::Type.type(:file).stubs(:key_attributes).returns [:path, :mode, :owner] + Puppet::Type.type(:file).stubs(:title_patterns).returns( + [ [ /(.*)/, [ [:path, lambda{|x| x} ] ] ] ] + ) + res = Puppet::Type.type(:file).new( :title => '/my/file', :path => '/my/file', :owner => 'root', :content => 'hello' ) + res.uniqueness_key.should == [ nil, 'root', '/my/file'] + end + end end diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb index 7ba965249..98ddb92f6 100644..100755 --- a/spec/unit/util/command_line_spec.rb +++ b/spec/unit/util/command_line_spec.rb @@ -6,6 +6,7 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f require 'puppet/util/command_line' describe Puppet::Util::CommandLine do + include PuppetSpec::Files before do @tty = stub("tty", :tty? => true ) @pipe = stub("pipe", :tty? => false) @@ -105,4 +106,32 @@ describe Puppet::Util::CommandLine do end end end + describe 'when loading commands' do + before do + @core_apps = %w{describe filebucket kick queue resource agent cert apply doc master} + @command_line = Puppet::Util::CommandLine.new("foo", %w{ client --help whatever.pp }, @tty ) + end + it 'should be able to find all existing commands' do + @core_apps.each do |command| + @command_line.available_subcommands.should include command + end + end + describe 'when multiple paths have applications' do + before do + @dir=tmpdir('command_line_plugin_test') + @appdir="#{@dir}/puppet/application" + FileUtils.mkdir_p(@appdir) + FileUtils.touch("#{@appdir}/foo.rb") + $LOAD_PATH.unshift(@dir) # WARNING: MUST MATCH THE AFTER ACTIONS! + end + it 'should be able to find commands from both paths' do + found = @command_line.available_subcommands + found.should include 'foo' + @core_apps.each { |cmd| found.should include cmd } + end + after do + $LOAD_PATH.shift # WARNING: MUST MATCH THE BEFORE ACTIONS! + end + end + end end diff --git a/spec/unit/util/execution_spec.rb b/spec/unit/util/execution_spec.rb new file mode 100644 index 000000000..312dd3b8e --- /dev/null +++ b/spec/unit/util/execution_spec.rb @@ -0,0 +1,49 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../spec_helper' + +describe Puppet::Util::Execution do + include Puppet::Util::Execution + describe "#withenv" do + before :each do + @original_path = ENV["PATH"] + @new_env = {:PATH => "/some/bogus/path"} + end + + it "should change environment variables within the block then reset environment variables to their original values" do + withenv @new_env do + ENV["PATH"].should == "/some/bogus/path" + end + ENV["PATH"].should == @original_path + end + + it "should reset environment variables to their original values even if the block fails" do + begin + withenv @new_env do + ENV["PATH"].should == "/some/bogus/path" + raise "This is a failure" + end + rescue + end + ENV["PATH"].should == @original_path + end + + it "should reset environment variables even when they are set twice" do + # Setting Path & Environment parameters in Exec type can cause weirdness + @new_env["PATH"] = "/someother/bogus/path" + withenv @new_env do + # When assigning duplicate keys, can't guarantee order of evaluation + ENV["PATH"].should =~ /\/some.*\/bogus\/path/ + end + ENV["PATH"].should == @original_path + end + + it "should remove any new environment variables after the block ends" do + @new_env[:FOO] = "bar" + withenv @new_env do + ENV["FOO"].should == "bar" + end + ENV["FOO"].should == nil + end + end +end diff --git a/spec/unit/util/execution_stub_spec.rb b/spec/unit/util/execution_stub_spec.rb new file mode 100644 index 000000000..14cf9c67a --- /dev/null +++ b/spec/unit/util/execution_stub_spec.rb @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../spec_helper' + +describe Puppet::Util::ExecutionStub do + it "should use the provided stub code when 'set' is called" do + Puppet::Util::ExecutionStub.set do |command, options| + command.should == ['/bin/foo', 'bar'] + "stub output" + end + Puppet::Util::ExecutionStub.current_value.should_not == nil + Puppet::Util.execute(['/bin/foo', 'bar']).should == "stub output" + end + + it "should automatically restore normal execution at the conclusion of each spec test" do + # Note: this test relies on the previous test creating a stub. + Puppet::Util::ExecutionStub.current_value.should == nil + end + + it "should restore normal execution after 'reset' is called" do + true_command = Puppet::Util.which('true') # Note: "true" exists at different paths in different OSes + stub_call_count = 0 + Puppet::Util::ExecutionStub.set do |command, options| + command.should == [true_command] + stub_call_count += 1 + 'stub called' + end + Puppet::Util.execute([true_command]).should == 'stub called' + stub_call_count.should == 1 + Puppet::Util::ExecutionStub.reset + Puppet::Util::ExecutionStub.current_value.should == nil + Puppet::Util.execute([true_command]).should == '' + stub_call_count.should == 1 + end +end diff --git a/spec/unit/util/log/destinations_spec.rb b/spec/unit/util/log/destinations_spec.rb index 468702fb3..b84c2ab44 100755 --- a/spec/unit/util/log/destinations_spec.rb +++ b/spec/unit/util/log/destinations_spec.rb @@ -22,3 +22,16 @@ describe Puppet::Util::Log.desttypes[:report] do dest.handle "my log" end end + + +describe Puppet::Util::Log.desttypes[:file] do + before do + File.stubs(:open) # prevent actually creating the file + @class = Puppet::Util::Log.desttypes[:file] + end + + it "should default to autoflush false" do + @class.new('/tmp/log').autoflush.should == false + end +end + diff --git a/spec/unit/util/log_spec.rb b/spec/unit/util/log_spec.rb index a6f11739b..29df0787a 100755 --- a/spec/unit/util/log_spec.rb +++ b/spec/unit/util/log_spec.rb @@ -136,6 +136,11 @@ describe Puppet::Util::Log do Puppet::Util::Log.new(:level => "notice", :message => :foo) end + it "should update Log autoflush when Puppet[:autoflush] is set" do + Puppet::Util::Log.expects(:autoflush=).once.with(true) + Puppet[:autoflush] = true + end + it "should have a method for determining if a tag is present" do Puppet::Util::Log.new(:level => "notice", :message => :foo).should respond_to(:tagged?) end diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb index 04713f293..8545def54 100755 --- a/spec/unit/util/rdoc/parser_spec.rb +++ b/spec/unit/util/rdoc/parser_spec.rb @@ -45,6 +45,18 @@ describe RDoc::Parser do @parser.scan.should be_a(RDoc::PuppetTopLevel) end + + it "should scan the top level even if the file has already parsed" do + known_type = stub 'known_types' + env = stub 'env' + Puppet::Node::Environment.stubs(:new).returns(env) + env.stubs(:known_resource_types).returns(known_type) + known_type.expects(:watching_file?).with("module/manifests/init.pp").returns(true) + + @parser.expects(:scan_top_level) + + @parser.scan + end end describe "when scanning top level entities" do @@ -341,7 +353,7 @@ describe RDoc::Parser do describe "when scanning for includes and requires" do def create_stmt(name) - stmt_value = stub "#{name}_value", :value => "myclass" + stmt_value = stub "#{name}_value", :to_s => "myclass" Puppet::Parser::AST::Function.new( :name => name, @@ -359,13 +371,13 @@ describe RDoc::Parser do it "should also scan mono-instruction code" do @class.expects(:add_include).with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" } - @parser.scan_for_include_or_require(@class,create_stmt("include")) + @parser.scan_for_include_or_require(@class, create_stmt("include")) end it "should register recursively includes to the current container" do @code.stubs(:children).returns([ create_stmt("include") ]) - @class.expects(:add_include).with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" } + @class.expects(:add_include)#.with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" } @parser.scan_for_include_or_require(@class, [@code]) end diff --git a/spec/unit/util/rdoc_spec.rb b/spec/unit/util/rdoc_spec.rb index 41d4b9cd0..93c4f9bfa 100755 --- a/spec/unit/util/rdoc_spec.rb +++ b/spec/unit/util/rdoc_spec.rb @@ -123,63 +123,25 @@ describe Puppet::Util::RDoc do end describe "when outputing documentation" do - before :each do - @node = stub 'node', :file => "file", :line => 1, :doc => "" - @class = stub 'class', :file => "file", :line => 4, :doc => "" - @definition = stub 'definition', :file => "file", :line => 3, :doc => "" - @ast = stub 'ast', :nodes => { :node => @node }, :hostclasses => { :class => @class }, :definitions => { :definition => @definition } - end - - it "should output doc for ast nodes" do - @node.expects(:doc) - - Puppet::Util::RDoc.output("file", @ast) - end - - it "should output doc for ast classes" do - @class.expects(:doc) - - Puppet::Util::RDoc.output("file", @ast) - end - - it "should output doc for ast definitions" do - @definition.expects(:doc) - - Puppet::Util::RDoc.output("file", @ast) - end - - it "should output doc in order of increasing line number" do - byline = sequence('byline') - @node.expects(:doc).in_sequence(byline) - @definition.expects(:doc).in_sequence(byline) - @class.expects(:doc).in_sequence(byline) - - Puppet::Util::RDoc.output("file", @ast) - end - - it "should not output documentation of ast object of another node" do - klass = stub 'otherclass', :file => "otherfile", :line => 12, :doc => "" - @ast.stubs(:hostclasses).returns({ :otherclass => klass }) - - klass.expects(:doc).never - - Puppet::Util::RDoc.output("file", @ast) + it "should output doc for ast classes, nodes and definitions in order of increasing line number" do + byline = sequence('documentation outputs in line order') + Puppet::Util::RDoc.expects(:puts).with("im a class\n").in_sequence(byline) + Puppet::Util::RDoc.expects(:puts).with("im a node\n").in_sequence(byline) + Puppet::Util::RDoc.expects(:puts).with("im a define\n").in_sequence(byline) + # any other output must fail + Puppet::Util::RDoc.manifestdoc([my_fixture('basic.pp')]) end it "should output resource documentation if needed" do - Puppet.settings.stubs(:[]).with(:document_all).returns(true) - [@node,@definition].each do |o| - o.stubs(:code).returns([]) - end - - resource = stub_everything 'resource', :line => 1 - resource.stubs(:is_a?).with(Puppet::Parser::AST::ASTArray).returns(false) - resource.stubs(:is_a?).with(Puppet::Parser::AST::Resource).returns(true) - @class.stubs(:code).returns([resource]) - - resource.expects(:doc) - - Puppet::Util::RDoc.output("file", @ast) + pending "#6634 being fixed" + Puppet.settings[:document_all] = true + byline = sequence('documentation outputs in line order') + Puppet::Util::RDoc.expects(:puts).with("im a class\n").in_sequence(byline) + Puppet::Util::RDoc.expects(:puts).with("im a node\n").in_sequence(byline) + Puppet::Util::RDoc.expects(:puts).with("im a define\n").in_sequence(byline) + Puppet::Util::RDoc.expects(:puts).with("im a resource\n").in_sequence(byline) + # any other output must fail + Puppet::Util::RDoc.manifestdoc([my_fixture('basic.pp')]) end end end diff --git a/spec/unit/util/settings_spec.rb b/spec/unit/util/settings_spec.rb index 732be6a08..2ab31c294 100755 --- a/spec/unit/util/settings_spec.rb +++ b/spec/unit/util/settings_spec.rb @@ -284,7 +284,8 @@ describe Puppet::Util::Settings do @settings = Puppet::Util::Settings.new @settings.setdefaults :section, :config => ["/my/file", "a"], - :one => ["ONE", "a"] + :one => ["ONE", "a"], + :two => ["TWO", "b"] FileTest.stubs(:exist?).returns true Puppet.stubs(:run_mode).returns stub('run_mode', :name => :mymode) end @@ -331,12 +332,20 @@ describe Puppet::Util::Settings do @settings.value(:one, "env").should == "envval" end - it "should interpolate found values using the current environment" do + it 'should use the current environment for $environment' do @settings.setdefaults :main, :myval => ["$environment/foo", "mydocs"] @settings.value(:myval, "myenv").should == "myenv/foo" end + it "should interpolate found values using the current environment" do + text = "[main]\none = mainval\n[myname]\none = nameval\ntwo = $one/two\n" + @settings.stubs(:read_file).returns(text) + @settings.parse + + @settings.value(:two, "myname").should == "nameval/two" + end + it "should return values in a specified environment before values in the main or name sections" do text = "[env]\none = envval\n[main]\none = mainval\n[myname]\none = nameval\n" @settings.stubs(:read_file).returns(text) diff --git a/tasks/rake/git_workflow.rake b/tasks/rake/git_workflow.rake index 4c39f98de..1ba57c1aa 100644 --- a/tasks/rake/git_workflow.rake +++ b/tasks/rake/git_workflow.rake @@ -1,5 +1,5 @@ # This set of tasks helps automate the workflow as described on -# http://reductivelabs.com/trac/puppet/wiki/Development/DevelopmentLifecycle +# http://projects.puppetlabs.com/projects/puppet/wiki/Development_Lifecycle def find_start(start) diff --git a/tasks/rake/manpages.rake b/tasks/rake/manpages.rake new file mode 100644 index 000000000..f7275e4c3 --- /dev/null +++ b/tasks/rake/manpages.rake @@ -0,0 +1,37 @@ +# require 'fileutils' + +desc "Build Puppet manpages" +task :gen_manpages do + + sbins = Dir.glob(%w{sbin/*}) + bins = Dir.glob(%w{bin/*}) + applications = Dir.glob(%w{lib/puppet/application/*}) + # Locate ronn + ronn = %x{which ronn}.chomp + unless File.executable?(ronn) then fail("Ronn does not appear to be installed.") end + + # Create puppet.conf.5 man page + %x{RUBYLIB=./lib:$RUBYLIB bin/puppetdoc --reference configuration > ./man/man5/puppetconf.5.ronn} + %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r ./man/man5/puppetconf.5.ronn} + File.move("./man/man5/puppetconf.5", "./man/man5/puppet.conf.5") + File.unlink("./man/man5/puppetconf.5.ronn") + + # Create LEGACY binary man pages (i.e. delete me for 2.8.0) + binary = bins + sbins + binary.each do |bin| + b = bin.gsub( /^s?bin\//, "") + %x{RUBYLIB=./lib:$RUBYLIB #{bin} --help > ./man/man8/#{b}.8.ronn} + %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r ./man/man8/#{b}.8.ronn} + File.unlink("./man/man8/#{b}.8.ronn") + end + + # Create modern binary man pages + applications.each do |app| + app.gsub!( /^lib\/puppet\/application\/(.*?)\.rb/, '\1') + %x{RUBYLIB=./lib:$RUBYLIB bin/puppet #{app} --help > ./man/man8/puppet-#{app}.8.ronn} + %x{#{ronn} --manual="Puppet manual" --organization="Puppet Labs, LLC" -r ./man/man8/puppet-#{app}.8.ronn} + File.unlink("./man/man8/puppet-#{app}.8.ronn") + end + + +end
\ No newline at end of file diff --git a/test/Rakefile b/test/Rakefile index 47be213d9..7cde050f6 100644 --- a/test/Rakefile +++ b/test/Rakefile @@ -94,5 +94,3 @@ filemap.each do |dir, files| # And alias it with a slash on the end task(dir + "/" => dir) end - -# $Id$ diff --git a/test/data/providers/mount/parsed/aix.mount b/test/data/providers/mount/parsed/aix.mount new file mode 100644 index 000000000..380dbc5ae --- /dev/null +++ b/test/data/providers/mount/parsed/aix.mount @@ -0,0 +1,7 @@ +node mounted mounted over vfs date options +---- ------- ------------ --- ------------ ------------------- + /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8 + /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8 + /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8 +sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8 diff --git a/test/data/providers/mount/parsed/darwin.mount b/test/data/providers/mount/parsed/darwin.mount new file mode 100644 index 000000000..1bdfcf89a --- /dev/null +++ b/test/data/providers/mount/parsed/darwin.mount @@ -0,0 +1,6 @@ +/dev/disk0s2 on / (hfs, local, journaled) +devfs on /dev (devfs, local, nobrowse) +map -hosts on /net (autofs, nosuid, automounted, nobrowse) +map auto_home on /home (autofs, automounted, nobrowse) +/dev/disk0s3 on /usr (hfs, local, journaled) +/dev/fake on /ghost (hfs, local, journaled) diff --git a/test/data/providers/mount/parsed/hpux.mount b/test/data/providers/mount/parsed/hpux.mount new file mode 100644 index 000000000..d414fa47a --- /dev/null +++ b/test/data/providers/mount/parsed/hpux.mount @@ -0,0 +1,17 @@ +/ on rpool/ROOT/opensolaris read/write/setuid/devices/dev=2d90002 on Wed Dec 31 16:00:00 1969 +/devices on /devices read/write/setuid/devices/dev=4a00000 on Thu Feb 17 14:34:02 2011 +/dev on /dev read/write/setuid/devices/dev=4a40000 on Thu Feb 17 14:34:02 2011 +/system/contract on ctfs read/write/setuid/devices/dev=4ac0001 on Thu Feb 17 14:34:02 2011 +/proc on proc read/write/setuid/devices/dev=4b00000 on Thu Feb 17 14:34:02 2011 +/etc/mnttab on mnttab read/write/setuid/devices/dev=4b40001 on Thu Feb 17 14:34:02 2011 +/etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4b80001 on Thu Feb 17 14:34:02 2011 +/system/object on objfs read/write/setuid/devices/dev=4bc0001 on Thu Feb 17 14:34:02 2011 +/etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=4c00001 on Thu Feb 17 14:34:02 2011 +/lib/libc.so.1 on /usr/lib/libc/libc_hwcap1.so.1 read/write/setuid/devices/dev=2d90002 on Thu Feb 17 14:34:14 2011 +/dev/fd on fd read/write/setuid/devices/dev=4d00001 on Thu Feb 17 14:34:18 2011 +/tmp on swap read/write/setuid/devices/xattr/dev=4b80002 on Thu Feb 17 14:34:19 2011 +/var/run on swap read/write/setuid/devices/xattr/dev=4b80003 on Thu Feb 17 14:34:19 2011 +/export on rpool/export read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90006 on Thu Feb 17 14:37:48 2011 +/export/home on rpool/export/home read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90007 on Thu Feb 17 14:37:48 2011 +/rpool on rpool read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011 +/ghost on /dev/fake read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011 diff --git a/test/data/providers/mount/parsed/linux.mount b/test/data/providers/mount/parsed/linux.mount new file mode 100644 index 000000000..75dd71fd4 --- /dev/null +++ b/test/data/providers/mount/parsed/linux.mount @@ -0,0 +1,5 @@ +/dev/root on / type jfs (rw,noatime) +rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) +sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) +/dev/sda9 on /usr/portage type jfs (rw) +/dev/fake on /ghost type jfs (rw) diff --git a/test/data/providers/mount/parsed/solaris.mount b/test/data/providers/mount/parsed/solaris.mount new file mode 100644 index 000000000..26fabc575 --- /dev/null +++ b/test/data/providers/mount/parsed/solaris.mount @@ -0,0 +1,6 @@ +/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200000 on Mon Mar 18 08:48:45 2002 +/proc on /proc read/write/setuid/dev=4300000 on Mon Mar 18 08:48:44 2002 +/etc/mnttab on mnttab read/write/setuid/dev=43c0000 on Mon Mar 18 08:48:44 2002 +/tmp on swap read/write/setuid/xattr/dev=2 on Mon Mar 18 08:48:52 2002 +/export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 +/ghost on /dev/dsk/c0t1d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18 diff --git a/test/data/types/mount/linux.fstab b/test/data/types/mount/linux.fstab index b1debff9c..c94ec7fa8 100644 --- a/test/data/types/mount/linux.fstab +++ b/test/data/types/mount/linux.fstab @@ -9,3 +9,4 @@ proc /proc proc defaults 0 0 /dev/vg00/lv01 /spare ext3 defaults 1 2 sysfs /sys sysfs defaults 0 0 LABEL=SWAP-hda6 swap swap defaults 0 0 +/dev/sda1 /usr xfs noatime 0 0 diff --git a/test/data/types/mount/solaris.fstab b/test/data/types/mount/solaris.fstab index 54afc898c..348b9d50b 100644 --- a/test/data/types/mount/solaris.fstab +++ b/test/data/types/mount/solaris.fstab @@ -9,3 +9,4 @@ fd - /dev/fd fd - no - ctfs - /system/contract ctfs - no - objfs - /system/object objfs - no - #swap - /tmp tmpfs - yes - +/dev/dsk/c0d0s2 /dev/rdsk/c0d0s2 /usr ufs 1 no - diff --git a/test/ral/type/exec.rb b/test/ral/type/exec.rb index 933994b88..829b1a068 100755 --- a/test/ral/type/exec.rb +++ b/test/ral/type/exec.rb @@ -609,49 +609,6 @@ class TestExec < Test::Unit::TestCase } end - def test_envparam - - exec = Puppet::Type.newexec( - - :command => "echo $envtest", - :path => ENV["PATH"], - - :env => "envtest=yayness" - ) - - assert(exec, "Could not make exec") - - output = status = nil - assert_nothing_raised { - output, status = exec.run("echo $envtest") - } - - assert_equal("yayness\n", output) - - # Now check whether we can do multiline settings - assert_nothing_raised do - exec[:env] = "envtest=a list of things -and stuff" - end - - output = status = nil - assert_nothing_raised { - output, status = exec.run('echo "$envtest"') - } - assert_equal("a list of things\nand stuff\n", output) - - # Now test arrays - assert_nothing_raised do - exec[:env] = ["funtest=A", "yaytest=B"] - end - - output = status = nil - assert_nothing_raised { - output, status = exec.run('echo "$funtest" "$yaytest"') - } - assert_equal("A B\n", output) - end - def test_environmentparam exec = Puppet::Type.newexec( |