puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CONTRIBUTING.md +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -37,6 +37,7 @@ vars: var
|
|
37
37
|
;
|
38
38
|
|
39
39
|
var: PARAM VALUE returns { result = {val[0] => val[1]} }
|
40
|
+
| PARAM returns { result = {val[0] => "" } }
|
40
41
|
;
|
41
42
|
|
42
43
|
returns: RETURN
|
@@ -144,6 +145,7 @@ def tokenize_parameter_value
|
|
144
145
|
;
|
145
146
|
|
146
147
|
when (text = @ss.scan(/\n/)) # newline
|
148
|
+
@in_parameter_value = false
|
147
149
|
[:RETURN, text]
|
148
150
|
|
149
151
|
when (text = @ss.scan(/.+$/)) # Value of parameter
|
@@ -8,7 +8,7 @@ require 'racc/parser.rb'
|
|
8
8
|
module Nagios
|
9
9
|
class Parser < Racc::Parser
|
10
10
|
|
11
|
-
module_eval(<<'...end grammar.ry/module_eval...', 'grammar.ry',
|
11
|
+
module_eval(<<'...end grammar.ry/module_eval...', 'grammar.ry', 50)
|
12
12
|
require 'strscan'
|
13
13
|
|
14
14
|
class ::Nagios::Parser::SyntaxError < RuntimeError; end
|
@@ -107,6 +107,7 @@ def tokenize_parameter_value
|
|
107
107
|
;
|
108
108
|
|
109
109
|
when (text = @ss.scan(/\n/)) # newline
|
110
|
+
@in_parameter_value = false
|
110
111
|
[:RETURN, text]
|
111
112
|
|
112
113
|
when (text = @ss.scan(/.+$/)) # Value of parameter
|
@@ -211,33 +212,33 @@ end
|
|
211
212
|
##### State transition tables begin ###
|
212
213
|
|
213
214
|
racc_action_table = [
|
214
|
-
8, 3, 3, 14, 12, 18, 10, 4, 4,
|
215
|
-
14, 12, 6,
|
215
|
+
8, 3, 3, 14, 12, 18, 10, 4, 4, 20,
|
216
|
+
12, 14, 12, 9, 6, 12 ]
|
216
217
|
|
217
218
|
racc_action_check = [
|
218
|
-
5, 0, 5, 13, 9, 13, 8, 0, 5,
|
219
|
-
11, 12, 3,
|
219
|
+
5, 0, 5, 13, 9, 13, 8, 0, 5, 14,
|
220
|
+
14, 11, 12, 6, 3, 20 ]
|
220
221
|
|
221
222
|
racc_action_pointer = [
|
222
|
-
-1, nil, nil,
|
223
|
-
nil,
|
224
|
-
nil ]
|
223
|
+
-1, nil, nil, 11, nil, 0, 8, nil, 6, -4,
|
224
|
+
nil, 7, 4, -1, 2, nil, nil, nil, nil, nil,
|
225
|
+
7, nil ]
|
225
226
|
|
226
227
|
racc_action_default = [
|
227
|
-
-
|
228
|
-
|
229
|
-
-8 ]
|
228
|
+
-12, -1, -3, -12, -4, -12, -12, -2, -12, -12,
|
229
|
+
22, -12, -10, -12, -12, -6, -11, -7, -5, -9,
|
230
|
+
-12, -8 ]
|
230
231
|
|
231
232
|
racc_goto_table = [
|
232
|
-
11, 1, 15, 16, 17,
|
233
|
-
|
233
|
+
11, 1, 15, 16, 17, 19, 7, 13, 5, nil,
|
234
|
+
nil, 21 ]
|
234
235
|
|
235
236
|
racc_goto_check = [
|
236
|
-
4, 2, 6, 4, 6,
|
237
|
-
4 ]
|
237
|
+
4, 2, 6, 4, 6, 4, 2, 5, 1, nil,
|
238
|
+
nil, 4 ]
|
238
239
|
|
239
240
|
racc_goto_pointer = [
|
240
|
-
nil,
|
241
|
+
nil, 8, 1, nil, -9, -4, -9 ]
|
241
242
|
|
242
243
|
racc_goto_default = [
|
243
244
|
nil, nil, nil, 2, nil, nil, nil ]
|
@@ -252,12 +253,13 @@ racc_reduce_table = [
|
|
252
253
|
1, 14, :_reduce_none,
|
253
254
|
2, 14, :_reduce_7,
|
254
255
|
3, 15, :_reduce_8,
|
256
|
+
2, 15, :_reduce_9,
|
255
257
|
1, 13, :_reduce_none,
|
256
258
|
2, 13, :_reduce_none ]
|
257
259
|
|
258
|
-
racc_reduce_n =
|
260
|
+
racc_reduce_n = 12
|
259
261
|
|
260
|
-
racc_shift_n =
|
262
|
+
racc_shift_n = 22
|
261
263
|
|
262
264
|
racc_token_table = {
|
263
265
|
false => 0,
|
@@ -379,10 +381,17 @@ module_eval(<<'.,.,', 'grammar.ry', 38)
|
|
379
381
|
end
|
380
382
|
.,.,
|
381
383
|
|
382
|
-
|
384
|
+
module_eval(<<'.,.,', 'grammar.ry', 39)
|
385
|
+
def _reduce_9(val, _values, result)
|
386
|
+
result = {val[0] => "" }
|
387
|
+
result
|
388
|
+
end
|
389
|
+
.,.,
|
383
390
|
|
384
391
|
# reduce 10 omitted
|
385
392
|
|
393
|
+
# reduce 11 omitted
|
394
|
+
|
386
395
|
def _reduce_none(val, _values, result)
|
387
396
|
val[0]
|
388
397
|
end
|
data/lib/puppet/face/config.rb
CHANGED
@@ -59,12 +59,25 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
59
59
|
|
60
60
|
args = Puppet.settings.to_a.collect(&:first) if args.empty? || args == ['all']
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
values_from_the_selected_section =
|
63
|
+
Puppet.settings.values(nil, options[:section].to_sym)
|
64
|
+
|
65
|
+
loader_settings = {
|
66
|
+
:environmentpath => values_from_the_selected_section.interpolate(:environmentpath),
|
67
|
+
:basemodulepath => values_from_the_selected_section.interpolate(:basemodulepath),
|
68
|
+
}
|
69
|
+
|
70
|
+
Puppet.override(Puppet.base_context(loader_settings),
|
71
|
+
"New environment loaders generated from the requested section.") do
|
72
|
+
# And now we can lookup values that include those from environments configured from
|
73
|
+
# the requested section
|
74
|
+
values = Puppet.settings.values(Puppet[:environment].to_sym, options[:section].to_sym)
|
75
|
+
if args.length == 1
|
76
|
+
puts values.interpolate(args[0].to_sym)
|
77
|
+
else
|
78
|
+
args.each do |setting_name|
|
79
|
+
puts "#{setting_name} = #{values.interpolate(setting_name.to_sym)}"
|
80
|
+
end
|
68
81
|
end
|
69
82
|
end
|
70
83
|
nil
|
@@ -15,27 +15,229 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
15
15
|
Generate a new module in the current directory:
|
16
16
|
|
17
17
|
$ puppet module generate puppetlabs-ssh
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
We need to create a metadata.json file for this module. Please answer the
|
19
|
+
following questions; if the question is not applicable to this module, feel free
|
20
|
+
to leave it blank.
|
21
|
+
|
22
|
+
Puppet uses Semantic Versioning (semver.org) to version modules.
|
23
|
+
What version is this module? [0.1.0]
|
24
|
+
-->
|
25
|
+
|
26
|
+
Who wrote this module? [puppetlabs]
|
27
|
+
-->
|
28
|
+
|
29
|
+
What license does this module code fall under? [Apache 2.0]
|
30
|
+
-->
|
31
|
+
|
32
|
+
How would you describe this module in a single sentence?
|
33
|
+
-->
|
34
|
+
|
35
|
+
Where is this module's source code repository?
|
36
|
+
-->
|
37
|
+
|
38
|
+
Where can others go to learn more about this module?
|
39
|
+
-->
|
40
|
+
|
41
|
+
Where can others go to file issues about this module?
|
42
|
+
-->
|
43
|
+
|
44
|
+
----------------------------------------
|
45
|
+
{
|
46
|
+
"name": "puppetlabs-ssh",
|
47
|
+
"version": "0.1.0",
|
48
|
+
"author": "puppetlabs",
|
49
|
+
"summary": null,
|
50
|
+
"license": "Apache 2.0",
|
51
|
+
"source": "",
|
52
|
+
"project_page": null,
|
53
|
+
"issues_url": null,
|
54
|
+
"dependencies": [
|
55
|
+
{
|
56
|
+
"name": "puppetlabs-stdlib",
|
57
|
+
"version_range": ">= 1.0.0"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
}
|
61
|
+
----------------------------------------
|
62
|
+
|
63
|
+
About to generate this metadata; continue? [n/Y]
|
64
|
+
-->
|
65
|
+
|
66
|
+
Notice: Generating module at /Users/username/Projects/puppet/puppetlabs-ssh...
|
67
|
+
Notice: Populating ERB templates...
|
68
|
+
Finished; module generated in puppetlabs-ssh.
|
22
69
|
puppetlabs-ssh/manifests
|
23
70
|
puppetlabs-ssh/manifests/init.pp
|
71
|
+
puppetlabs-ssh/metadata.json
|
72
|
+
puppetlabs-ssh/README.md
|
24
73
|
puppetlabs-ssh/spec
|
25
74
|
puppetlabs-ssh/spec/spec_helper.rb
|
26
75
|
puppetlabs-ssh/tests
|
27
76
|
puppetlabs-ssh/tests/init.pp
|
28
77
|
EOT
|
29
78
|
|
79
|
+
option "--skip-interview" do
|
80
|
+
summary "Bypass the interactive metadata interview"
|
81
|
+
description <<-EOT
|
82
|
+
Do not attempt to perform a metadata interview. Primarily useful for automatic
|
83
|
+
execution of `puppet module generate`.
|
84
|
+
EOT
|
85
|
+
end
|
86
|
+
|
30
87
|
arguments "<name>"
|
31
88
|
|
32
89
|
when_invoked do |name, options|
|
90
|
+
# Since we only want to interview if it's being rendered to the console
|
91
|
+
# (i.e. when invoked with `puppet module generate`), we can't do any work
|
92
|
+
# here in the when_invoked block. The result of this block is then
|
93
|
+
# passed to each renderer, which will handle it appropriately; by
|
94
|
+
# returning a simple message like this, every renderer will simply output
|
95
|
+
# the string.
|
96
|
+
# Our `when_rendering :console` handler will ignore this value and
|
97
|
+
# actually generate the module.
|
98
|
+
#
|
99
|
+
# All this is necessary because it is not possible at this point in time
|
100
|
+
# to know what the destination of the output is.
|
101
|
+
"This format is not supported by this action."
|
102
|
+
end
|
103
|
+
|
104
|
+
when_rendering :console do |_, name, options|
|
33
105
|
Puppet::ModuleTool.set_option_defaults options
|
34
|
-
|
106
|
+
|
107
|
+
begin
|
108
|
+
# A default dependency for all newly generated modules is being
|
109
|
+
# introduced as a substitute for the comments we used to include in the
|
110
|
+
# Modulefile. While introducing a default dependency is less than
|
111
|
+
# perfectly desirable, the cost is low, and the syntax is obtuse enough
|
112
|
+
# to justify its inclusion.
|
113
|
+
metadata = Puppet::ModuleTool::Metadata.new.update(
|
114
|
+
'name' => name,
|
115
|
+
'version' => '0.1.0',
|
116
|
+
'dependencies' => [
|
117
|
+
{ :name => 'puppetlabs-stdlib', :version_range => '>= 1.0.0' }
|
118
|
+
]
|
119
|
+
)
|
120
|
+
rescue ArgumentError
|
121
|
+
msg = "Could not generate directory #{name.inspect}, you must specify a dash-separated username and module name."
|
122
|
+
raise ArgumentError, msg, $!.backtrace
|
123
|
+
end
|
124
|
+
|
125
|
+
dest = Puppet::ModuleTool::Generate.destination(metadata)
|
126
|
+
result = Puppet::ModuleTool::Generate.generate(metadata, options[:skip_interview])
|
127
|
+
|
128
|
+
path = dest.relative_path_from(Pathname.pwd)
|
129
|
+
puts "Finished; module generated in #{path}."
|
130
|
+
result.join("\n")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
module Puppet::ModuleTool::Generate
|
136
|
+
module_function
|
137
|
+
|
138
|
+
def generate(metadata, skip_interview = false)
|
139
|
+
interview(metadata) unless skip_interview
|
140
|
+
destination = duplicate_skeleton(metadata)
|
141
|
+
all_files = destination.basename + '**/*'
|
142
|
+
|
143
|
+
return Dir[all_files.to_s]
|
144
|
+
end
|
145
|
+
|
146
|
+
def interview(metadata)
|
147
|
+
puts "We need to create a metadata.json file for this module. Please answer the"
|
148
|
+
puts "following questions; if the question is not applicable to this module, feel free"
|
149
|
+
puts "to leave it blank."
|
150
|
+
|
151
|
+
begin
|
152
|
+
puts
|
153
|
+
puts "Puppet uses Semantic Versioning (semver.org) to version modules."
|
154
|
+
puts "What version is this module? [#{metadata.version}]"
|
155
|
+
metadata.update 'version' => user_input(metadata.version)
|
156
|
+
rescue
|
157
|
+
Puppet.err "We're sorry, we could not parse that as a Semantic Version."
|
158
|
+
retry
|
159
|
+
end
|
160
|
+
|
161
|
+
puts
|
162
|
+
puts "Who wrote this module? [#{metadata.author}]"
|
163
|
+
metadata.update 'author' => user_input(metadata.author)
|
164
|
+
|
165
|
+
puts
|
166
|
+
puts "What license does this module code fall under? [#{metadata.license}]"
|
167
|
+
metadata.update 'license' => user_input(metadata.license)
|
168
|
+
|
169
|
+
puts
|
170
|
+
puts "How would you describe this module in a single sentence?"
|
171
|
+
metadata.update 'summary' => user_input(metadata.summary)
|
172
|
+
|
173
|
+
puts
|
174
|
+
puts "Where is this module's source code repository?"
|
175
|
+
metadata.update 'source' => user_input(metadata.source)
|
176
|
+
|
177
|
+
puts
|
178
|
+
puts "Where can others go to learn more about this module?#{ metadata.project_page && " [#{metadata.project_page}]" }"
|
179
|
+
metadata.update 'project_page' => user_input(metadata.project_page)
|
180
|
+
|
181
|
+
puts
|
182
|
+
puts "Where can others go to file issues about this module?#{ metadata.issues_url && " [#{metadata.issues_url}]" }"
|
183
|
+
metadata.update 'issues_url' => user_input(metadata.issues_url)
|
184
|
+
|
185
|
+
puts
|
186
|
+
puts '-' * 40
|
187
|
+
puts metadata.to_json
|
188
|
+
puts '-' * 40
|
189
|
+
puts
|
190
|
+
puts "About to generate this metadata; continue? [n/Y]"
|
191
|
+
|
192
|
+
if user_input('Y') !~ /^y(es)?$/i
|
193
|
+
puts "Aborting..."
|
194
|
+
exit 0
|
35
195
|
end
|
196
|
+
end
|
36
197
|
|
37
|
-
|
38
|
-
|
198
|
+
def user_input(default=nil)
|
199
|
+
print '--> '
|
200
|
+
input = STDIN.gets.chomp.strip
|
201
|
+
input = default if input == ''
|
202
|
+
return input
|
203
|
+
end
|
204
|
+
|
205
|
+
def destination(metadata)
|
206
|
+
return @dest if defined? @dest
|
207
|
+
@dest = Pathname.pwd + metadata.dashed_name
|
208
|
+
raise ArgumentError, "#{@dest} already exists." if @dest.exist?
|
209
|
+
return @dest
|
210
|
+
end
|
211
|
+
|
212
|
+
def duplicate_skeleton(metadata)
|
213
|
+
dest = destination(metadata)
|
214
|
+
|
215
|
+
puts
|
216
|
+
Puppet.notice "Generating module at #{dest}..."
|
217
|
+
FileUtils.cp_r skeleton_path, dest
|
218
|
+
|
219
|
+
populate_erb_templates(metadata, dest)
|
220
|
+
return dest
|
221
|
+
end
|
222
|
+
|
223
|
+
def populate_erb_templates(metadata, destination)
|
224
|
+
Puppet.notice "Populating ERB templates..."
|
225
|
+
|
226
|
+
templates = destination + '**/*.erb'
|
227
|
+
Dir[templates.to_s].each do |erb|
|
228
|
+
path = Pathname.new(erb)
|
229
|
+
content = ERB.new(path.read).result(binding)
|
230
|
+
|
231
|
+
target = path.parent + path.basename('.erb')
|
232
|
+
target.open('w') { |f| f.write(content) }
|
233
|
+
path.unlink
|
39
234
|
end
|
40
235
|
end
|
236
|
+
|
237
|
+
def skeleton_path
|
238
|
+
return @path if defined? @path
|
239
|
+
path = Pathname(Puppet.settings[:module_skeleton_dir])
|
240
|
+
path = Pathname(__FILE__).dirname + '../../module_tool/skeleton/templates/generator' unless path.directory?
|
241
|
+
@path = path
|
242
|
+
end
|
41
243
|
end
|
@@ -10,8 +10,8 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
10
10
|
Installs a module from the Puppet Forge or from a release archive file.
|
11
11
|
|
12
12
|
The specified module will be installed into the directory
|
13
|
-
specified with the `--target-dir` option, which defaults to
|
14
|
-
|
13
|
+
specified with the `--target-dir` option, which defaults to the first
|
14
|
+
directory in the modulepath.
|
15
15
|
EOT
|
16
16
|
|
17
17
|
returns "Pathname object representing the path to the installed module."
|
@@ -21,7 +21,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
21
21
|
|
22
22
|
$ puppet module install puppetlabs-vcsrepo
|
23
23
|
Preparing to install into /etc/puppet/modules ...
|
24
|
-
Downloading from http://
|
24
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
25
25
|
Installing -- do not interrupt ...
|
26
26
|
/etc/puppet/modules
|
27
27
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -30,7 +30,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
30
30
|
|
31
31
|
$ puppet module install puppetlabs-vcsrepo --environment development
|
32
32
|
Preparing to install into /etc/puppet/environments/development/modules ...
|
33
|
-
Downloading from http://
|
33
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
34
34
|
Installing -- do not interrupt ...
|
35
35
|
/etc/puppet/environments/development/modules
|
36
36
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -39,7 +39,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
39
39
|
|
40
40
|
$ puppet module install puppetlabs-vcsrepo -v 0.0.4
|
41
41
|
Preparing to install into /etc/puppet/modules ...
|
42
|
-
Downloading from http://
|
42
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
43
43
|
Installing -- do not interrupt ...
|
44
44
|
/etc/puppet/modules
|
45
45
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -48,7 +48,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
48
48
|
|
49
49
|
$ puppet module install puppetlabs-vcsrepo --target-dir=/usr/share/puppet/modules
|
50
50
|
Preparing to install into /usr/share/puppet/modules ...
|
51
|
-
Downloading from http://
|
51
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
52
52
|
Installing -- do not interrupt ...
|
53
53
|
/usr/share/puppet/modules
|
54
54
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -57,7 +57,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
57
57
|
|
58
58
|
$ puppet module install puppetlabs-vcsrepo --target-dir=/usr/share/puppet/modules --modulepath /etc/puppet/modules
|
59
59
|
Preparing to install into /usr/share/puppet/modules ...
|
60
|
-
Downloading from http://
|
60
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
61
61
|
Installing -- do not interrupt ...
|
62
62
|
/usr/share/puppet/modules
|
63
63
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -66,7 +66,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
66
66
|
|
67
67
|
$ puppet module install puppetlabs-vcsrepo-0.0.4.tar.gz
|
68
68
|
Preparing to install into /etc/puppet/modules ...
|
69
|
-
Downloading from http://
|
69
|
+
Downloading from http://forgeapi.puppetlabs.com ...
|
70
70
|
Installing -- do not interrupt ...
|
71
71
|
/etc/puppet/modules
|
72
72
|
└── puppetlabs-vcsrepo (v0.0.4)
|
@@ -106,7 +106,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
106
106
|
option "--ignore-dependencies" do
|
107
107
|
summary "Do not attempt to install dependencies"
|
108
108
|
description <<-EOT
|
109
|
-
Do not attempt to install dependencies.
|
109
|
+
Do not attempt to install dependencies. (Implied by --force.)
|
110
110
|
EOT
|
111
111
|
end
|
112
112
|
|
@@ -122,20 +122,21 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
122
122
|
Puppet::ModuleTool.set_option_defaults options
|
123
123
|
Puppet.notice "Preparing to install into #{options[:target_dir]} ..."
|
124
124
|
|
125
|
-
forge = Puppet::Forge.new("PMT", self.version)
|
126
125
|
install_dir = Puppet::ModuleTool::InstallDirectory.new(Pathname.new(options[:target_dir]))
|
127
|
-
|
128
|
-
|
129
|
-
installer.run
|
126
|
+
Puppet::ModuleTool::Applications::Installer.run(name, install_dir, options)
|
130
127
|
end
|
131
128
|
|
132
129
|
when_rendering :console do |return_value, name, options|
|
133
|
-
if return_value[:result] == :
|
130
|
+
if return_value[:result] == :noop
|
131
|
+
Puppet.notice "Module #{name} #{return_value[:version]} is already installed."
|
132
|
+
exit 0
|
133
|
+
elsif return_value[:result] == :failure
|
134
134
|
Puppet.err(return_value[:error][:multiline])
|
135
135
|
exit 1
|
136
136
|
else
|
137
|
-
tree = Puppet::ModuleTool.build_tree(return_value[:
|
138
|
-
|
137
|
+
tree = Puppet::ModuleTool.build_tree(return_value[:graph], return_value[:install_dir])
|
138
|
+
|
139
|
+
"#{return_value[:install_dir]}\n" +
|
139
140
|
Puppet::ModuleTool.format_tree(tree)
|
140
141
|
end
|
141
142
|
end
|