chef 18.11.11 → 19.1.164
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.
- checksums.yaml +4 -4
- data/Gemfile +25 -27
- data/README.md +7 -2
- data/Rakefile +1 -12
- data/chef-universal-mingw-ucrt.gemspec +3 -5
- data/chef.gemspec +22 -27
- data/lib/chef/action_collection.rb +3 -1
- data/lib/chef/api_client/registration.rb +1 -1
- data/lib/chef/api_client.rb +1 -1
- data/lib/chef/api_client_v1.rb +1 -1
- data/lib/chef/application/apply.rb +30 -3
- data/lib/chef/application/base.rb +34 -3
- data/lib/chef/application/client.rb +15 -1
- data/lib/chef/application/exit_code.rb +3 -1
- data/lib/chef/application/solo.rb +1 -1
- data/lib/chef/application.rb +6 -1
- data/lib/chef/chef_class.rb +1 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -1
- data/lib/chef/chef_fs/command_line.rb +7 -6
- data/lib/chef/chef_fs/config.rb +1 -1
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/exceptions.rb +1 -1
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acl.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acls_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acls_sub_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/base_file.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +7 -6
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_key.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/clients_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/container.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/containers_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/cookbook_artifacts_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bag.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bag_item.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bags_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/directory.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/environment.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/environments_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/group.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/node.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policies_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy_group.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy_groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/role.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/roles_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/user.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/users_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/versioned_cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system.rb +1 -1
- data/lib/chef/chef_fs/file_system_cache.rb +1 -1
- data/lib/chef/chef_fs/path_utils.rb +1 -1
- data/lib/chef/client.rb +13 -3
- data/lib/chef/compliance/default_attributes.rb +1 -1
- data/lib/chef/compliance/fetcher/chef_server.rb +1 -1
- data/lib/chef/compliance/input.rb +1 -1
- data/lib/chef/compliance/input_collection.rb +1 -1
- data/lib/chef/compliance/profile.rb +1 -1
- data/lib/chef/compliance/profile_collection.rb +1 -1
- data/lib/chef/compliance/runner.rb +20 -20
- data/lib/chef/compliance/waiver.rb +1 -1
- data/lib/chef/compliance/waiver_collection.rb +1 -1
- data/lib/chef/config.rb +1 -1
- data/lib/chef/constants.rb +1 -1
- data/lib/chef/context.rb +53 -0
- data/lib/chef/cookbook/chefignore.rb +2 -2
- data/lib/chef/cookbook/cookbook_collection.rb +1 -1
- data/lib/chef/cookbook/cookbook_version_loader.rb +2 -1
- data/lib/chef/cookbook/file_system_file_vendor.rb +1 -1
- data/lib/chef/cookbook/file_vendor.rb +1 -1
- data/lib/chef/cookbook/gem_installer.rb +1 -1
- data/lib/chef/cookbook/manifest_v0.rb +1 -1
- data/lib/chef/cookbook/manifest_v2.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +1 -1
- data/lib/chef/cookbook/remote_file_vendor.rb +1 -1
- data/lib/chef/cookbook/synchronizer.rb +5 -0
- data/lib/chef/cookbook/syntax_check.rb +1 -1
- data/lib/chef/cookbook_loader.rb +1 -1
- data/lib/chef/cookbook_manifest.rb +1 -1
- data/lib/chef/cookbook_version.rb +3 -3
- data/lib/chef/daemon.rb +1 -1
- data/lib/chef/data_bag.rb +3 -3
- data/lib/chef/data_bag_item.rb +2 -2
- data/lib/chef/data_collector/config_validation.rb +1 -1
- data/lib/chef/data_collector/error_handlers.rb +1 -1
- data/lib/chef/data_collector/message_helpers.rb +1 -1
- data/lib/chef/data_collector/run_end_message.rb +1 -1
- data/lib/chef/data_collector/run_start_message.rb +2 -2
- data/lib/chef/data_collector.rb +2 -2
- data/lib/chef/decorator/lazy.rb +1 -1
- data/lib/chef/decorator/lazy_array.rb +1 -1
- data/lib/chef/decorator.rb +1 -1
- data/lib/chef/delayed_evaluator.rb +1 -1
- data/lib/chef/deprecated.rb +1 -1
- data/lib/chef/deprecation/warnings.rb +1 -1
- data/lib/chef/digester.rb +1 -1
- data/lib/chef/dsl/chef_vault.rb +2 -2
- data/lib/chef/dsl/cheffish.rb +1 -1
- data/lib/chef/dsl/compliance.rb +1 -1
- data/lib/chef/dsl/data_query.rb +1 -1
- data/lib/chef/dsl/declare_resource.rb +1 -1
- data/lib/chef/dsl/include_attribute.rb +1 -1
- data/lib/chef/dsl/include_recipe.rb +1 -1
- data/lib/chef/dsl/platform_introspection.rb +1 -1
- data/lib/chef/dsl/powershell.rb +1 -1
- data/lib/chef/dsl/reader_helpers.rb +3 -1
- data/lib/chef/dsl/reboot_pending.rb +1 -1
- data/lib/chef/dsl/recipe.rb +1 -1
- data/lib/chef/dsl/registry_helper.rb +1 -1
- data/lib/chef/dsl/render_helpers.rb +1 -1
- data/lib/chef/dsl/resources.rb +1 -1
- data/lib/chef/dsl/rest_resource.rb +17 -64
- data/lib/chef/dsl/secret.rb +1 -1
- data/lib/chef/dsl/universal.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +1 -1
- data/lib/chef/encrypted_data_bag_item.rb +1 -1
- data/lib/chef/environment.rb +2 -2
- data/lib/chef/event_loggers/base.rb +1 -1
- data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
- data/lib/chef/exceptions.rb +2 -12
- data/lib/chef/file_access_control/unix.rb +10 -10
- data/lib/chef/file_access_control/windows.rb +1 -1
- data/lib/chef/file_access_control.rb +1 -1
- data/lib/chef/file_cache.rb +1 -1
- data/lib/chef/file_content_management/content_base.rb +1 -1
- data/lib/chef/file_content_management/deploy/cp.rb +1 -1
- data/lib/chef/file_content_management/deploy/mv_unix.rb +1 -1
- data/lib/chef/file_content_management/deploy/mv_windows.rb +1 -1
- data/lib/chef/file_content_management/deploy/target_io.rb +27 -0
- data/lib/chef/file_content_management/deploy.rb +5 -2
- data/lib/chef/file_content_management/tempfile.rb +1 -1
- data/lib/chef/formatters/base.rb +1 -1
- data/lib/chef/formatters/error_description.rb +2 -9
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +1 -1
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +3 -2
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +3 -2
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_mapper.rb +1 -1
- data/lib/chef/group.rb +1 -1
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +1 -1
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +1 -1
- data/lib/chef/guard_interpreter.rb +1 -1
- data/lib/chef/handler/error_report.rb +1 -1
- data/lib/chef/handler/json_file.rb +1 -1
- data/lib/chef/handler/slow_report.rb +1 -1
- data/lib/chef/handler.rb +1 -1
- data/lib/chef/http/api_versions.rb +1 -1
- data/lib/chef/http/auth_credentials.rb +1 -1
- data/lib/chef/http/authenticator.rb +13 -26
- data/lib/chef/http/basic_client.rb +1 -2
- data/lib/chef/http/cookie_jar.rb +1 -1
- data/lib/chef/http/cookie_manager.rb +1 -1
- data/lib/chef/http/decompressor.rb +1 -1
- data/lib/chef/http/http_request.rb +17 -16
- data/lib/chef/http/json_input.rb +1 -1
- data/lib/chef/http/json_output.rb +1 -1
- data/lib/chef/http/json_to_model_output.rb +1 -1
- data/lib/chef/http/remote_request_id.rb +1 -1
- data/lib/chef/http/simple.rb +1 -1
- data/lib/chef/http/simple_json.rb +1 -1
- data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
- data/lib/chef/http/ssl_policies.rb +1 -1
- data/lib/chef/http/validate_content_length.rb +1 -1
- data/lib/chef/http.rb +1 -2
- data/lib/chef/json_compat.rb +1 -1
- data/lib/chef/key.rb +1 -1
- data/lib/chef/licensing.rb +105 -0
- data/lib/chef/licensing_config.rb +20 -0
- data/lib/chef/local_mode.rb +1 -1
- data/lib/chef/log/syslog.rb +1 -1
- data/lib/chef/log/winevt.rb +1 -1
- data/lib/chef/log.rb +1 -1
- data/lib/chef/mash.rb +1 -1
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +1 -1
- data/lib/chef/mixin/chef_utils_wiring.rb +1 -1
- data/lib/chef/mixin/convert_to_class_name.rb +1 -1
- data/lib/chef/mixin/create_path.rb +1 -1
- data/lib/chef/mixin/deep_merge.rb +1 -1
- data/lib/chef/mixin/default_paths.rb +1 -1
- data/lib/chef/mixin/deprecation.rb +1 -1
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +1 -1
- data/lib/chef/mixin/file_class.rb +4 -2
- data/lib/chef/mixin/from_file.rb +1 -1
- data/lib/chef/mixin/get_source_from_package.rb +2 -2
- data/lib/chef/mixin/homebrew.rb +3 -4
- data/lib/chef/mixin/lazy_module_include.rb +1 -1
- data/lib/chef/mixin/notifying_block.rb +1 -1
- data/lib/chef/mixin/openssl_helper.rb +1 -1
- data/lib/chef/mixin/params_validate.rb +1 -1
- data/lib/chef/mixin/path_sanity.rb +1 -1
- data/lib/chef/mixin/powershell_exec.rb +1 -1
- data/lib/chef/mixin/powershell_out.rb +1 -1
- data/lib/chef/mixin/powershell_type_coercions.rb +1 -1
- data/lib/chef/mixin/proxified_socket.rb +1 -1
- data/lib/chef/mixin/securable.rb +1 -1
- data/lib/chef/mixin/shell_out.rb +1 -1
- data/lib/chef/mixin/subclass_directive.rb +1 -1
- data/lib/chef/mixin/template.rb +3 -25
- data/lib/chef/mixin/unformatter.rb +1 -1
- data/lib/chef/mixin/uris.rb +1 -1
- data/lib/chef/mixin/user_context.rb +1 -1
- data/lib/chef/mixin/versioned_api.rb +1 -1
- data/lib/chef/mixin/which.rb +1 -1
- data/lib/chef/mixin/why_run.rb +1 -1
- data/lib/chef/mixin/wide_string.rb +1 -1
- data/lib/chef/mixin/windows_architecture_helper.rb +1 -1
- data/lib/chef/mixin/windows_env_helper.rb +1 -1
- data/lib/chef/mixin/xml_escape.rb +1 -1
- data/lib/chef/monkey_patches/net-http.rb +10 -11
- data/lib/chef/monkey_patches/win32/registry.rb +1 -1
- data/lib/chef/node/attribute.rb +1 -1
- data/lib/chef/node/attribute_collections.rb +1 -1
- data/lib/chef/node/common_api.rb +1 -1
- data/lib/chef/node/immutable_collections.rb +1 -1
- data/lib/chef/node/mixin/deep_merge_cache.rb +1 -1
- data/lib/chef/node/mixin/immutablize_array.rb +27 -1
- data/lib/chef/node/mixin/immutablize_hash.rb +36 -1
- data/lib/chef/node/mixin/mashy_array.rb +1 -1
- data/lib/chef/node/mixin/state_tracking.rb +1 -1
- data/lib/chef/node/mixin/state_tracking_array.rb +1 -1
- data/lib/chef/node.rb +1 -1
- data/lib/chef/node_map.rb +15 -3
- data/lib/chef/null_logger.rb +1 -1
- data/lib/chef/org.rb +1 -1
- data/lib/chef/platform/priority_map.rb +1 -1
- data/lib/chef/platform/provider_handler_map.rb +1 -1
- data/lib/chef/platform/provider_mapping.rb +1 -1
- data/lib/chef/platform/query_helpers.rb +1 -1
- data/lib/chef/platform/rebooter.rb +1 -1
- data/lib/chef/platform/resource_handler_map.rb +1 -1
- data/lib/chef/platform/service_helpers.rb +1 -1
- data/lib/chef/platform.rb +1 -1
- data/lib/chef/policy_builder/dynamic.rb +1 -1
- data/lib/chef/policy_builder/expand_node_object.rb +1 -1
- data/lib/chef/policy_builder/policyfile.rb +1 -1
- data/lib/chef/policy_builder.rb +1 -1
- data/lib/chef/property.rb +3 -3
- data/lib/chef/provider/batch.rb +1 -1
- data/lib/chef/provider/cookbook_file/content.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +2 -2
- data/lib/chef/provider/cron/aix.rb +1 -1
- data/lib/chef/provider/cron/solaris.rb +1 -1
- data/lib/chef/provider/cron.rb +15 -5
- data/lib/chef/provider/directory.rb +18 -18
- data/lib/chef/provider/dsc_resource.rb +1 -1
- data/lib/chef/provider/dsc_script.rb +1 -1
- data/lib/chef/provider/execute.rb +3 -2
- data/lib/chef/provider/file/content.rb +3 -4
- data/lib/chef/provider/file.rb +44 -31
- data/lib/chef/provider/git.rb +10 -10
- data/lib/chef/provider/group/aix.rb +1 -1
- data/lib/chef/provider/group/dscl.rb +2 -2
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +2 -2
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +3 -3
- data/lib/chef/provider/group/solaris.rb +3 -3
- data/lib/chef/provider/group/usermod.rb +3 -3
- data/lib/chef/provider/group.rb +2 -2
- data/lib/chef/provider/http_request.rb +3 -4
- data/lib/chef/provider/ifconfig/aix.rb +2 -2
- data/lib/chef/provider/ifconfig/debian.rb +3 -3
- data/lib/chef/provider/ifconfig/redhat.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +1 -1
- data/lib/chef/provider/link.rb +22 -11
- data/lib/chef/provider/lwrp_base.rb +1 -1
- data/lib/chef/provider/mount/aix.rb +5 -5
- data/lib/chef/provider/mount/linux.rb +4 -4
- data/lib/chef/provider/mount/mount.rb +12 -12
- data/lib/chef/provider/mount/solaris.rb +1 -1
- data/lib/chef/provider/mount/windows.rb +3 -3
- data/lib/chef/provider/mount.rb +1 -1
- data/lib/chef/provider/noop.rb +1 -1
- data/lib/chef/provider/package/apt.rb +1 -1
- data/lib/chef/provider/package/bff.rb +4 -4
- data/lib/chef/provider/package/cab.rb +1 -1
- data/lib/chef/provider/package/chocolatey.rb +20 -79
- data/lib/chef/provider/package/deb.rb +1 -1
- data/lib/chef/provider/package/dnf/dnf_helper.py +65 -355
- data/lib/chef/provider/package/dnf/python_helper.rb +5 -8
- data/lib/chef/provider/package/dnf/version.rb +1 -1
- data/lib/chef/provider/package/dnf.rb +5 -24
- data/lib/chef/provider/package/dpkg.rb +6 -6
- data/lib/chef/provider/package/freebsd/base.rb +1 -1
- data/lib/chef/provider/package/habitat.rb +6 -6
- data/lib/chef/provider/package/homebrew.rb +1 -1
- data/lib/chef/provider/package/ips.rb +3 -3
- data/lib/chef/provider/package/msu.rb +1 -1
- data/lib/chef/provider/package/openbsd.rb +3 -2
- data/lib/chef/provider/package/pacman.rb +4 -4
- data/lib/chef/provider/package/paludis.rb +3 -3
- data/lib/chef/provider/package/portage.rb +3 -3
- data/lib/chef/provider/package/powershell.rb +1 -1
- data/lib/chef/provider/package/rpm.rb +3 -3
- data/lib/chef/provider/package/rubygems.rb +21 -28
- data/lib/chef/provider/package/smartos.rb +2 -2
- data/lib/chef/provider/package/snap.rb +19 -7
- data/lib/chef/provider/package/snap_tm.rb +79 -0
- data/lib/chef/provider/package/solaris.rb +5 -5
- data/lib/chef/provider/package/windows/exe.rb +1 -1
- data/lib/chef/provider/package/windows/msi.rb +1 -1
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
- data/lib/chef/provider/package/windows.rb +1 -1
- data/lib/chef/provider/package/yum/python_helper.rb +1 -1
- data/lib/chef/provider/package/yum/rpm_utils.rb +1 -1
- data/lib/chef/provider/package/yum/version.rb +1 -1
- data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
- data/lib/chef/provider/package/yum.rb +2 -2
- data/lib/chef/provider/package/yum_tm.rb +132 -0
- data/lib/chef/provider/package/zypper/version.rb +1 -1
- data/lib/chef/provider/package/zypper.rb +5 -5
- data/lib/chef/provider/package.rb +2 -2
- data/lib/chef/provider/powershell_script.rb +85 -85
- data/lib/chef/provider/registry_key.rb +2 -1
- data/lib/chef/provider/remote_directory.rb +6 -6
- data/lib/chef/provider/remote_file/cache_control_data.rb +1 -1
- data/lib/chef/provider/remote_file/content.rb +1 -1
- data/lib/chef/provider/remote_file/fetcher.rb +1 -1
- data/lib/chef/provider/remote_file/http.rb +2 -3
- data/lib/chef/provider/remote_file.rb +2 -2
- data/lib/chef/provider/route.rb +10 -10
- data/lib/chef/provider/ruby_block.rb +1 -1
- data/lib/chef/provider/script.rb +8 -8
- data/lib/chef/provider/service/aix.rb +2 -2
- data/lib/chef/provider/service/aixinit.rb +6 -6
- data/lib/chef/provider/service/arch.rb +6 -6
- data/lib/chef/provider/service/debian.rb +8 -8
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +6 -6
- data/lib/chef/provider/service/init.rb +3 -3
- data/lib/chef/provider/service/insserv.rb +3 -3
- data/lib/chef/provider/service/invokercd.rb +2 -2
- data/lib/chef/provider/service/macosx.rb +1 -1
- data/lib/chef/provider/service/openbsd.rb +7 -7
- data/lib/chef/provider/service/redhat.rb +6 -6
- data/lib/chef/provider/service/solaris.rb +3 -3
- data/lib/chef/provider/service/systemd.rb +3 -3
- data/lib/chef/provider/service/upstart.rb +3 -3
- data/lib/chef/provider/service/windows.rb +1 -1
- data/lib/chef/provider/service.rb +1 -1
- data/lib/chef/provider/subversion.rb +10 -10
- data/lib/chef/provider/systemd_unit.rb +3 -3
- data/lib/chef/provider/template/content.rb +1 -1
- data/lib/chef/provider/template.rb +2 -2
- data/lib/chef/provider/template_finder.rb +1 -1
- data/lib/chef/provider/user/aix.rb +4 -4
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/provider/user/linux.rb +8 -3
- data/lib/chef/provider/user/mac.rb +2 -2
- data/lib/chef/provider/user/pw.rb +4 -4
- data/lib/chef/provider/user/solaris.rb +8 -8
- data/lib/chef/provider/user.rb +7 -4
- data/lib/chef/provider/windows_script.rb +2 -2
- data/lib/chef/provider/yum_repository.rb +2 -4
- data/lib/chef/provider/zypper_repository.rb +2 -2
- data/lib/chef/provider.rb +1 -1
- data/lib/chef/providers.rb +3 -1
- data/lib/chef/pwsh.rb +1 -1
- data/lib/chef/recipe.rb +9 -6
- data/lib/chef/request_id.rb +1 -1
- data/lib/chef/resource/_rest_resource.rb +158 -15
- data/lib/chef/resource/action_class.rb +1 -1
- data/lib/chef/resource/alternatives.rb +44 -43
- data/lib/chef/resource/apt_package.rb +38 -33
- data/lib/chef/resource/apt_preference.rb +25 -24
- data/lib/chef/resource/apt_repository.rb +16 -11
- data/lib/chef/resource/apt_update.rb +5 -4
- data/lib/chef/resource/archive_file.rb +6 -40
- data/lib/chef/resource/bash.rb +132 -131
- data/lib/chef/resource/batch.rb +1 -1
- data/lib/chef/resource/bff_package.rb +18 -17
- data/lib/chef/resource/breakpoint.rb +46 -45
- data/lib/chef/resource/build_essential.rb +1 -1
- data/lib/chef/resource/cab_package.rb +23 -23
- data/lib/chef/resource/chef_client_config.rb +88 -253
- data/lib/chef/resource/chef_client_cron.rb +21 -19
- data/lib/chef/resource/chef_client_hab_ca_cert.rb +141 -0
- data/lib/chef/resource/chef_client_launchd.rb +6 -2
- data/lib/chef/resource/chef_client_scheduled_task.rb +35 -32
- data/lib/chef/resource/chef_client_systemd_timer.rb +21 -18
- data/lib/chef/resource/chef_client_trusted_certificate.rb +29 -29
- data/lib/chef/resource/chef_gem.rb +1 -1
- data/lib/chef/resource/chef_handler.rb +108 -108
- data/lib/chef/resource/chef_sleep.rb +3 -2
- data/lib/chef/resource/chef_vault_secret.rb +2 -2
- data/lib/chef/resource/chocolatey_config.rb +15 -15
- data/lib/chef/resource/chocolatey_feature.rb +2 -2
- data/lib/chef/resource/chocolatey_installer.rb +39 -72
- data/lib/chef/resource/chocolatey_package.rb +2 -2
- data/lib/chef/resource/chocolatey_source.rb +16 -16
- data/lib/chef/resource/conditional.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +3 -2
- data/lib/chef/resource/cron/_cron_shared.rb +1 -1
- data/lib/chef/resource/cron/cron.rb +72 -71
- data/lib/chef/resource/cron/cron_d.rb +3 -2
- data/lib/chef/resource/cron_access.rb +3 -2
- data/lib/chef/resource/csh.rb +3 -2
- data/lib/chef/resource/directory.rb +4 -3
- data/lib/chef/resource/dmg_package.rb +1 -1
- data/lib/chef/resource/dnf_package.rb +2 -2
- data/lib/chef/resource/dpkg_package.rb +9 -6
- data/lib/chef/resource/dsc_resource.rb +1 -1
- data/lib/chef/resource/dsc_script.rb +1 -1
- data/lib/chef/resource/execute.rb +8 -1
- data/lib/chef/resource/file/verification/json.rb +1 -1
- data/lib/chef/resource/file/verification/systemd_unit.rb +5 -2
- data/lib/chef/resource/file/verification/yaml.rb +2 -2
- data/lib/chef/resource/file/verification.rb +4 -1
- data/lib/chef/resource/file.rb +3 -2
- data/lib/chef/resource/freebsd_package.rb +4 -3
- data/lib/chef/resource/gem_package.rb +1 -1
- data/lib/chef/resource/group.rb +33 -30
- data/lib/chef/resource/habitat/_habitat_shared.rb +1 -1
- data/lib/chef/resource/habitat/habitat_package.rb +84 -82
- data/lib/chef/resource/habitat/habitat_sup.rb +98 -97
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +14 -13
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +5 -4
- data/lib/chef/resource/habitat_config.rb +38 -24
- data/lib/chef/resource/habitat_install.rb +22 -22
- data/lib/chef/resource/habitat_service.rb +10 -6
- data/lib/chef/resource/habitat_user_toml.rb +12 -12
- data/lib/chef/resource/helpers/cron_validations.rb +1 -1
- data/lib/chef/resource/helpers/path_helpers.rb +52 -0
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +21 -21
- data/lib/chef/resource/homebrew_tap.rb +10 -2
- data/lib/chef/resource/homebrew_update.rb +1 -1
- data/lib/chef/resource/hostname.rb +14 -11
- data/lib/chef/resource/http_request.rb +5 -4
- data/lib/chef/resource/ifconfig.rb +36 -35
- data/lib/chef/resource/inspec_input.rb +42 -39
- data/lib/chef/resource/inspec_waiver.rb +66 -65
- data/lib/chef/resource/inspec_waiver_file_entry.rb +28 -27
- data/lib/chef/resource/ips_package.rb +4 -3
- data/lib/chef/resource/kernel_module.rb +4 -3
- data/lib/chef/resource/ksh.rb +3 -2
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/link.rb +4 -3
- data/lib/chef/resource/locale.rb +11 -10
- data/lib/chef/resource/log.rb +3 -1
- data/lib/chef/resource/lwrp_base.rb +1 -1
- data/lib/chef/resource/macos_pkg.rb +1 -1
- data/lib/chef/resource/macos_userdefaults.rb +1 -1
- data/lib/chef/resource/macports_package.rb +1 -1
- data/lib/chef/resource/mdadm.rb +33 -33
- data/lib/chef/resource/mount.rb +7 -5
- data/lib/chef/resource/msu_package.rb +2 -2
- data/lib/chef/resource/notify_group.rb +3 -2
- data/lib/chef/resource/ohai.rb +37 -36
- data/lib/chef/resource/ohai_hint.rb +27 -26
- data/lib/chef/resource/openbsd_package.rb +4 -3
- data/lib/chef/resource/openssl_dhparam.rb +1 -1
- data/lib/chef/resource/openssl_ec_private_key.rb +2 -2
- data/lib/chef/resource/openssl_ec_public_key.rb +3 -3
- data/lib/chef/resource/openssl_rsa_private_key.rb +2 -2
- data/lib/chef/resource/openssl_rsa_public_key.rb +3 -3
- data/lib/chef/resource/openssl_x509_certificate.rb +7 -3
- data/lib/chef/resource/openssl_x509_crl.rb +16 -16
- data/lib/chef/resource/openssl_x509_request.rb +3 -3
- data/lib/chef/resource/package.rb +4 -3
- data/lib/chef/resource/pacman_package.rb +2 -1
- data/lib/chef/resource/paludis_package.rb +3 -2
- data/lib/chef/resource/perl.rb +3 -2
- data/lib/chef/resource/plist.rb +4 -4
- data/lib/chef/resource/portage_package.rb +3 -2
- data/lib/chef/resource/powershell_package.rb +1 -1
- data/lib/chef/resource/powershell_package_source.rb +12 -12
- data/lib/chef/resource/powershell_script.rb +1 -1
- data/lib/chef/resource/python.rb +3 -2
- data/lib/chef/resource/reboot.rb +3 -2
- data/lib/chef/resource/registry_key.rb +78 -83
- data/lib/chef/resource/remote_directory.rb +3 -2
- data/lib/chef/resource/remote_file.rb +74 -73
- data/lib/chef/resource/resource_notification.rb +1 -1
- data/lib/chef/resource/rhsm_errata.rb +3 -2
- data/lib/chef/resource/rhsm_errata_level.rb +3 -2
- data/lib/chef/resource/rhsm_register.rb +14 -5
- data/lib/chef/resource/rhsm_repo.rb +5 -5
- data/lib/chef/resource/rhsm_subscription.rb +10 -10
- data/lib/chef/resource/route.rb +2 -1
- data/lib/chef/resource/rpm_package.rb +3 -2
- data/lib/chef/resource/ruby.rb +4 -2
- data/lib/chef/resource/ruby_block.rb +3 -1
- data/lib/chef/resource/scm/_scm.rb +1 -1
- data/lib/chef/resource/scm/git.rb +82 -81
- data/lib/chef/resource/scm/subversion.rb +12 -11
- data/lib/chef/resource/script.rb +4 -2
- data/lib/chef/resource/selinux/common_helpers.rb +1 -1
- data/lib/chef/resource/selinux/selinux_debian.erb +1 -1
- data/lib/chef/resource/selinux/selinux_default.erb +1 -1
- data/lib/chef/resource/selinux_boolean.rb +14 -13
- data/lib/chef/resource/selinux_fcontext.rb +23 -22
- data/lib/chef/resource/selinux_install.rb +20 -19
- data/lib/chef/resource/selinux_login.rb +13 -12
- data/lib/chef/resource/selinux_module.rb +20 -19
- data/lib/chef/resource/selinux_permissive.rb +10 -9
- data/lib/chef/resource/selinux_port.rb +17 -16
- data/lib/chef/resource/selinux_state.rb +29 -28
- data/lib/chef/resource/selinux_user.rb +16 -15
- data/lib/chef/resource/service.rb +9 -6
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/snap_package.rb +32 -23
- data/lib/chef/resource/solaris_package.rb +3 -2
- data/lib/chef/resource/ssh_known_hosts_entry.rb +13 -12
- data/lib/chef/resource/sudo.rb +71 -70
- data/lib/chef/resource/swap_file.rb +20 -19
- data/lib/chef/resource/sysctl.rb +49 -48
- data/lib/chef/resource/systemd_unit.rb +42 -39
- data/lib/chef/resource/template.rb +3 -2
- data/lib/chef/resource/timezone.rb +23 -22
- data/lib/chef/resource/user/aix_user.rb +4 -3
- data/lib/chef/resource/user/linux_user.rb +4 -4
- data/lib/chef/resource/user/mac_user.rb +5 -4
- data/lib/chef/resource/user/pw_user.rb +4 -3
- data/lib/chef/resource/user/solaris_user.rb +4 -3
- data/lib/chef/resource/user/windows_user.rb +2 -1
- data/lib/chef/resource/user.rb +8 -7
- data/lib/chef/resource/user_ulimit.rb +25 -24
- data/lib/chef/resource/windows_ad_join.rb +23 -23
- data/lib/chef/resource/windows_audit_policy.rb +35 -35
- data/lib/chef/resource/windows_auto_run.rb +9 -9
- data/lib/chef/resource/windows_certificate.rb +21 -21
- data/lib/chef/resource/windows_defender.rb +23 -23
- data/lib/chef/resource/windows_defender_exclusion.rb +18 -18
- data/lib/chef/resource/windows_dfs_folder.rb +1 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
- data/lib/chef/resource/windows_dfs_server.rb +1 -1
- data/lib/chef/resource/windows_dns_record.rb +1 -1
- data/lib/chef/resource/windows_dns_zone.rb +1 -1
- data/lib/chef/resource/windows_env.rb +6 -6
- data/lib/chef/resource/windows_feature.rb +43 -43
- data/lib/chef/resource/windows_feature_dism.rb +9 -9
- data/lib/chef/resource/windows_feature_powershell.rb +21 -21
- data/lib/chef/resource/windows_firewall_profile.rb +29 -29
- data/lib/chef/resource/windows_firewall_rule.rb +48 -48
- data/lib/chef/resource/windows_font.rb +7 -7
- data/lib/chef/resource/windows_package.rb +59 -59
- data/lib/chef/resource/windows_pagefile.rb +30 -30
- data/lib/chef/resource/windows_path.rb +13 -13
- data/lib/chef/resource/windows_printer.rb +29 -29
- data/lib/chef/resource/windows_printer_port.rb +22 -22
- data/lib/chef/resource/windows_script.rb +1 -1
- data/lib/chef/resource/windows_security_policy.rb +24 -24
- data/lib/chef/resource/windows_service.rb +108 -108
- data/lib/chef/resource/windows_share.rb +17 -17
- data/lib/chef/resource/windows_shortcut.rb +8 -8
- data/lib/chef/resource/windows_task.rb +104 -106
- data/lib/chef/resource/windows_uac.rb +15 -15
- data/lib/chef/resource/windows_update_settings.rb +27 -27
- data/lib/chef/resource/windows_user_privilege.rb +59 -59
- data/lib/chef/resource/windows_workgroup.rb +11 -11
- data/lib/chef/resource/yum_package.rb +6 -5
- data/lib/chef/resource/yum_repository.rb +39 -38
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource/zypper_repository.rb +4 -3
- data/lib/chef/resource.rb +11 -3
- data/lib/chef/resource_builder.rb +1 -1
- data/lib/chef/resource_collection/resource_collection_serialization.rb +1 -1
- data/lib/chef/resource_collection/resource_list.rb +1 -1
- data/lib/chef/resource_collection/resource_set.rb +10 -4
- data/lib/chef/resource_collection.rb +1 -1
- data/lib/chef/resource_definition.rb +1 -1
- data/lib/chef/resource_definition_list.rb +1 -1
- data/lib/chef/resource_inspector.rb +3 -1
- data/lib/chef/resource_reporter.rb +2 -1
- data/lib/chef/resource_resolver.rb +1 -1
- data/lib/chef/resources.rb +2 -2
- data/lib/chef/role.rb +1 -1
- data/lib/chef/run_context/cookbook_compiler.rb +1 -1
- data/lib/chef/run_context.rb +2 -2
- data/lib/chef/run_list/run_list_expansion.rb +1 -1
- data/lib/chef/run_list/run_list_item.rb +5 -5
- data/lib/chef/run_list/versioned_recipe_list.rb +1 -1
- data/lib/chef/run_list.rb +1 -1
- data/lib/chef/run_lock.rb +4 -1
- data/lib/chef/run_status.rb +1 -1
- data/lib/chef/runner.rb +1 -1
- data/lib/chef/scan_access_control.rb +9 -7
- data/lib/chef/search/query.rb +1 -1
- data/lib/chef/secret_fetcher/akeyless_vault.rb +1 -1
- data/lib/chef/secret_fetcher/aws_secrets_manager.rb +1 -1
- data/lib/chef/secret_fetcher/base.rb +1 -1
- data/lib/chef/secret_fetcher/example.rb +1 -1
- data/lib/chef/secret_fetcher/hashi_vault.rb +10 -1
- data/lib/chef/secret_fetcher.rb +1 -1
- data/lib/chef/server_api.rb +1 -1
- data/lib/chef/server_api_versions.rb +1 -1
- data/lib/chef/shell/ext.rb +20 -20
- data/lib/chef/shell/model_wrapper.rb +1 -1
- data/lib/chef/shell/shell_session.rb +2 -2
- data/lib/chef/shell.rb +30 -15
- data/lib/chef/target_io/dir.rb +12 -0
- data/lib/chef/target_io/etc.rb +16 -0
- data/lib/chef/target_io/file.rb +12 -0
- data/lib/chef/target_io/fileutils.rb +12 -0
- data/lib/chef/target_io/http.rb +35 -0
- data/lib/chef/target_io/io.rb +12 -0
- data/lib/chef/target_io/shadow.rb +44 -0
- data/lib/chef/target_io/support.rb +73 -0
- data/lib/chef/target_io/train/dir.rb +86 -0
- data/lib/chef/target_io/train/etc.rb +108 -0
- data/lib/chef/target_io/train/file.rb +219 -0
- data/lib/chef/target_io/train/fileutils.rb +201 -0
- data/lib/chef/target_io/train/http.rb +117 -0
- data/lib/chef/target_io/train/io.rb +13 -0
- data/lib/chef/target_io/train/shadow.rb +54 -0
- data/lib/chef/target_io/train_compat.rb +7 -0
- data/lib/chef/target_io.rb +11 -0
- data/lib/chef/train_transport.rb +1 -1
- data/lib/chef/user.rb +1 -1
- data/lib/chef/user_v1.rb +1 -1
- data/lib/chef/util/backup.rb +2 -2
- data/lib/chef/util/diff.rb +15 -2
- data/lib/chef/util/dsc/configuration_generator.rb +1 -1
- data/lib/chef/util/dsc/lcm_output_parser.rb +1 -1
- data/lib/chef/util/dsc/local_configuration_manager.rb +1 -1
- data/lib/chef/util/dsc/resource_store.rb +1 -1
- data/lib/chef/util/editor.rb +1 -1
- data/lib/chef/util/file_edit.rb +5 -5
- data/lib/chef/util/path_helper.rb +1 -1
- data/lib/chef/util/powershell/ps_credential.rb +1 -1
- data/lib/chef/util/selinux.rb +1 -1
- data/lib/chef/util/threaded_job_queue.rb +1 -1
- data/lib/chef/util/windows/logon_session.rb +1 -1
- data/lib/chef/version.rb +2 -2
- data/lib/chef/version_class.rb +1 -1
- data/lib/chef/version_constraint.rb +2 -2
- data/lib/chef/win32/api/command_line_helper.rb +1 -1
- data/lib/chef/win32/api/crypto.rb +1 -1
- data/lib/chef/win32/api/error.rb +1 -1
- data/lib/chef/win32/api/file.rb +3 -2
- data/lib/chef/win32/api/installer.rb +1 -1
- data/lib/chef/win32/api/memory.rb +1 -1
- data/lib/chef/win32/api/net.rb +1 -1
- data/lib/chef/win32/api/process.rb +1 -1
- data/lib/chef/win32/api/psapi.rb +1 -1
- data/lib/chef/win32/api/registry.rb +1 -1
- data/lib/chef/win32/api/security.rb +1 -1
- data/lib/chef/win32/api/synchronization.rb +1 -1
- data/lib/chef/win32/api/system.rb +1 -1
- data/lib/chef/win32/api/unicode.rb +1 -1
- data/lib/chef/win32/api.rb +1 -1
- data/lib/chef/win32/crypto.rb +1 -1
- data/lib/chef/win32/error.rb +3 -2
- data/lib/chef/win32/eventlog.rb +1 -1
- data/lib/chef/win32/file/info.rb +1 -1
- data/lib/chef/win32/file/version_info.rb +1 -1
- data/lib/chef/win32/file.rb +1 -1
- data/lib/chef/win32/handle.rb +1 -1
- data/lib/chef/win32/memory.rb +1 -1
- data/lib/chef/win32/mutex.rb +1 -1
- data/lib/chef/win32/net.rb +1 -1
- data/lib/chef/win32/process.rb +1 -1
- data/lib/chef/win32/registry.rb +4 -2
- data/lib/chef/win32/security/ace.rb +1 -1
- data/lib/chef/win32/security/acl.rb +1 -1
- data/lib/chef/win32/security/securable_object.rb +1 -1
- data/lib/chef/win32/security/security_descriptor.rb +1 -1
- data/lib/chef/win32/security/sid.rb +1 -1
- data/lib/chef/win32/security/token.rb +1 -1
- data/lib/chef/win32/security.rb +1 -1
- data/lib/chef/win32/system.rb +1 -1
- data/lib/chef/win32/unicode.rb +1 -1
- data/lib/chef/win32/version.rb +2 -3
- data/lib/chef/workstation_config_loader.rb +1 -1
- data/lib/chef.rb +3 -1
- metadata +136 -120
- data/lib/chef/monkey_patches/reline-windows.rb +0 -116
- data/lib/chef/resource/osx_profile.rb +0 -334
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: kaustubh (<kaustubh@clogeny.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -22,7 +22,7 @@ class Chef
|
|
|
22
22
|
class Provider
|
|
23
23
|
class Service
|
|
24
24
|
class AixInit < Chef::Provider::Service::Init
|
|
25
|
-
RC_D_SCRIPT_NAME = %r{/etc/rc.d/rc2.d/([SK])(\d\d|)}i
|
|
25
|
+
RC_D_SCRIPT_NAME = %r{/etc/rc.d/rc2.d/([SK])(\d\d|)}i
|
|
26
26
|
|
|
27
27
|
def initialize(new_resource, run_context)
|
|
28
28
|
super
|
|
@@ -57,7 +57,7 @@ class Chef
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def enable_service
|
|
60
|
-
Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f) }
|
|
60
|
+
TargetIO::Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f) }
|
|
61
61
|
|
|
62
62
|
if @new_resource.priority.is_a? Integer
|
|
63
63
|
create_symlink(2, "S", @new_resource.priority)
|
|
@@ -72,7 +72,7 @@ class Chef
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def disable_service
|
|
75
|
-
Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f) }
|
|
75
|
+
TargetIO::Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"]).each { |f| ::File.delete(f) }
|
|
76
76
|
|
|
77
77
|
if @new_resource.priority.is_a? Integer
|
|
78
78
|
create_symlink(2, "K", 100 - @new_resource.priority)
|
|
@@ -86,13 +86,13 @@ class Chef
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def create_symlink(run_level, status, priority)
|
|
89
|
-
::File.symlink("/etc/rc.d/init.d/#{@new_resource.service_name}", "/etc/rc.d/rc#{run_level}.d/#{status}#{priority}#{@new_resource.service_name}")
|
|
89
|
+
::TargetIO::File.symlink("/etc/rc.d/init.d/#{@new_resource.service_name}", "/etc/rc.d/rc#{run_level}.d/#{status}#{priority}#{@new_resource.service_name}")
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def set_current_resource_attributes
|
|
93
93
|
# assuming run level 2 for aix
|
|
94
94
|
is_enabled = false
|
|
95
|
-
files = Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"])
|
|
95
|
+
files = TargetIO::Dir.glob(["/etc/rc.d/rc2.d/[SK][0-9][0-9]#{@new_resource.service_name}", "/etc/rc.d/rc2.d/[SK]#{@new_resource.service_name}"])
|
|
96
96
|
|
|
97
97
|
priority = {}
|
|
98
98
|
|
|
@@ -20,7 +20,7 @@ require_relative "init"
|
|
|
20
20
|
|
|
21
21
|
class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
|
|
22
22
|
|
|
23
|
-
provides :service, platform_family: "arch"
|
|
23
|
+
provides :service, platform_family: "arch", target_mode: true
|
|
24
24
|
|
|
25
25
|
def self.supports?(resource, action)
|
|
26
26
|
service_script_exist?(:etc_rcd, resource.service_name)
|
|
@@ -32,8 +32,8 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def load_current_resource
|
|
35
|
-
raise Chef::Exceptions::Service, "Could not find /etc/rc.conf" unless ::File.exist?("/etc/rc.conf")
|
|
36
|
-
raise Chef::Exceptions::Service, "No DAEMONS found in /etc/rc.conf" unless /DAEMONS=\((.*)\)/m.match?(::File.read("/etc/rc.conf"))
|
|
35
|
+
raise Chef::Exceptions::Service, "Could not find /etc/rc.conf" unless ::TargetIO::File.exist?("/etc/rc.conf")
|
|
36
|
+
raise Chef::Exceptions::Service, "No DAEMONS found in /etc/rc.conf" unless /DAEMONS=\((.*)\)/m.match?(::TargetIO::File.read("/etc/rc.conf"))
|
|
37
37
|
|
|
38
38
|
super
|
|
39
39
|
|
|
@@ -50,7 +50,7 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
|
|
|
50
50
|
# )
|
|
51
51
|
def daemons
|
|
52
52
|
entries = []
|
|
53
|
-
if ::File.read("/etc/rc.conf") =~ /DAEMONS=\((.*)\)/m
|
|
53
|
+
if ::TargetIO::File.read("/etc/rc.conf") =~ /DAEMONS=\((.*)\)/m
|
|
54
54
|
entries += $1.gsub(/\\?[\r\n]/, " ").gsub(/# *[^ ]+/, " ").split(" ") if $1.length > 0
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -61,8 +61,8 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init
|
|
|
61
61
|
|
|
62
62
|
# FIXME: Multiple entries of DAEMONS will cause very bad results :)
|
|
63
63
|
def update_daemons(entries)
|
|
64
|
-
content = ::File.read("/etc/rc.conf").gsub(/DAEMONS=\((.*)\)/m, "DAEMONS=(#{entries.join(" ")})")
|
|
65
|
-
::File.open("/etc/rc.conf", "w") do |f|
|
|
64
|
+
content = ::TargetIO::File.read("/etc/rc.conf").gsub(/DAEMONS=\((.*)\)/m, "DAEMONS=(#{entries.join(" ")})")
|
|
65
|
+
::TargetIO::File.open("/etc/rc.conf", "w") do |f|
|
|
66
66
|
f.write(content)
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -22,12 +22,12 @@ class Chef
|
|
|
22
22
|
class Provider
|
|
23
23
|
class Service
|
|
24
24
|
class Debian < Chef::Provider::Service::Init
|
|
25
|
-
provides :service, platform_family: "debian" do
|
|
25
|
+
provides :service, platform_family: "debian", target_mode: true do
|
|
26
26
|
debianrcd?
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
UPDATE_RC_D_ENABLED_MATCHES = %r{/rc[\dS].d/S|not installed}i
|
|
30
|
-
UPDATE_RC_D_PRIORITIES = %r{/rc([\dS]).d/([SK])(\d\d)}i
|
|
29
|
+
UPDATE_RC_D_ENABLED_MATCHES = %r{/rc[\dS].d/S|not installed}i
|
|
30
|
+
UPDATE_RC_D_PRIORITIES = %r{/rc([\dS]).d/([SK])(\d\d)}i
|
|
31
31
|
RUNLEVELS = %w{ 1 2 3 4 5 S }.freeze
|
|
32
32
|
|
|
33
33
|
def self.supports?(resource, action)
|
|
@@ -46,7 +46,7 @@ class Chef
|
|
|
46
46
|
shared_resource_requirements
|
|
47
47
|
requirements.assert(:all_actions) do |a|
|
|
48
48
|
update_rcd = "/usr/sbin/update-rc.d"
|
|
49
|
-
a.assertion { ::File.exist? update_rcd }
|
|
49
|
+
a.assertion { ::TargetIO::File.exist? update_rcd }
|
|
50
50
|
a.failure_message Chef::Exceptions::Service, "#{update_rcd} does not exist!"
|
|
51
51
|
# no whyrun recovery - this is a base system component of debian
|
|
52
52
|
# distros and must be present
|
|
@@ -73,10 +73,10 @@ class Chef
|
|
|
73
73
|
|
|
74
74
|
# returns a list of levels that the service should be stopped or started on
|
|
75
75
|
def parse_init_file(path)
|
|
76
|
-
return [] unless ::File.exist?(path)
|
|
76
|
+
return [] unless ::TargetIO::File.exist?(path)
|
|
77
77
|
|
|
78
78
|
in_info = false
|
|
79
|
-
::File.readlines(path).each_with_object([]) do |line, acc|
|
|
79
|
+
::TargetIO::File.readlines(path).each_with_object([]) do |line, acc|
|
|
80
80
|
if /^### BEGIN INIT INFO/.match?(line)
|
|
81
81
|
in_info = true
|
|
82
82
|
elsif /^### END INIT INFO/.match?(line)
|
|
@@ -93,7 +93,7 @@ class Chef
|
|
|
93
93
|
priority = {}
|
|
94
94
|
levels = parse_init_file(@init_command)
|
|
95
95
|
rc_files = levels.map do |level|
|
|
96
|
-
Dir.glob("/etc/rc#{level}.d/[SK][0-9][0-9]#{current_resource.service_name}")
|
|
96
|
+
TargetIO::Dir.glob("/etc/rc#{level}.d/[SK][0-9][0-9]#{current_resource.service_name}")
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
rc_files.flatten.each do |line|
|
|
@@ -26,7 +26,7 @@ class Chef
|
|
|
26
26
|
|
|
27
27
|
attr_reader :enabled_state_found
|
|
28
28
|
|
|
29
|
-
provides :service, os: %w{freebsd netbsd}
|
|
29
|
+
provides :service, os: %w{freebsd netbsd}, target_mode: true
|
|
30
30
|
|
|
31
31
|
include Chef::Mixin::ShellOut
|
|
32
32
|
|
|
@@ -34,9 +34,9 @@ class Chef
|
|
|
34
34
|
super
|
|
35
35
|
@enabled_state_found = false
|
|
36
36
|
@init_command = nil
|
|
37
|
-
if ::File.exist?("/etc/rc.d/#{new_resource.service_name}")
|
|
37
|
+
if ::TargetIO::File.exist?("/etc/rc.d/#{new_resource.service_name}")
|
|
38
38
|
@init_command = "/etc/rc.d/#{new_resource.service_name}"
|
|
39
|
-
elsif ::File.exist?("/usr/local/etc/rc.d/#{new_resource.service_name}")
|
|
39
|
+
elsif ::TargetIO::File.exist?("/usr/local/etc/rc.d/#{new_resource.service_name}")
|
|
40
40
|
@init_command = "/usr/local/etc/rc.d/#{new_resource.service_name}"
|
|
41
41
|
end
|
|
42
42
|
end
|
|
@@ -118,11 +118,11 @@ class Chef
|
|
|
118
118
|
private
|
|
119
119
|
|
|
120
120
|
def read_rc_conf
|
|
121
|
-
::File.open("/etc/rc.conf", "r", &:readlines)
|
|
121
|
+
::TargetIO::File.open("/etc/rc.conf", "r", &:readlines)
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
def write_rc_conf(lines)
|
|
125
|
-
::File.open("/etc/rc.conf", "w") do |file|
|
|
125
|
+
::TargetIO::File.open("/etc/rc.conf", "w") do |file|
|
|
126
126
|
lines.each { |line| file.puts(line) }
|
|
127
127
|
end
|
|
128
128
|
end
|
|
@@ -131,7 +131,7 @@ class Chef
|
|
|
131
131
|
def service_enable_variable_name
|
|
132
132
|
@service_enable_variable_name ||=
|
|
133
133
|
if init_command
|
|
134
|
-
::File.open(init_command) do |rcscript|
|
|
134
|
+
::TargetIO::File.open(init_command) do |rcscript|
|
|
135
135
|
rcscript.each_line do |line|
|
|
136
136
|
if line =~ /^name="?(\w+)"?/
|
|
137
137
|
return $1 + "_enable"
|
|
@@ -150,7 +150,7 @@ class Chef
|
|
|
150
150
|
|
|
151
151
|
def determine_enabled_status!
|
|
152
152
|
var_name = service_enable_variable_name
|
|
153
|
-
if ::File.exist?("/etc/rc.conf") && var_name
|
|
153
|
+
if ::TargetIO::File.exist?("/etc/rc.conf") && var_name
|
|
154
154
|
read_rc_conf.each do |line|
|
|
155
155
|
case line
|
|
156
156
|
when /^#{Regexp.escape(var_name)}="(\w+)"/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Lee Jensen (<ljensen@engineyard.com>)
|
|
3
3
|
# Author:: AJ Christensen (<aj@chef.io>)
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -22,7 +22,7 @@ require_relative "../../util/path_helper"
|
|
|
22
22
|
|
|
23
23
|
class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
|
|
24
24
|
|
|
25
|
-
provides :service, platform_family: "gentoo"
|
|
25
|
+
provides :service, platform_family: "gentoo", target_mode: true
|
|
26
26
|
|
|
27
27
|
def load_current_resource
|
|
28
28
|
supports[:status] = true if supports[:status].nil?
|
|
@@ -32,10 +32,10 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
|
|
|
32
32
|
super
|
|
33
33
|
|
|
34
34
|
@current_resource.enabled(
|
|
35
|
-
Dir.glob("/etc/runlevels/**/#{Chef::Util::PathHelper.escape_glob_dir(@current_resource.service_name)}").any? do |file|
|
|
35
|
+
TargetIO::Dir.glob("/etc/runlevels/**/#{Chef::Util::PathHelper.escape_glob_dir(@current_resource.service_name)}").any? do |file|
|
|
36
36
|
@found_script = true
|
|
37
|
-
exists = ::File.exist? file
|
|
38
|
-
readable = ::File.readable? file
|
|
37
|
+
exists = ::TargetIO::File.exist? file
|
|
38
|
+
readable = ::TargetIO::File.readable? file
|
|
39
39
|
logger.trace "#{@new_resource} exists: #{exists}, readable: #{readable}"
|
|
40
40
|
exists && readable
|
|
41
41
|
end
|
|
@@ -47,7 +47,7 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
|
|
|
47
47
|
|
|
48
48
|
def define_resource_requirements
|
|
49
49
|
requirements.assert(:all_actions) do |a|
|
|
50
|
-
a.assertion { ::File.exist?("/sbin/rc-update") }
|
|
50
|
+
a.assertion { ::TargetIO::File.exist?("/sbin/rc-update") }
|
|
51
51
|
a.failure_message Chef::Exceptions::Service, "/sbin/rc-update does not exist"
|
|
52
52
|
# no whyrun recovery -t his is a core component whose presence is
|
|
53
53
|
# unlikely to be affected by what we do in the course of a chef run
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -26,7 +26,7 @@ class Chef
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :init_command
|
|
28
28
|
|
|
29
|
-
provides :service, os: "!windows"
|
|
29
|
+
provides :service, os: "!windows", target_mode: true
|
|
30
30
|
|
|
31
31
|
def self.supports?(resource, action)
|
|
32
32
|
service_script_exist?(:initd, resource.service_name)
|
|
@@ -42,7 +42,7 @@ class Chef
|
|
|
42
42
|
shared_resource_requirements
|
|
43
43
|
requirements.assert(:start, :stop, :restart, :reload) do |a|
|
|
44
44
|
a.assertion do
|
|
45
|
-
custom_command_for_action?(action) || ::File.exist?(default_init_command)
|
|
45
|
+
custom_command_for_action?(action) || ::TargetIO::File.exist?(default_init_command)
|
|
46
46
|
end
|
|
47
47
|
a.failure_message(Chef::Exceptions::Service, "#{default_init_command} does not exist!")
|
|
48
48
|
a.whyrun("Init script '#{default_init_command}' doesn't exist, assuming a prior action would have created it.") do
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Bryan McLellan <btm@loftninjas.org>
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -24,7 +24,7 @@ class Chef
|
|
|
24
24
|
class Service
|
|
25
25
|
class Insserv < Chef::Provider::Service::Init
|
|
26
26
|
|
|
27
|
-
provides :service, platform_family: %w{debian rhel fedora suse amazon} do
|
|
27
|
+
provides :service, platform_family: %w{debian rhel fedora suse amazon}, target_mode: true do
|
|
28
28
|
insserv?
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -38,7 +38,7 @@ class Chef
|
|
|
38
38
|
# Look for a /etc/rc.*/SnnSERVICE link to signify that the service would be started in a runlevel
|
|
39
39
|
service_name = Chef::Util::PathHelper.escape_glob_dir(current_resource.service_name)
|
|
40
40
|
|
|
41
|
-
if Dir.glob("/etc/rc*/**/S*#{service_name}").empty?
|
|
41
|
+
if TargetIO::Dir.glob("/etc/rc*/**/S*#{service_name}").empty?
|
|
42
42
|
current_resource.enabled false
|
|
43
43
|
else
|
|
44
44
|
current_resource.enabled true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,7 +23,7 @@ class Chef
|
|
|
23
23
|
class Service
|
|
24
24
|
class Invokercd < Chef::Provider::Service::Init
|
|
25
25
|
|
|
26
|
-
provides :service, platform_family: "debian", override: true do
|
|
26
|
+
provides :service, platform_family: "debian", override: true, target_mode: true do
|
|
27
27
|
invokercd?
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Igor Afonov <afonov@gmail.com>
|
|
3
3
|
# Copyright:: Copyright 2011-2016, Igor Afonov
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -24,7 +24,7 @@ class Chef
|
|
|
24
24
|
class Service
|
|
25
25
|
class Openbsd < Chef::Provider::Service::Init
|
|
26
26
|
|
|
27
|
-
provides :service, os: "openbsd"
|
|
27
|
+
provides :service, os: "openbsd", target_mode: true
|
|
28
28
|
|
|
29
29
|
attr_reader :init_command, :rc_conf, :rc_conf_local, :enabled_state_found
|
|
30
30
|
|
|
@@ -33,9 +33,9 @@ class Chef
|
|
|
33
33
|
|
|
34
34
|
def initialize(new_resource, run_context)
|
|
35
35
|
super
|
|
36
|
-
@rc_conf = ::File.read(RC_CONF_PATH) rescue ""
|
|
37
|
-
@rc_conf_local = ::File.read(RC_CONF_LOCAL_PATH) rescue ""
|
|
38
|
-
@init_command = ::File.exist?(rcd_script_path) ? rcd_script_path : nil
|
|
36
|
+
@rc_conf = ::TargetIO::File.read(RC_CONF_PATH) rescue ""
|
|
37
|
+
@rc_conf_local = ::TargetIO::File.read(RC_CONF_LOCAL_PATH) rescue ""
|
|
38
|
+
@init_command = ::TargetIO::File.exist?(rcd_script_path) ? rcd_script_path : nil
|
|
39
39
|
new_resource.status_command("#{default_init_command} check")
|
|
40
40
|
end
|
|
41
41
|
|
|
@@ -129,8 +129,8 @@ class Chef
|
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
def update_rcl(value)
|
|
132
|
-
FileUtils.touch RC_CONF_LOCAL_PATH unless ::File.exist? RC_CONF_LOCAL_PATH
|
|
133
|
-
::File.write(RC_CONF_LOCAL_PATH, value)
|
|
132
|
+
TargetIO::FileUtils.touch RC_CONF_LOCAL_PATH unless ::TargetIO::File.exist? RC_CONF_LOCAL_PATH
|
|
133
|
+
::TargetIO::File.write(RC_CONF_LOCAL_PATH, value)
|
|
134
134
|
@rc_conf_local = value
|
|
135
135
|
end
|
|
136
136
|
|
|
@@ -139,7 +139,7 @@ class Chef
|
|
|
139
139
|
@bsevn ||= begin
|
|
140
140
|
result = nil
|
|
141
141
|
if rcd_script_found?
|
|
142
|
-
::File.open(init_command) do |rcscript|
|
|
142
|
+
::TargetIO::File.open(init_command) do |rcscript|
|
|
143
143
|
if m = rcscript.read.match(/^# \$OpenBSD: (\w+)[(.rc),]?/)
|
|
144
144
|
result = m[1] + "_flags"
|
|
145
145
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -28,12 +28,12 @@ class Chef
|
|
|
28
28
|
# @api private
|
|
29
29
|
attr_accessor :current_run_levels
|
|
30
30
|
|
|
31
|
-
provides :service, platform_family: "rpm_based" do
|
|
31
|
+
provides :service, platform_family: "rpm_based", target_mode: true do
|
|
32
32
|
redhatrcd?
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
CHKCONFIG_ON = /\d:on
|
|
36
|
-
CHKCONFIG_MISSING = /No such
|
|
35
|
+
CHKCONFIG_ON = /\d:on/
|
|
36
|
+
CHKCONFIG_MISSING = /No such/
|
|
37
37
|
|
|
38
38
|
def self.supports?(resource, action)
|
|
39
39
|
service_script_exist?(:initd, resource.service_name)
|
|
@@ -56,7 +56,7 @@ class Chef
|
|
|
56
56
|
|
|
57
57
|
requirements.assert(:all_actions) do |a|
|
|
58
58
|
chkconfig_file = "/sbin/chkconfig"
|
|
59
|
-
a.assertion { ::File.exist? chkconfig_file }
|
|
59
|
+
a.assertion { ::TargetIO::File.exist? chkconfig_file }
|
|
60
60
|
a.failure_message Chef::Exceptions::Service, "#{chkconfig_file} does not exist!"
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -80,7 +80,7 @@ class Chef
|
|
|
80
80
|
|
|
81
81
|
super
|
|
82
82
|
|
|
83
|
-
if ::File.exist?("/sbin/chkconfig")
|
|
83
|
+
if ::TargetIO::File.exist?("/sbin/chkconfig")
|
|
84
84
|
chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", returns: [0, 1])
|
|
85
85
|
unless run_levels.nil? || run_levels.empty?
|
|
86
86
|
all_levels_match = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Toomas Pelberg (<toomasp@gmx.net>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -25,7 +25,7 @@ class Chef
|
|
|
25
25
|
class Solaris < Chef::Provider::Service
|
|
26
26
|
attr_reader :maintenance
|
|
27
27
|
|
|
28
|
-
provides :service, os: "solaris2"
|
|
28
|
+
provides :service, os: "solaris2", target_mode: true
|
|
29
29
|
|
|
30
30
|
def initialize(new_resource, run_context = nil)
|
|
31
31
|
super
|
|
@@ -39,7 +39,7 @@ class Chef
|
|
|
39
39
|
@current_resource.service_name(@new_resource.service_name)
|
|
40
40
|
|
|
41
41
|
[@init_command, @status_command].each do |cmd|
|
|
42
|
-
unless ::File.executable? cmd
|
|
42
|
+
unless ::TargetIO::File.executable? cmd
|
|
43
43
|
raise Chef::Exceptions::Service, "#{cmd} not executable!"
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Stephen Haynes (<sh@nomitor.com>)
|
|
3
3
|
# Author:: Davide Cavalca (<dcavalca@fb.com>)
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -26,7 +26,7 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple
|
|
|
26
26
|
|
|
27
27
|
include Chef::Mixin::Which
|
|
28
28
|
|
|
29
|
-
provides
|
|
29
|
+
provides(:service, os: "linux", target_mode: true) do |node|
|
|
30
30
|
systemd?
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -106,7 +106,7 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple
|
|
|
106
106
|
if new_resource.user
|
|
107
107
|
raise NotImplementedError, "#{new_resource} does not support the user property on a target_mode host (yet)" if Chef::Config.target_mode?
|
|
108
108
|
|
|
109
|
-
uid = Etc.getpwnam(new_resource.user).uid
|
|
109
|
+
uid = TargetIO::Etc.getpwnam(new_resource.user).uid
|
|
110
110
|
options = {
|
|
111
111
|
environment: {
|
|
112
112
|
"DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus",
|
|
@@ -28,7 +28,7 @@ class Chef
|
|
|
28
28
|
# to maintain a local state of service across restart's internal calls
|
|
29
29
|
attr_accessor :upstart_service_running
|
|
30
30
|
|
|
31
|
-
UPSTART_STATE_FORMAT = %r{\S+ \(?(start|stop)?\)? ?[/ ](\w+)}
|
|
31
|
+
UPSTART_STATE_FORMAT = %r{\S+ \(?(start|stop)?\)? ?[/ ](\w+)}
|
|
32
32
|
|
|
33
33
|
# Returns true if the configs for the service name has upstart variable
|
|
34
34
|
def self.supports?(resource, action)
|
|
@@ -124,9 +124,9 @@ class Chef
|
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
# Get enabled/disabled state by reading job configuration file
|
|
127
|
-
if ::File.exist?("#{@upstart_job_dir}/#{@new_resource.service_name}#{@upstart_conf_suffix}")
|
|
127
|
+
if ::TargetIO::File.exist?("#{@upstart_job_dir}/#{@new_resource.service_name}#{@upstart_conf_suffix}")
|
|
128
128
|
logger.trace("#{@new_resource} found #{@upstart_job_dir}/#{@new_resource.service_name}#{@upstart_conf_suffix}")
|
|
129
|
-
::File.open("#{@upstart_job_dir}/#{@new_resource.service_name}#{@upstart_conf_suffix}", "r") do |file|
|
|
129
|
+
::TargetIO::File.open("#{@upstart_job_dir}/#{@new_resource.service_name}#{@upstart_conf_suffix}", "r") do |file|
|
|
130
130
|
while line = file.gets
|
|
131
131
|
case line
|
|
132
132
|
when /^start on/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Nuo Yan <nuo@chef.io>
|
|
3
3
|
# Author:: Bryan McLellan <btm@loftninjas.org>
|
|
4
4
|
# Author:: Seth Chisamore <schisamo@chef.io>
|
|
5
|
-
# Copyright:: Copyright (c)
|
|
5
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
6
6
|
# License:: Apache License, Version 2.0
|
|
7
7
|
#
|
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@hjksolutions.com>)
|
|
3
3
|
# Author:: Davide Cavalca (<dcavalca@fb.com>)
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Daniel DeLeo (<dan@kallistec.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -27,9 +27,9 @@ class Chef
|
|
|
27
27
|
class Provider
|
|
28
28
|
class Subversion < Chef::Provider
|
|
29
29
|
|
|
30
|
-
provides :subversion
|
|
30
|
+
provides :subversion, target_mode: true
|
|
31
31
|
|
|
32
|
-
SVN_INFO_PATTERN = /^([\w\s]+): (.+)
|
|
32
|
+
SVN_INFO_PATTERN = /^([\w\s]+): (.+)$/
|
|
33
33
|
|
|
34
34
|
include ChefConfig::Mixin::FuzzyHostnameMatcher
|
|
35
35
|
|
|
@@ -48,7 +48,7 @@ class Chef
|
|
|
48
48
|
# Make sure the parent dir exists, or else fail.
|
|
49
49
|
# for why run, print a message explaining the potential error.
|
|
50
50
|
parent_directory = ::File.dirname(new_resource.destination)
|
|
51
|
-
a.assertion { ::File.directory?(parent_directory) }
|
|
51
|
+
a.assertion { ::TargetIO::File.directory?(parent_directory) }
|
|
52
52
|
a.failure_message(Chef::Exceptions::MissingParentDirectory,
|
|
53
53
|
"Cannot clone #{new_resource} to #{new_resource.destination}, the enclosing directory #{parent_directory} does not exist")
|
|
54
54
|
a.whyrun("Directory #{parent_directory} does not exist, assuming it would have been created")
|
|
@@ -81,7 +81,7 @@ class Chef
|
|
|
81
81
|
|
|
82
82
|
action :sync, description: "Update the source to the specified version, or get a new clone or checkout. This action causes a hard reset of the index and working tree, discarding any uncommitted changes." do
|
|
83
83
|
assert_target_directory_valid!
|
|
84
|
-
if ::File.exist?(::File.join(new_resource.destination, ".svn"))
|
|
84
|
+
if ::TargetIO::File.exist?(::File.join(new_resource.destination, ".svn"))
|
|
85
85
|
current_rev = find_current_revision
|
|
86
86
|
logger.trace "#{new_resource} current revision: #{current_rev} target revision: #{revision_int}"
|
|
87
87
|
unless current_revision_matches_target_revision?
|
|
@@ -134,7 +134,7 @@ class Chef
|
|
|
134
134
|
alias :revision_slug :revision_int
|
|
135
135
|
|
|
136
136
|
def find_current_revision
|
|
137
|
-
return nil unless ::File.exist?(::File.join(new_resource.destination, ".svn"))
|
|
137
|
+
return nil unless ::TargetIO::File.exist?(::File.join(new_resource.destination, ".svn"))
|
|
138
138
|
|
|
139
139
|
command = scm(:info)
|
|
140
140
|
svn_info = shell_out!(command, **run_options(cwd: cwd, returns: [0, 1])).stdout
|
|
@@ -214,7 +214,7 @@ class Chef
|
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
def target_dir_non_existent_or_empty?
|
|
217
|
-
!::File.exist?(new_resource.destination) || Dir.entries(new_resource.destination).sort == [".", ".."]
|
|
217
|
+
!::TargetIO::File.exist?(new_resource.destination) || TargetIO::Dir.entries(new_resource.destination).sort == [".", ".."]
|
|
218
218
|
end
|
|
219
219
|
|
|
220
220
|
def svn_binary
|
|
@@ -224,7 +224,7 @@ class Chef
|
|
|
224
224
|
|
|
225
225
|
def assert_target_directory_valid!
|
|
226
226
|
target_parent_directory = ::File.dirname(new_resource.destination)
|
|
227
|
-
unless ::File.directory?(target_parent_directory)
|
|
227
|
+
unless ::TargetIO::File.directory?(target_parent_directory)
|
|
228
228
|
msg = "Cannot clone #{new_resource} to #{new_resource.destination}, the enclosing directory #{target_parent_directory} does not exist"
|
|
229
229
|
raise Chef::Exceptions::MissingParentDirectory, msg
|
|
230
230
|
end
|
|
@@ -238,9 +238,9 @@ class Chef
|
|
|
238
238
|
require "etc" unless defined?(Etc)
|
|
239
239
|
case user
|
|
240
240
|
when Integer
|
|
241
|
-
Etc.getpwuid(user).dir
|
|
241
|
+
TargetIO::Etc.getpwuid(user).dir
|
|
242
242
|
else
|
|
243
|
-
Etc.getpwnam(user.to_s).dir
|
|
243
|
+
TargetIO::Etc.getpwnam(user.to_s).dir
|
|
244
244
|
end
|
|
245
245
|
end
|
|
246
246
|
end
|
|
@@ -29,13 +29,13 @@ class Chef
|
|
|
29
29
|
class SystemdUnit < Chef::Provider
|
|
30
30
|
include Chef::Mixin::Which
|
|
31
31
|
|
|
32
|
-
provides :systemd_unit
|
|
32
|
+
provides :systemd_unit, target_mode: true
|
|
33
33
|
|
|
34
34
|
def load_current_resource
|
|
35
35
|
@current_resource = Chef::Resource::SystemdUnit.new(new_resource.name)
|
|
36
36
|
|
|
37
37
|
current_resource.unit_name(new_resource.unit_name)
|
|
38
|
-
current_resource.content(::File.read(unit_path)) if ::File.exist?(unit_path)
|
|
38
|
+
current_resource.content(::TargetIO::File.read(unit_path)) if ::TargetIO::File.exist?(unit_path)
|
|
39
39
|
current_resource.user(new_resource.user)
|
|
40
40
|
current_resource.enabled(enabled?)
|
|
41
41
|
current_resource.active(active?)
|
|
@@ -86,7 +86,7 @@ class Chef
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
action :delete, description: "Delete a systemd unit file, if it exists." do
|
|
89
|
-
if ::File.exist?(unit_path)
|
|
89
|
+
if ::TargetIO::File.exist?(unit_path)
|
|
90
90
|
converge_by("deleting unit: #{new_resource.unit_name}") do
|
|
91
91
|
manage_unit_file(:delete)
|
|
92
92
|
daemon_reload if new_resource.triggers_reload
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# rubocop: disable Performance/InefficientHashSearch
|
|
2
2
|
#
|
|
3
3
|
# Author:: Lamont Granquist (<lamont@chef.io>)
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#--
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
3
|
# Author:: Daniel DeLeo (<dan@chef.io>)
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
# License:: Apache License, Version 2.0
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,7 +23,7 @@ require_relative "file"
|
|
|
23
23
|
class Chef
|
|
24
24
|
class Provider
|
|
25
25
|
class Template < Chef::Provider::File
|
|
26
|
-
provides :template
|
|
26
|
+
provides :template, target_mode: true
|
|
27
27
|
|
|
28
28
|
def initialize(new_resource, run_context)
|
|
29
29
|
@content_class = Chef::Provider::Template::Content
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#--
|
|
2
2
|
# Author:: Andrea Campi (<andrea.campi@zephirworks.com>)
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
# License:: Apache License, Version 2.0
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|