puppet 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +5 -7
- data/README.md +1 -1
- data/Rakefile +20 -0
- data/ext/debian/puppet.init +0 -1
- data/ext/debian/puppet.logrotate +14 -5
- data/ext/osx/puppet.plist +2 -4
- data/ext/project_data.yaml +1 -1
- data/ext/redhat/client.init +65 -12
- data/ext/redhat/logrotate +15 -3
- data/ext/redhat/puppet.spec.erb +5 -1
- data/ext/redhat/server.init +1 -1
- data/ext/solaris/smf/puppet +44 -0
- data/ext/solaris/smf/puppet.xml +44 -0
- data/ext/suse/client.init +27 -27
- data/ext/suse/server.init +2 -2
- data/ext/systemd/puppet.service +1 -0
- data/install.rb +21 -39
- data/lib/hiera/puppet_function.rb +5 -5
- data/lib/puppet/agent/locker.rb +11 -2
- data/lib/puppet/agent.rb +4 -4
- data/lib/puppet/application/agent.rb +28 -14
- data/lib/puppet/application/apply.rb +17 -4
- data/lib/puppet/application/cert.rb +16 -0
- data/lib/puppet/application/filebucket.rb +78 -4
- data/lib/puppet/application/lookup.rb +356 -0
- data/lib/puppet/application/master.rb +5 -1
- data/lib/puppet/configurer.rb +9 -5
- data/lib/puppet/context/trusted_information.rb +21 -1
- data/lib/puppet/context.rb +16 -1
- data/lib/puppet/daemon.rb +17 -13
- data/lib/puppet/data_binding.rb +4 -2
- data/lib/puppet/data_providers/data_adapter.rb +7 -68
- data/lib/puppet/data_providers/data_function_support.rb +5 -26
- data/lib/puppet/data_providers/function_env_data_provider.rb +0 -10
- data/lib/puppet/data_providers/function_module_data_provider.rb +0 -22
- data/lib/puppet/data_providers/hiera_config.rb +106 -0
- data/lib/puppet/data_providers/hiera_env_data_provider.rb +18 -0
- data/lib/puppet/data_providers/hiera_interpolate.rb +97 -0
- data/lib/puppet/data_providers/hiera_module_data_provider.rb +23 -0
- data/lib/puppet/data_providers/hiera_support.rb +37 -0
- data/lib/puppet/data_providers/json_data_provider_factory.rb +31 -0
- data/lib/puppet/data_providers/lookup_adapter.rb +200 -0
- data/lib/puppet/data_providers/yaml_data_provider_factory.rb +32 -0
- data/lib/puppet/data_providers.rb +12 -13
- data/lib/puppet/defaults.rb +14 -3
- data/lib/puppet/environments.rb +94 -6
- data/lib/puppet/error.rb +4 -0
- data/lib/puppet/face/module/changes.rb +2 -1
- data/lib/puppet/feature/cfacter.rb +1 -0
- data/lib/puppet/file_bucket/dipper.rb +58 -2
- data/lib/puppet/file_system/windows.rb +3 -1
- data/lib/puppet/functions/assert_type.rb +48 -12
- data/lib/puppet/functions/defined.rb +79 -48
- data/lib/puppet/functions/each.rb +85 -27
- data/lib/puppet/functions/epp.rb +29 -37
- data/lib/puppet/functions/filter.rb +60 -25
- data/lib/puppet/functions/hiera.rb +76 -3
- data/lib/puppet/functions/hiera_array.rb +65 -3
- data/lib/puppet/functions/hiera_hash.rb +74 -2
- data/lib/puppet/functions/hiera_include.rb +77 -4
- data/lib/puppet/functions/inline_epp.rb +44 -71
- data/lib/puppet/functions/lookup.rb +19 -17
- data/lib/puppet/functions/map.rb +56 -21
- data/lib/puppet/functions/match.rb +29 -12
- data/lib/puppet/functions/reduce.rb +95 -58
- data/lib/puppet/functions/versioncmp.rb +36 -0
- data/lib/puppet/functions/with.rb +15 -7
- data/lib/puppet/functions.rb +2 -4
- data/lib/puppet/indirector/catalog/compiler.rb +3 -3
- data/lib/puppet/indirector/catalog/static_compiler.rb +46 -30
- data/lib/puppet/indirector/data_binding/none.rb +4 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +58 -1
- data/lib/puppet/indirector/hiera.rb +4 -0
- data/lib/puppet/indirector/indirection.rb +6 -1
- data/lib/puppet/indirector/json.rb +1 -1
- data/lib/puppet/indirector/msgpack.rb +1 -1
- data/lib/puppet/indirector/request.rb +7 -8
- data/lib/puppet/indirector/resource_type/parser.rb +5 -3
- data/lib/puppet/info_service/class_information_service.rb +111 -0
- data/lib/puppet/info_service.rb +7 -0
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +32 -9
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +42 -38
- data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +25 -18
- data/lib/puppet/network/authconfig.rb +21 -1
- data/lib/puppet/network/authorization.rb +8 -1
- data/lib/puppet/network/http/api/master/v3/environment.rb +59 -0
- data/lib/puppet/network/http/api/master/v3.rb +7 -1
- data/lib/puppet/node/environment.rb +9 -2
- data/lib/puppet/node.rb +11 -5
- data/lib/puppet/parser/ast/pops_bridge.rb +39 -1
- data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +64 -0
- data/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +38 -0
- data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +20 -0
- data/lib/puppet/parser/compiler/catalog_validator.rb +33 -0
- data/lib/puppet/parser/compiler.rb +300 -12
- data/lib/puppet/parser/environment_compiler.rb +165 -0
- data/lib/puppet/parser/functions/assert_type.rb +46 -16
- data/lib/puppet/parser/functions/defined.rb +105 -68
- data/lib/puppet/parser/functions/each.rb +85 -27
- data/lib/puppet/parser/functions/epp.rb +29 -37
- data/lib/puppet/parser/functions/filter.rb +59 -23
- data/lib/puppet/parser/functions/hiera.rb +83 -27
- data/lib/puppet/parser/functions/hiera_array.rb +71 -28
- data/lib/puppet/parser/functions/hiera_hash.rb +81 -30
- data/lib/puppet/parser/functions/hiera_include.rb +81 -40
- data/lib/puppet/parser/functions/inline_epp.rb +35 -60
- data/lib/puppet/parser/functions/inline_template.rb +2 -2
- data/lib/puppet/parser/functions/map.rb +55 -20
- data/lib/puppet/parser/functions/match.rb +27 -12
- data/lib/puppet/parser/functions/reduce.rb +97 -60
- data/lib/puppet/parser/functions/with.rb +16 -8
- data/lib/puppet/parser/resource.rb +103 -21
- data/lib/puppet/parser.rb +3 -0
- data/lib/puppet/plugins/configuration.rb +3 -2
- data/lib/puppet/plugins/data_providers/data_provider.rb +283 -0
- data/lib/puppet/plugins/data_providers/registry.rb +84 -0
- data/lib/puppet/plugins/data_providers.rb +12 -60
- data/lib/puppet/pops/adapters.rb +12 -0
- data/lib/puppet/pops/binder/binder.rb +2 -2
- data/lib/puppet/pops/binder/bindings_checker.rb +1 -1
- data/lib/puppet/pops/binder/bindings_label_provider.rb +3 -1
- data/lib/puppet/pops/binder/bindings_loader.rb +6 -2
- data/lib/puppet/pops/binder/bindings_model_meta.rb +2 -2
- data/lib/puppet/pops/binder/config/binder_config.rb +1 -1
- data/lib/puppet/pops/binder/injector.rb +4 -4
- data/lib/puppet/pops/binder/key_factory.rb +3 -9
- data/lib/puppet/pops/binder/scheme_handler/module_scheme.rb +68 -9
- data/lib/puppet/pops/evaluator/access_operator.rb +27 -60
- data/lib/puppet/pops/evaluator/closure.rb +8 -8
- data/lib/puppet/pops/evaluator/collectors/abstract_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +10 -6
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +87 -0
- data/lib/puppet/pops/evaluator/relationship_operator.rb +7 -1
- data/lib/puppet/pops/functions/dispatcher.rb +3 -3
- data/lib/puppet/pops/issues.rb +11 -3
- data/lib/puppet/pops/label_provider.rb +1 -1
- data/lib/puppet/pops/lookup/explainer.rb +402 -0
- data/lib/puppet/pops/lookup/invocation.rb +117 -0
- data/lib/puppet/pops/lookup.rb +25 -47
- data/lib/puppet/pops/merge_strategy.rb +73 -5
- data/lib/puppet/pops/model/factory.rb +38 -3
- data/lib/puppet/pops/model/model_label_provider.rb +10 -1
- data/lib/puppet/pops/model/model_meta.rb +19 -1
- data/lib/puppet/pops/model/model_tree_dumper.rb +18 -0
- data/lib/puppet/pops/parser/code_merger.rb +13 -1
- data/lib/puppet/pops/parser/egrammar.ra +65 -2
- data/lib/puppet/pops/parser/eparser.rb +1569 -1241
- data/lib/puppet/pops/parser/lexer2.rb +32 -1
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/parser_support.rb +25 -13
- data/lib/puppet/pops/patterns.rb +3 -0
- data/lib/puppet/pops/types/enumeration.rb +1 -2
- data/lib/puppet/pops/types/type_asserter.rb +16 -15
- data/lib/puppet/pops/types/type_assertion_error.rb +1 -0
- data/lib/puppet/pops/types/type_calculator.rb +171 -1020
- data/lib/puppet/pops/types/type_factory.rb +87 -148
- data/lib/puppet/pops/types/type_mismatch_describer.rb +743 -0
- data/lib/puppet/pops/types/type_parser.rb +118 -129
- data/lib/puppet/pops/types/types.rb +1394 -255
- data/lib/puppet/pops/types/types_meta.rb +0 -234
- data/lib/puppet/pops/validation/checker4_0.rb +49 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +3 -1
- data/lib/puppet/pops/validation.rb +7 -2
- data/lib/puppet/pops.rb +19 -17
- data/lib/puppet/provider/augeas/augeas.rb +50 -0
- data/lib/puppet/provider/exec.rb +6 -1
- data/lib/puppet/provider/group/directoryservice.rb +10 -0
- data/lib/puppet/provider/package/dnf.rb +41 -0
- data/lib/puppet/provider/package/gem.rb +7 -2
- data/lib/puppet/provider/package/nim.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +1 -0
- data/lib/puppet/provider/package/windows/exe_package.rb +10 -8
- data/lib/puppet/provider/package/windows/msi_package.rb +4 -3
- data/lib/puppet/provider/package/windows/package.rb +9 -1
- data/lib/puppet/provider/package/yum.rb +20 -9
- data/lib/puppet/provider/service/bsd.rb +1 -1
- data/lib/puppet/provider/service/debian.rb +21 -0
- data/lib/puppet/provider/service/init.rb +6 -0
- data/lib/puppet/provider/service/launchd.rb +36 -7
- data/lib/puppet/provider/service/rcng.rb +51 -0
- data/lib/puppet/provider/service/redhat.rb +2 -1
- data/lib/puppet/provider/service/smf.rb +43 -2
- data/lib/puppet/provider/service/src.rb +27 -0
- data/lib/puppet/provider/service/systemd.rb +25 -5
- data/lib/puppet/provider/sshkey/parsed.rb +19 -9
- data/lib/puppet/provider/zone/solaris.rb +2 -2
- data/lib/puppet/reference/configuration.rb +10 -4
- data/lib/puppet/reference/report.rb +9 -12
- data/lib/puppet/reports.rb +5 -1
- data/lib/puppet/resource/capability_finder.rb +95 -0
- data/lib/puppet/resource/catalog.rb +47 -7
- data/lib/puppet/resource/status.rb +0 -2
- data/lib/puppet/resource/type.rb +238 -44
- data/lib/puppet/resource/type_collection.rb +60 -2
- data/lib/puppet/resource.rb +50 -73
- data/lib/puppet/settings/file_setting.rb +10 -9
- data/lib/puppet/settings.rb +2 -2
- data/lib/puppet/ssl/certificate_authority/interface.rb +2 -2
- data/lib/puppet/ssl/oids.rb +9 -1
- data/lib/puppet/transaction/additional_resource_generator.rb +71 -8
- data/lib/puppet/transaction/resource_harness.rb +9 -4
- data/lib/puppet/transaction.rb +8 -1
- data/lib/puppet/type/augeas.rb +8 -0
- data/lib/puppet/type/file/source.rb +14 -12
- data/lib/puppet/type/package.rb +9 -6
- data/lib/puppet/type/user.rb +4 -2
- data/lib/puppet/type.rb +78 -7
- data/lib/puppet/util/command_line.rb +4 -0
- data/lib/puppet/util/execution.rb +18 -2
- data/lib/puppet/util/tagging.rb +7 -1
- data/lib/puppet/util/windows/adsi.rb +5 -2
- data/lib/puppet/util/windows/security.rb +4 -1
- data/lib/puppet/util/windows/taskscheduler.rb +1 -1
- data/lib/puppet/util.rb +9 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +12 -0
- data/spec/fixtures/unit/application/environments/production/data/common.yaml +3 -0
- data/spec/fixtures/unit/application/environments/production/environment.conf +1 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_json/data/bad.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_json/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_json/hiera.yaml +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_json/manifests/site.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_yaml/data/bad.yaml +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_yaml/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_yaml/hiera.yaml +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_bad_syntax_yaml/manifests/site.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/data/common.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/manifests/site.pp +1 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/modules/one/data/common.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/modules/one/manifests/init.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_defaults/modules/one/metadata.json +9 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/first.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/name.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/second.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/single.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data2/single.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/hiera.yaml +18 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/manifests/site.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/data/common.yaml +46 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/manifests/site.pp +1 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/modules/one/data/common.yaml +30 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/modules/one/manifests/init.pp +13 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/modules/one/metadata.json +9 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/manifests/site.pp +1 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/data1/first.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/data1/name.yaml +1 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/data1/second.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/data1/single.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/data2/single.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/hiera.yaml +18 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/manifests/init.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_module_config/modules/one/metadata.json +9 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb +1 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_module_data.rb +1 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/hieraprovider/data/first.json +3 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/hieraprovider/hiera.yaml +8 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/hieraprovider/manifests/init.pp +5 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/hieraprovider/metadata.json +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/meta/lib/puppet/functions/meta/data.rb +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/meta/manifests/init.pp +3 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/meta/metadata.json +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/metawcp/lib/puppet/bindings/metawcp/default.rb +10 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/metawcp/lib/puppet_x/thallgren/sample_module_data.rb +23 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/metawcp/manifests/init.pp +3 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/metawcp/metadata.json +9 -0
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-security.txt +184 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +24 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +24 -0
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +24 -0
- data/spec/integration/data_binding_spec.rb +229 -0
- data/spec/integration/file_bucket/file_spec.rb +2 -2
- data/spec/integration/parser/compiler_spec.rb +30 -24
- data/spec/integration/parser/resource_expressions_spec.rb +4 -4
- data/spec/integration/parser/undef_param_spec.rb +1 -1
- data/spec/integration/provider/package_spec.rb +3 -1
- data/spec/integration/resource/catalog_spec.rb +1 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +0 -1
- data/spec/integration/ssl/certificate_request_spec.rb +0 -1
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +0 -1
- data/spec/integration/ssl/host_spec.rb +0 -1
- data/spec/integration/type/package_spec.rb +2 -0
- data/spec/integration/util/rdoc/parser_spec.rb +1 -1
- data/spec/integration/util/windows/security_spec.rb +18 -0
- data/spec/lib/matchers/include_in_order.rb +2 -2
- data/spec/shared_behaviours/iterative_functions.rb +8 -8
- data/spec/spec_helper.rb +7 -0
- data/spec/unit/agent/locker_spec.rb +4 -4
- data/spec/unit/agent_spec.rb +0 -8
- data/spec/unit/application/agent_spec.rb +5 -0
- data/spec/unit/application/apply_spec.rb +9 -1
- data/spec/unit/application/filebucket_spec.rb +88 -2
- data/spec/unit/application/lookup_spec.rb +195 -0
- data/spec/unit/application/master_spec.rb +2 -2
- data/spec/unit/application_spec.rb +3 -3
- data/spec/unit/appmgmt_spec.rb +657 -0
- data/spec/unit/capability_spec.rb +414 -0
- data/spec/unit/configurer_spec.rb +7 -1
- data/spec/unit/context/trusted_information_spec.rb +24 -1
- data/spec/unit/daemon_spec.rb +18 -8
- data/spec/unit/data_providers/hiera_data_provider_spec.rb +201 -0
- data/spec/unit/environments_spec.rb +2 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/file_bucket/dipper_spec.rb +210 -1
- data/spec/unit/file_serving/configuration_spec.rb +1 -1
- data/spec/unit/file_system_spec.rb +20 -0
- data/spec/unit/functions/assert_type_spec.rb +5 -7
- data/spec/unit/functions/defined_spec.rb +2 -2
- data/spec/unit/functions/epp_spec.rb +2 -2
- data/spec/unit/functions/filter_spec.rb +18 -0
- data/spec/unit/functions/hiera_spec.rb +2 -2
- data/spec/unit/functions/lookup_spec.rb +200 -9
- data/spec/unit/functions/regsubst_spec.rb +17 -8
- data/spec/unit/functions/scanf_spec.rb +1 -1
- data/spec/unit/functions/split_spec.rb +2 -2
- data/spec/unit/functions/versioncmp_spec.rb +36 -0
- data/spec/unit/functions4_spec.rb +58 -72
- data/spec/unit/graph/sequential_prioritizer_spec.rb +1 -1
- data/spec/unit/indirector/catalog/compiler_spec.rb +28 -8
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +38 -20
- data/spec/unit/indirector/data_binding/none_spec.rb +2 -2
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +52 -1
- data/spec/unit/indirector/indirection_spec.rb +13 -2
- data/spec/unit/indirector/request_spec.rb +8 -8
- data/spec/unit/indirector/ssl_file_spec.rb +1 -1
- data/spec/unit/indirector/yaml_spec.rb +1 -1
- data/spec/unit/info_service_spec.rb +236 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/module_tool/applications/builder_spec.rb +1 -1
- data/spec/unit/module_tool/metadata_spec.rb +31 -2
- data/spec/unit/network/authconfig_spec.rb +62 -32
- data/spec/unit/network/authorization_spec.rb +30 -2
- data/spec/unit/network/authstore_spec.rb +1 -1
- data/spec/unit/network/http/compression_spec.rb +1 -1
- data/spec/unit/network/http/connection_spec.rb +14 -19
- data/spec/unit/network/http/handler_spec.rb +0 -5
- data/spec/unit/network/rights_spec.rb +3 -3
- data/spec/unit/node_spec.rb +27 -0
- data/spec/unit/parser/ast/leaf_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +86 -2
- data/spec/unit/parser/functions/create_resources_spec.rb +1 -1
- data/spec/unit/parser/resource_spec.rb +2 -20
- data/spec/unit/pops/binder/config/binder_config_spec.rb +1 -1
- data/spec/unit/pops/binder/injector_spec.rb +3 -3
- data/spec/unit/pops/evaluator/access_ops_spec.rb +13 -11
- data/spec/unit/pops/evaluator/basic_expressions_spec.rb +1 -2
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +20 -11
- data/spec/unit/pops/evaluator/literal_evaluator_spec.rb +43 -0
- data/spec/unit/pops/label_provider_spec.rb +5 -1
- data/spec/unit/pops/parser/lexer2_spec.rb +39 -0
- data/spec/unit/pops/parser/parse_application_spec.rb +40 -0
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +4 -0
- data/spec/unit/pops/parser/parse_capabilities_spec.rb +47 -0
- data/spec/unit/pops/parser/parse_site_spec.rb +38 -0
- data/spec/unit/pops/parser/parser_rspec_helper.rb +5 -0
- data/spec/unit/pops/parser/parser_spec.rb +18 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +427 -444
- data/spec/unit/pops/types/type_factory_spec.rb +12 -12
- data/spec/unit/pops/types/type_parser_spec.rb +15 -12
- data/spec/unit/pops/validator/validator_spec.rb +68 -0
- data/spec/unit/property_spec.rb +1 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +50 -0
- data/spec/unit/provider/group/directoryservice_spec.rb +33 -0
- data/spec/unit/provider/group/windows_adsi_spec.rb +3 -0
- data/spec/unit/provider/package/dnf_spec.rb +92 -0
- data/spec/unit/provider/package/gem_spec.rb +7 -0
- data/spec/unit/provider/package/nim_spec.rb +6 -6
- data/spec/unit/provider/package/rpm_spec.rb +25 -2
- data/spec/unit/provider/package/windows/package_spec.rb +41 -0
- data/spec/unit/provider/package/yum_spec.rb +35 -12
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +10 -0
- data/spec/unit/provider/service/debian_spec.rb +28 -0
- data/spec/unit/provider/service/gentoo_spec.rb +1 -0
- data/spec/unit/provider/service/init_spec.rb +6 -0
- data/spec/unit/provider/service/launchd_spec.rb +85 -10
- data/spec/unit/provider/service/openrc_spec.rb +1 -0
- data/spec/unit/provider/service/rcng_spec.rb +41 -0
- data/spec/unit/provider/service/redhat_spec.rb +8 -1
- data/spec/unit/provider/service/smf_spec.rb +30 -5
- data/spec/unit/provider/service/src_spec.rb +20 -4
- data/spec/unit/provider/service/systemd_spec.rb +79 -29
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +1 -1
- data/spec/unit/provider/sshkey/parsed_spec.rb +23 -0
- data/spec/unit/provider/user/windows_adsi_spec.rb +2 -1
- data/spec/unit/provider/zone/solaris_spec.rb +19 -0
- data/spec/unit/reports_spec.rb +10 -0
- data/spec/unit/resource/capability_finder_spec.rb +56 -0
- data/spec/unit/resource/catalog_spec.rb +31 -8
- data/spec/unit/resource/type_collection_spec.rb +23 -2
- data/spec/unit/resource/type_spec.rb +1 -1
- data/spec/unit/resource_spec.rb +23 -5
- data/spec/unit/settings/file_setting_spec.rb +31 -0
- data/spec/unit/settings_spec.rb +91 -2
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +4 -3
- data/spec/unit/ssl/certificate_authority_spec.rb +5 -3
- data/spec/unit/ssl/host_spec.rb +2 -2
- data/spec/unit/ssl/oids_spec.rb +8 -0
- data/spec/unit/transaction/additional_resource_generator_spec.rb +78 -5
- data/spec/unit/transaction/report_spec.rb +24 -1
- data/spec/unit/transaction_spec.rb +7 -0
- data/spec/unit/type/exec_spec.rb +16 -8
- data/spec/unit/type/host_spec.rb +4 -4
- data/spec/unit/type/package_spec.rb +1 -0
- data/spec/unit/type/tidy_spec.rb +4 -4
- data/spec/unit/type/user_spec.rb +14 -7
- data/spec/unit/type/vlan_spec.rb +1 -1
- data/spec/unit/type_spec.rb +1 -1
- data/spec/unit/util/ldap/generator_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/network_device/transport/ssh_spec.rb +1 -1
- data/spec/unit/util/network_device_spec.rb +1 -1
- data/spec/unit/util/storage_spec.rb +5 -1
- data/spec/unit/util/windows/adsi_spec.rb +13 -0
- data/spec/unit/util_spec.rb +21 -2
- metadata +173 -7
- data/lib/puppet/pops/evaluator/callable_mismatch_describer.rb +0 -175
- data/spec/integration/data_binding.rb +0 -104
data/CONTRIBUTING.md
CHANGED
|
@@ -106,7 +106,7 @@ a ticket number.
|
|
|
106
106
|
|
|
107
107
|
# Additional Resources
|
|
108
108
|
|
|
109
|
-
* [Puppet Labs community
|
|
109
|
+
* [Puppet Labs community guidelines](http://docs.puppetlabs.com/community/community_guidelines.html)
|
|
110
110
|
* [Bug tracker (Jira)](http://tickets.puppetlabs.com)
|
|
111
111
|
* [Contributor License Agreement](http://links.puppetlabs.com/cla)
|
|
112
112
|
* [General GitHub documentation](http://help.github.com/)
|
data/Gemfile
CHANGED
|
@@ -25,7 +25,7 @@ end
|
|
|
25
25
|
|
|
26
26
|
gem "puppet", :path => File.dirname(__FILE__), :require => false
|
|
27
27
|
gem "facter", *location_for(ENV['FACTER_LOCATION'] || ['> 2.0', '< 4'])
|
|
28
|
-
gem "hiera", *location_for(ENV['HIERA_LOCATION'] || ['>= 2.0', '<
|
|
28
|
+
gem "hiera", *location_for(ENV['HIERA_LOCATION'] || ['>= 2.0', '< 4'])
|
|
29
29
|
gem "rake", "10.1.1", :require => false
|
|
30
30
|
|
|
31
31
|
group(:development, :test) do
|
|
@@ -49,6 +49,9 @@ group(:development, :test) do
|
|
|
49
49
|
gem "rubocop", "~> 0.26.1", :platforms => [:ruby]
|
|
50
50
|
|
|
51
51
|
gem 'rdoc', "~> 4.1", :platforms => [:ruby]
|
|
52
|
+
|
|
53
|
+
gem 'webmock'
|
|
54
|
+
gem 'vcr', '~> 2.9'
|
|
52
55
|
end
|
|
53
56
|
|
|
54
57
|
group(:development) do
|
|
@@ -62,12 +65,7 @@ group(:extra) do
|
|
|
62
65
|
gem "net-ssh", '~> 2.1', :require => false
|
|
63
66
|
gem "puppetlabs_spec_helper", :require => false
|
|
64
67
|
gem "tzinfo", :require => false
|
|
65
|
-
|
|
66
|
-
when 'java'
|
|
67
|
-
gem "msgpack-jruby", :require => false
|
|
68
|
-
else
|
|
69
|
-
gem "msgpack", :require => false
|
|
70
|
-
end
|
|
68
|
+
gem "msgpack", :require => false
|
|
71
69
|
end
|
|
72
70
|
|
|
73
71
|
require 'yaml'
|
data/README.md
CHANGED
|
@@ -51,7 +51,7 @@ See [LICENSE](LICENSE) file.
|
|
|
51
51
|
Support
|
|
52
52
|
-------
|
|
53
53
|
|
|
54
|
-
Please log tickets and issues at our [JIRA tracker](
|
|
54
|
+
Please log tickets and issues at our [JIRA tracker](https://tickets.puppetlabs.com). A [mailing
|
|
55
55
|
list](https://groups.google.com/forum/?fromgroups#!forum/puppet-users) is
|
|
56
56
|
available for asking questions and getting help from others. In addition there
|
|
57
57
|
is an active #puppet channel on Freenode.
|
data/Rakefile
CHANGED
|
@@ -75,3 +75,23 @@ task(:rubocop) do
|
|
|
75
75
|
raise "RuboCop detected offenses" if exit_code != 0
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
+
desc "verify that commit messages match CONTRIBUTING.md requirements"
|
|
79
|
+
task(:commits) do
|
|
80
|
+
# This git command looks at the summary from every commit from this branch not in master.
|
|
81
|
+
# Ideally this would compare against the branch that a PR is submitted against, but I don't
|
|
82
|
+
# know how to get that information. Absent that, comparing with master should work in most cases.
|
|
83
|
+
%x{git log --no-merges --pretty=%s master..$HEAD}.each_line do |commit_summary|
|
|
84
|
+
# This regex tests for the currently supported commit summary tokens: maint, doc, packaging, or pup-<number>.
|
|
85
|
+
# The exception tries to explain it in more full.
|
|
86
|
+
if /^\((maint|doc|docs|packaging|pup-\d+)\)|revert/i.match(commit_summary).nil?
|
|
87
|
+
raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
|
|
88
|
+
"\n\t\t#{commit_summary}\n" \
|
|
89
|
+
"\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
|
|
90
|
+
"\t\t(pup-<digits>) # this is most common and should be a ticket at tickets.puppetlabs.com\n" \
|
|
91
|
+
"\t\t(docs)\n" \
|
|
92
|
+
"\t\t(maint)\n" \
|
|
93
|
+
"\t\t(packaging)\n" \
|
|
94
|
+
"\n\tThis test for the commit summary is case-insensitive.\n\n\n"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
data/ext/debian/puppet.init
CHANGED
data/ext/debian/puppet.logrotate
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
/var/log/puppetlabs/puppet.log {
|
|
2
|
-
missingok
|
|
3
|
-
sharedscripts
|
|
4
|
-
create 0644 puppet puppet
|
|
1
|
+
/var/log/puppetlabs/masterhttp.log /var/log/puppet/masterhttp.log {
|
|
5
2
|
compress
|
|
6
3
|
rotate 4
|
|
4
|
+
missingok
|
|
5
|
+
notifempty
|
|
6
|
+
nocreate
|
|
7
|
+
}
|
|
7
8
|
|
|
9
|
+
/var/log/puppetlabs/puppetd.log /var/log/puppet/puppetd.log {
|
|
10
|
+
compress
|
|
11
|
+
rotate 4
|
|
12
|
+
missingok
|
|
13
|
+
notifempty
|
|
14
|
+
nocreate
|
|
15
|
+
sharedscripts
|
|
8
16
|
postrotate
|
|
9
|
-
|
|
17
|
+
([ -x /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1) ||
|
|
18
|
+
([ -x /usr/bin/systemctl ] && /usr/bin/systemctl kill -s USR2 puppet.service > /dev/null 2>&1) || true
|
|
10
19
|
endscript
|
|
11
20
|
}
|
data/ext/osx/puppet.plist
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
<dict>
|
|
5
5
|
<key>EnvironmentVariables</key>
|
|
6
6
|
<dict>
|
|
7
|
-
<key>PATH</key>
|
|
8
|
-
<string>/opt/puppetlabs/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
|
9
7
|
<key>LANG</key>
|
|
10
8
|
<string>en_US.UTF-8</string>
|
|
11
9
|
</dict>
|
|
@@ -25,8 +23,8 @@
|
|
|
25
23
|
<key>RunAtLoad</key>
|
|
26
24
|
<true/>
|
|
27
25
|
<key>StandardErrorPath</key>
|
|
28
|
-
|
|
26
|
+
<string>/var/log/puppetlabs/puppet/puppet.log</string>
|
|
29
27
|
<key>StandardOutPath</key>
|
|
30
|
-
|
|
28
|
+
<string>/var/log/puppetlabs/puppet/puppet.log</string>
|
|
31
29
|
</dict>
|
|
32
30
|
</plist>
|
data/ext/project_data.yaml
CHANGED
data/ext/redhat/client.init
CHANGED
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
# Source function library.
|
|
14
14
|
. /etc/rc.d/init.d/functions
|
|
15
15
|
|
|
16
|
-
PATH=/opt/puppetlabs/puppet/bin:/usr/bin:/sbin:/bin:/usr/sbin
|
|
17
|
-
export PATH
|
|
18
|
-
|
|
19
16
|
[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
|
|
20
17
|
lockfile=/var/lock/subsys/puppet
|
|
21
|
-
|
|
18
|
+
piddir=/var/run/puppetlabs
|
|
19
|
+
pidfile=${piddir}/agent.pid
|
|
22
20
|
puppetd=/opt/puppetlabs/puppet/bin/puppet
|
|
21
|
+
pid=$(cat $pidfile 2> /dev/null)
|
|
23
22
|
RETVAL=0
|
|
24
23
|
|
|
25
24
|
PUPPET_OPTS="agent "
|
|
@@ -29,6 +28,7 @@ PUPPET_OPTS="agent "
|
|
|
29
28
|
if status | grep -q -- '-p' 2>/dev/null; then
|
|
30
29
|
daemonopts="--pidfile $pidfile"
|
|
31
30
|
pidopts="-p $pidfile"
|
|
31
|
+
USEINITFUNCTIONS=true
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
34
|
# Figure out if the system just booted. Let's assume
|
|
@@ -38,6 +38,7 @@ fi
|
|
|
38
38
|
|
|
39
39
|
start() {
|
|
40
40
|
echo -n $"Starting puppet agent: "
|
|
41
|
+
mkdir -p $piddir
|
|
41
42
|
daemon $daemonopts $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
|
|
42
43
|
RETVAL=$?
|
|
43
44
|
echo
|
|
@@ -47,15 +48,40 @@ start() {
|
|
|
47
48
|
|
|
48
49
|
stop() {
|
|
49
50
|
echo -n $"Stopping puppet agent: "
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
if [ "$USEINITFUNCTIONS" = "true" ]; then
|
|
52
|
+
killproc $pidopts $puppetd
|
|
53
|
+
RETVAL=$?
|
|
54
|
+
else
|
|
55
|
+
if [ -n "${pid}" ]; then
|
|
56
|
+
kill -TERM $pid >/dev/null 2>&1
|
|
57
|
+
RETVAL=$?
|
|
58
|
+
fi
|
|
59
|
+
fi
|
|
52
60
|
echo
|
|
53
61
|
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
|
|
62
|
+
return $RETVAL
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
reload() {
|
|
57
|
-
echo -n $"
|
|
58
|
-
|
|
66
|
+
echo -n $"Reloading puppet agent: "
|
|
67
|
+
if [ "$USEINITFUNCTIONS" = "true" ]; then
|
|
68
|
+
killproc $pidopts $puppetd -HUP
|
|
69
|
+
RETVAL=$?
|
|
70
|
+
else
|
|
71
|
+
if [ -n "${pid}" ]; then
|
|
72
|
+
kill -HUP $pid >/dev/null 2>&1
|
|
73
|
+
RETVAL=$?
|
|
74
|
+
else
|
|
75
|
+
RETVAL=0
|
|
76
|
+
fi
|
|
77
|
+
fi
|
|
78
|
+
echo
|
|
79
|
+
return $RETVAL
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
rotate() {
|
|
83
|
+
echo -n $"Reopening log files for puppet agent: "
|
|
84
|
+
killproc $pidopts $puppetd -USR2
|
|
59
85
|
RETVAL=$?
|
|
60
86
|
echo
|
|
61
87
|
return $RETVAL
|
|
@@ -67,9 +93,33 @@ restart() {
|
|
|
67
93
|
}
|
|
68
94
|
|
|
69
95
|
rh_status() {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
base=puppet
|
|
97
|
+
if [ "$USEINITFUNCTIONS" = "true" ]; then
|
|
98
|
+
status $pidopts $puppetd
|
|
99
|
+
RETVAL=$?
|
|
100
|
+
return $RETVAL
|
|
101
|
+
else
|
|
102
|
+
if [ -n "${pid}" ]; then
|
|
103
|
+
if `ps -p $pid | grep $pid > /dev/null 2>&1`; then
|
|
104
|
+
echo "${base} (pid ${pid}) is running..."
|
|
105
|
+
RETVAL=0
|
|
106
|
+
return $RETVAL
|
|
107
|
+
fi
|
|
108
|
+
fi
|
|
109
|
+
if [ -f "${pidfile}" ] ; then
|
|
110
|
+
echo "${base} dead but pid file exists"
|
|
111
|
+
RETVAL=1
|
|
112
|
+
return $RETVAL
|
|
113
|
+
fi
|
|
114
|
+
if [ -f "${lockfile}" ]; then
|
|
115
|
+
echo "${base} dead but subsys locked"
|
|
116
|
+
RETVAL=2
|
|
117
|
+
return $RETVAL
|
|
118
|
+
fi
|
|
119
|
+
echo "${base} is stopped"
|
|
120
|
+
RETVAL=3
|
|
121
|
+
return $RETVAL
|
|
122
|
+
fi
|
|
73
123
|
}
|
|
74
124
|
|
|
75
125
|
rh_status_q() {
|
|
@@ -91,6 +141,9 @@ case "$1" in
|
|
|
91
141
|
restart)
|
|
92
142
|
restart
|
|
93
143
|
;;
|
|
144
|
+
rotate)
|
|
145
|
+
rotate
|
|
146
|
+
;;
|
|
94
147
|
reload|force-reload)
|
|
95
148
|
reload
|
|
96
149
|
;;
|
|
@@ -109,7 +162,7 @@ case "$1" in
|
|
|
109
162
|
genconfig
|
|
110
163
|
;;
|
|
111
164
|
*)
|
|
112
|
-
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once|genconfig}"
|
|
165
|
+
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|rotate|once|genconfig}"
|
|
113
166
|
exit 1
|
|
114
167
|
esac
|
|
115
168
|
|
data/ext/redhat/logrotate
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
# Generic logrotate config for Red Hat systems. Works with both official
|
|
2
|
+
# Fedora and RHEL packages as well as PuppetLabs distributions.
|
|
3
|
+
|
|
4
|
+
/var/log/puppetlabs/masterhttp.log /var/log/puppet/masterhttp.log {
|
|
5
|
+
compress
|
|
2
6
|
missingok
|
|
3
7
|
notifempty
|
|
4
|
-
|
|
8
|
+
nocreate
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/var/log/puppetlabs/puppetd.log /var/log/puppet/puppetd.log {
|
|
12
|
+
compress
|
|
13
|
+
missingok
|
|
14
|
+
notifempty
|
|
15
|
+
nocreate
|
|
5
16
|
sharedscripts
|
|
6
17
|
postrotate
|
|
7
|
-
|
|
18
|
+
([ -x /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1) ||
|
|
19
|
+
([ -x /usr/bin/systemctl ] && /usr/bin/systemctl kill -s USR2 puppet.service > /dev/null 2>&1) || true
|
|
8
20
|
endscript
|
|
9
21
|
}
|
data/ext/redhat/puppet.spec.erb
CHANGED
|
@@ -181,13 +181,16 @@ echo "D /var/run/%{name} 0755 %{name} %{name} -" > \
|
|
|
181
181
|
# Create puppet modules directory for puppet module tool
|
|
182
182
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules
|
|
183
183
|
|
|
184
|
-
|
|
185
184
|
# Install a NetworkManager dispatcher script to pickup changes to
|
|
186
185
|
# # /etc/resolv.conf and such (https://bugzilla.redhat.com/532085).
|
|
187
186
|
mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
|
|
188
187
|
cp -pr ext/puppet-nm-dispatcher \
|
|
189
188
|
%{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/98-%{name}
|
|
190
189
|
|
|
190
|
+
# Masterhttp.log is created on server start and should be distributed
|
|
191
|
+
# with correct permissions
|
|
192
|
+
touch %{buildroot}%{_localstatedir}/log/puppet/masterhttp.log
|
|
193
|
+
|
|
191
194
|
%files
|
|
192
195
|
%defattr(-, root, root, 0755)
|
|
193
196
|
%doc LICENSE README.md examples
|
|
@@ -280,6 +283,7 @@ cp -pr ext/puppet-nm-dispatcher \
|
|
|
280
283
|
%{_sysconfdir}/puppet/environments/example_env/README.environment
|
|
281
284
|
%{_mandir}/man8/puppet-ca.8.gz
|
|
282
285
|
%{_mandir}/man8/puppet-master.8.gz
|
|
286
|
+
%attr(660, puppet, puppet) %{_localstatedir}/log/puppet/masterhttp.log
|
|
283
287
|
|
|
284
288
|
# Fixed uid/gid were assigned in bz 472073 (Fedora), 471918 (RHEL-5),
|
|
285
289
|
# and 471919 (RHEL-4)
|
data/ext/redhat/server.init
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/sbin/sh
|
|
2
|
+
|
|
3
|
+
. /lib/svc/share/smf_include.sh
|
|
4
|
+
|
|
5
|
+
[ -z "${SMF_FMRI}" ] && exit $SMF_EXIT_ERR
|
|
6
|
+
|
|
7
|
+
CONF_FILE=/etc/puppetlabs/puppet/puppet.conf
|
|
8
|
+
[ ! -f "${CONF_FILE}" ] && exit $SMF_EXIT_ERR_CONFIG
|
|
9
|
+
|
|
10
|
+
PUPPET=/opt/puppetlabs/bin/puppet
|
|
11
|
+
|
|
12
|
+
case "$1" in
|
|
13
|
+
start)
|
|
14
|
+
exec $PUPPET agent
|
|
15
|
+
;;
|
|
16
|
+
|
|
17
|
+
stop)
|
|
18
|
+
# stop sends sigterm first followed by sigkill
|
|
19
|
+
# smf_kill_contract <CTID> TERM 1 30
|
|
20
|
+
# sends sigterm to all process in ctid and will continue
|
|
21
|
+
# to do so for 30 seconds with interval of 5 seconds
|
|
22
|
+
# smf_kill_contract <CTID> KILL 1
|
|
23
|
+
# continues until all processes are killed.
|
|
24
|
+
# svcs -p <fmri> lists all processes in the contract.
|
|
25
|
+
# http://bnsmb.de/solaris/My_Little_SMF_FAQ.html
|
|
26
|
+
ctid=`svcprop -p restarter/contract $SMF_FMRI`
|
|
27
|
+
if [ -n "$ctid" ]; then
|
|
28
|
+
smf_kill_contract $ctid TERM 1 30
|
|
29
|
+
ret=$?
|
|
30
|
+
[ $ret -eq 1 ] && exit $SMF_EXIT_ERR_FATAL
|
|
31
|
+
|
|
32
|
+
if [ $ret -eq 2 ] ; then
|
|
33
|
+
smf_kill_contract $ctid KILL 1
|
|
34
|
+
[ $? -ne 0 ] && exit $SMF_EXIT_ERR_FATAL
|
|
35
|
+
fi
|
|
36
|
+
fi
|
|
37
|
+
;;
|
|
38
|
+
*)
|
|
39
|
+
echo "Usage: $0 {start|stop}";
|
|
40
|
+
exit $SMF_EXIT_ERR_FATAL
|
|
41
|
+
;;
|
|
42
|
+
esac
|
|
43
|
+
exit $SMF_EXIT_OK
|
|
44
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
|
3
|
+
<!-- Original puppet manifest: Luke Kanies - puppetlabs.com -->
|
|
4
|
+
<service_bundle type="manifest" name="puppet">
|
|
5
|
+
|
|
6
|
+
<service name="network/puppet" type="service" version="1">
|
|
7
|
+
|
|
8
|
+
<create_default_instance enabled="false"/>
|
|
9
|
+
<single_instance/>
|
|
10
|
+
|
|
11
|
+
<dependency name="config-file" grouping="require_all" restart_on="none" type="path">
|
|
12
|
+
<service_fmri value="file:///etc/puppetlabs/puppet/puppet.conf"/>
|
|
13
|
+
</dependency>
|
|
14
|
+
|
|
15
|
+
<dependency name="loopback" grouping="require_all" restart_on="error" type="service">
|
|
16
|
+
<service_fmri value="svc:/network/loopback:default"/>
|
|
17
|
+
</dependency>
|
|
18
|
+
|
|
19
|
+
<dependency name="physical" grouping="require_all" restart_on="error" type="service">
|
|
20
|
+
<service_fmri value="svc:/network/physical:default"/>
|
|
21
|
+
</dependency>
|
|
22
|
+
|
|
23
|
+
<dependency name="fs-local" grouping="require_all" restart_on="none" type="service">
|
|
24
|
+
<service_fmri value="svc:/system/filesystem/local"/>
|
|
25
|
+
</dependency>
|
|
26
|
+
|
|
27
|
+
<exec_method type="method" name="start" exec="/lib/svc/method/puppet start" timeout_seconds="60"/>
|
|
28
|
+
|
|
29
|
+
<exec_method type="method" name="stop" exec="/lib/svc/method/puppet stop" timeout_seconds="60"/>
|
|
30
|
+
|
|
31
|
+
<stability value="Evolving"/>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<common_name>
|
|
35
|
+
<loctext xml:lang="C">Puppet Agent Daemon</loctext>
|
|
36
|
+
</common_name>
|
|
37
|
+
<documentation>
|
|
38
|
+
<manpage title="puppet" section="1"/>
|
|
39
|
+
<doc_link name="puppetlabs.com" uri="http://puppetlabs.com/puppet/introduction"/>
|
|
40
|
+
</documentation>
|
|
41
|
+
</template>
|
|
42
|
+
</service>
|
|
43
|
+
|
|
44
|
+
</service_bundle>
|
data/ext/suse/client.init
CHANGED
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
lockfile=/var/lock/subsys/puppet
|
|
37
37
|
pidfile=/var/run/puppetlabs/agent.pid
|
|
38
38
|
puppetd=/opt/puppetlabs/puppet/bin/puppet
|
|
39
|
-
RETVAL=0
|
|
40
39
|
|
|
41
40
|
PUPPET_OPTS="agent"
|
|
42
41
|
|
|
@@ -63,9 +62,18 @@ case "$1" in
|
|
|
63
62
|
## Start daemon with startproc(8). If this fails
|
|
64
63
|
## the echo return value is set appropriate.
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
## This accounts for the behavior of startproc on sles 10.
|
|
66
|
+
## Check to see if a running process matches the contents
|
|
67
|
+
## of the pidfile, and do nothing if true. Otherwise
|
|
68
|
+
## force a process start
|
|
69
|
+
if [ -f "${pidfile}" ]; then
|
|
70
|
+
PID=$(cat "$pidfile")
|
|
71
|
+
if [ "$PID" -eq $(pgrep -f "$puppetd") ] ; then
|
|
72
|
+
rc_status -v
|
|
73
|
+
rc_exit
|
|
74
|
+
fi
|
|
75
|
+
fi
|
|
76
|
+
startproc -f -w -p "${pidfile}" "${puppetd}" "${PUPPET_OPTS}" ${PUPPET_EXTRA_OPTS} && touch "${lockfile}"
|
|
69
77
|
# Remember status and be verbose
|
|
70
78
|
rc_status -v
|
|
71
79
|
;;
|
|
@@ -74,12 +82,12 @@ case "$1" in
|
|
|
74
82
|
## Stop daemon with killproc(8) and if this fails
|
|
75
83
|
## set echo the echo return value.
|
|
76
84
|
|
|
77
|
-
killproc -QUIT -p ${pidfile} $puppetd && rm -f ${lockfile} ${pidfile}
|
|
85
|
+
killproc -QUIT -p "${pidfile}" "${puppetd}" && rm -f "${lockfile}" "${pidfile}"
|
|
78
86
|
|
|
79
87
|
# Remember status and be verbose
|
|
80
88
|
rc_status -v
|
|
81
89
|
;;
|
|
82
|
-
try-restart)
|
|
90
|
+
try-restart|condrestart)
|
|
83
91
|
## Stop the service and if this succeeds (i.e. the
|
|
84
92
|
## service was running before), start it again.
|
|
85
93
|
$0 status >/dev/null && $0 restart
|
|
@@ -96,23 +104,10 @@ case "$1" in
|
|
|
96
104
|
# Remember status and be quiet
|
|
97
105
|
rc_status
|
|
98
106
|
;;
|
|
99
|
-
force-reload)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
echo -n "Reload service puppet"
|
|
105
|
-
## if it supports it:
|
|
106
|
-
killproc -HUP -p ${pidfile} $puppetd
|
|
107
|
-
rc_status -v
|
|
108
|
-
;;
|
|
109
|
-
reload)
|
|
110
|
-
## Like force-reload, but if daemon does not support
|
|
111
|
-
## signalling, do nothing (!)
|
|
112
|
-
|
|
113
|
-
# If it supports signalling:
|
|
114
|
-
echo -n "Reload puppet services."
|
|
115
|
-
killproc -HUP -p ${pidfile} $puppetd
|
|
107
|
+
reload|force-reload)
|
|
108
|
+
# Reload the service by sending the HUP signal
|
|
109
|
+
echo -n "Reloading puppet service: "
|
|
110
|
+
killproc -HUP -p "${pidfile}" "${puppetd}"
|
|
116
111
|
rc_status -v
|
|
117
112
|
;;
|
|
118
113
|
status)
|
|
@@ -127,15 +122,20 @@ case "$1" in
|
|
|
127
122
|
# 3 - service not running
|
|
128
123
|
|
|
129
124
|
# NOTE: checkproc returns LSB compliant status values.
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
if [ -f "${pidfile}" ]; then
|
|
126
|
+
checkproc -p "${pidfile}" "${puppetd}"
|
|
127
|
+
rc_status -v
|
|
128
|
+
else
|
|
129
|
+
rc_failed 3
|
|
130
|
+
rc_status -v
|
|
131
|
+
fi
|
|
132
132
|
;;
|
|
133
133
|
once)
|
|
134
134
|
shift
|
|
135
|
-
$puppetd ${PUPPET_OPTS} --onetime ${PUPPET_EXTRA_OPTS} $@
|
|
135
|
+
$puppetd "${PUPPET_OPTS}" --onetime ${PUPPET_EXTRA_OPTS} $@
|
|
136
136
|
;;
|
|
137
137
|
*)
|
|
138
|
-
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|once}"
|
|
138
|
+
echo "Usage: $0 {start|stop|status|try-restart|condrestart|restart|force-reload|reload|once}"
|
|
139
139
|
exit 1
|
|
140
140
|
esac
|
|
141
141
|
rc_exit
|
data/ext/suse/server.init
CHANGED
|
@@ -115,7 +115,7 @@ case "$1" in
|
|
|
115
115
|
# Remember status and be verbose
|
|
116
116
|
rc_status -v
|
|
117
117
|
;;
|
|
118
|
-
try-restart)
|
|
118
|
+
try-restart|condrestart)
|
|
119
119
|
## Stop the service and if this succeeds (i.e. the
|
|
120
120
|
## service was running before), start it again.
|
|
121
121
|
$0 status >/dev/null && $0 restart
|
|
@@ -167,7 +167,7 @@ case "$1" in
|
|
|
167
167
|
rc_status -v
|
|
168
168
|
;;
|
|
169
169
|
*)
|
|
170
|
-
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
170
|
+
echo "Usage: $0 {start|stop|status|try-restart|condrestart|restart|force-reload|reload}"
|
|
171
171
|
exit 1
|
|
172
172
|
esac
|
|
173
173
|
rc_exit
|
data/ext/systemd/puppet.service
CHANGED
|
@@ -8,6 +8,7 @@ EnvironmentFile=-/etc/sysconfig/puppetagent
|
|
|
8
8
|
EnvironmentFile=-/etc/sysconfig/puppet
|
|
9
9
|
EnvironmentFile=-/etc/default/puppet
|
|
10
10
|
ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
|
|
11
|
+
ExecReload=/bin/kill -HUP $MAINPID
|
|
11
12
|
KillMode=process
|
|
12
13
|
|
|
13
14
|
[Install]
|