chef 18.9.4-universal-mingw-ucrt → 19.1.164-universal-mingw-ucrt
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 +24 -22
- data/README.md +6 -2
- data/Rakefile +12 -7
- data/chef-universal-mingw-ucrt.gemspec +1 -1
- data/chef.gemspec +18 -20
- 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 +31 -4
- data/lib/chef/application/base.rb +38 -7
- data/lib/chef/application/client.rb +15 -1
- data/lib/chef/application/exit_code.rb +4 -2
- 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 +8 -7
- 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 +1 -1
- 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 +3 -4
- 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 +11 -2
- data/lib/chef/compliance/default_attributes.rb +1 -1
- data/lib/chef/compliance/fetcher/chef_server.rb +2 -2
- 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/reporter/cli.rb +2 -2
- data/lib/chef/compliance/runner.rb +19 -1
- 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 +3 -3
- 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 +165 -5
- 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 +2 -6
- 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 +2 -6
- 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 +1 -1
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +1 -1
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +2 -2
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +2 -1
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +2 -1
- 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 +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- 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 +3 -3
- data/lib/chef/mixin/proxified_socket.rb +1 -1
- data/lib/chef/mixin/securable.rb +3 -3
- data/lib/chef/mixin/shell_out.rb +1 -1
- data/lib/chef/mixin/subclass_directive.rb +1 -1
- data/lib/chef/mixin/template.rb +2 -2
- 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 +2 -2
- 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 +2 -3
- 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 +2 -2
- 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 +27 -16
- data/lib/chef/provider/dsc_resource.rb +3 -3
- data/lib/chef/provider/dsc_script.rb +1 -1
- data/lib/chef/provider/execute.rb +3 -2
- data/lib/chef/provider/file/content.rb +1 -1
- data/lib/chef/provider/file.rb +43 -30
- data/lib/chef/provider/git.rb +9 -9
- 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 +4 -4
- 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 +5 -5
- 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 +1 -1
- 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 +1 -1
- data/lib/chef/provider/package/deb.rb +1 -1
- data/lib/chef/provider/package/dnf/python_helper.rb +3 -3
- data/lib/chef/provider/package/dnf/version.rb +1 -1
- data/lib/chef/provider/package/dnf.rb +1 -1
- 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 +4 -4
- 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 +19 -3
- data/lib/chef/provider/package/smartos.rb +2 -2
- data/lib/chef/provider/package/snap.rb +20 -8
- 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 +2 -2
- data/lib/chef/provider/package/windows/msi.rb +2 -2
- 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 +3 -3
- 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 +1 -1
- 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 +1 -1
- 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 +9 -11
- 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 +2 -2
- 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 +1 -1
- 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 +153 -8
- data/lib/chef/resource/action_class.rb +1 -1
- data/lib/chef/resource/alternatives.rb +5 -4
- data/lib/chef/resource/apt_package.rb +7 -2
- data/lib/chef/resource/apt_preference.rb +3 -2
- data/lib/chef/resource/apt_repository.rb +18 -13
- data/lib/chef/resource/apt_update.rb +5 -4
- data/lib/chef/resource/archive_file.rb +21 -21
- data/lib/chef/resource/bash.rb +3 -2
- data/lib/chef/resource/batch.rb +1 -1
- data/lib/chef/resource/bff_package.rb +3 -2
- data/lib/chef/resource/breakpoint.rb +2 -1
- data/lib/chef/resource/build_essential.rb +1 -1
- data/lib/chef/resource/cab_package.rb +1 -1
- data/lib/chef/resource/chef_client_config.rb +5 -8
- data/lib/chef/resource/chef_client_cron.rb +5 -3
- data/lib/chef/resource/chef_client_hab_ca_cert.rb +141 -0
- data/lib/chef/resource/chef_client_launchd.rb +7 -3
- data/lib/chef/resource/chef_client_scheduled_task.rb +6 -3
- data/lib/chef/resource/chef_client_systemd_timer.rb +5 -2
- data/lib/chef/resource/chef_client_trusted_certificate.rb +1 -1
- data/lib/chef/resource/chef_gem.rb +1 -1
- data/lib/chef/resource/chef_handler.rb +1 -1
- data/lib/chef/resource/chef_sleep.rb +3 -2
- data/lib/chef/resource/chef_vault_secret.rb +1 -1
- data/lib/chef/resource/chocolatey_config.rb +1 -1
- data/lib/chef/resource/chocolatey_feature.rb +1 -1
- data/lib/chef/resource/chocolatey_installer.rb +5 -20
- data/lib/chef/resource/chocolatey_package.rb +1 -1
- data/lib/chef/resource/chocolatey_source.rb +1 -1
- 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 -3
- data/lib/chef/resource/cron/cron.rb +2 -1
- 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 +8 -7
- data/lib/chef/resource/directory.rb +8 -7
- 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 +6 -3
- 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 +7 -4
- data/lib/chef/resource/habitat/_habitat_shared.rb +1 -1
- data/lib/chef/resource/habitat/habitat_package.rb +4 -2
- data/lib/chef/resource/habitat/habitat_sup.rb +17 -18
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +4 -3
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +2 -1
- data/lib/chef/resource/habitat_config.rb +25 -11
- data/lib/chef/resource/habitat_install.rb +5 -5
- data/lib/chef/resource/habitat_service.rb +9 -5
- data/lib/chef/resource/habitat_user_toml.rb +2 -2
- data/lib/chef/resource/helpers/cron_validations.rb +3 -3
- data/lib/chef/resource/helpers/path_helpers.rb +52 -0
- data/lib/chef/resource/homebrew_cask.rb +2 -2
- data/lib/chef/resource/homebrew_package.rb +1 -1
- data/lib/chef/resource/homebrew_tap.rb +11 -3
- data/lib/chef/resource/homebrew_update.rb +1 -1
- data/lib/chef/resource/hostname.rb +16 -13
- data/lib/chef/resource/http_request.rb +3 -2
- data/lib/chef/resource/ifconfig.rb +2 -1
- data/lib/chef/resource/inspec_input.rb +5 -2
- data/lib/chef/resource/inspec_waiver.rb +3 -2
- data/lib/chef/resource/inspec_waiver_file_entry.rb +3 -2
- data/lib/chef/resource/ips_package.rb +4 -3
- data/lib/chef/resource/kernel_module.rb +4 -3
- data/lib/chef/resource/ksh.rb +8 -7
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/link.rb +12 -11
- data/lib/chef/resource/locale.rb +5 -4
- data/lib/chef/resource/log.rb +7 -5
- 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 +3 -3
- data/lib/chef/resource/mount.rb +4 -2
- data/lib/chef/resource/msu_package.rb +1 -1
- data/lib/chef/resource/notify_group.rb +3 -2
- data/lib/chef/resource/ohai.rb +5 -4
- data/lib/chef/resource/ohai_hint.rb +3 -2
- 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 +1 -1
- data/lib/chef/resource/openssl_rsa_private_key.rb +1 -1
- data/lib/chef/resource/openssl_rsa_public_key.rb +1 -1
- data/lib/chef/resource/openssl_x509_certificate.rb +6 -2
- data/lib/chef/resource/openssl_x509_crl.rb +1 -1
- data/lib/chef/resource/openssl_x509_request.rb +1 -1
- data/lib/chef/resource/package.rb +10 -9
- data/lib/chef/resource/pacman_package.rb +2 -1
- data/lib/chef/resource/paludis_package.rb +3 -2
- data/lib/chef/resource/perl.rb +8 -7
- data/lib/chef/resource/plist.rb +2 -2
- data/lib/chef/resource/portage_package.rb +3 -2
- data/lib/chef/resource/powershell_package.rb +1 -1
- data/lib/chef/resource/powershell_script.rb +1 -1
- data/lib/chef/resource/python.rb +7 -6
- data/lib/chef/resource/reboot.rb +8 -7
- data/lib/chef/resource/registry_key.rb +1 -6
- data/lib/chef/resource/remote_directory.rb +3 -2
- data/lib/chef/resource/remote_file.rb +4 -3
- data/lib/chef/resource/resource_notification.rb +5 -5
- data/lib/chef/resource/rhsm_errata.rb +3 -2
- data/lib/chef/resource/rhsm_errata_level.rb +4 -3
- data/lib/chef/resource/rhsm_register.rb +12 -3
- 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 +6 -5
- data/lib/chef/resource/scm/subversion.rb +3 -2
- data/lib/chef/resource/script.rb +7 -5
- 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 +2 -1
- data/lib/chef/resource/selinux_fcontext.rb +4 -3
- data/lib/chef/resource/selinux_install.rb +2 -1
- data/lib/chef/resource/selinux_login.rb +2 -1
- data/lib/chef/resource/selinux_module.rb +6 -5
- data/lib/chef/resource/selinux_permissive.rb +3 -2
- data/lib/chef/resource/selinux_port.rb +3 -2
- data/lib/chef/resource/selinux_state.rb +3 -2
- data/lib/chef/resource/selinux_user.rb +2 -1
- data/lib/chef/resource/service.rb +4 -1
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/snap_package.rb +16 -7
- data/lib/chef/resource/solaris_package.rb +3 -2
- data/lib/chef/resource/ssh_known_hosts_entry.rb +3 -2
- data/lib/chef/resource/sudo.rb +11 -10
- data/lib/chef/resource/swap_file.rb +8 -7
- data/lib/chef/resource/sysctl.rb +7 -6
- data/lib/chef/resource/systemd_unit.rb +4 -1
- data/lib/chef/resource/template.rb +3 -2
- data/lib/chef/resource/timezone.rb +7 -6
- 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 +2 -1
- 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 +2 -1
- data/lib/chef/resource/user_ulimit.rb +3 -2
- data/lib/chef/resource/windows_ad_join.rb +2 -2
- data/lib/chef/resource/windows_audit_policy.rb +1 -1
- data/lib/chef/resource/windows_auto_run.rb +2 -2
- data/lib/chef/resource/windows_certificate.rb +1 -1
- data/lib/chef/resource/windows_defender.rb +1 -1
- data/lib/chef/resource/windows_defender_exclusion.rb +1 -1
- 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_feature.rb +1 -1
- data/lib/chef/resource/windows_feature_dism.rb +1 -1
- data/lib/chef/resource/windows_feature_powershell.rb +1 -1
- data/lib/chef/resource/windows_firewall_profile.rb +1 -1
- data/lib/chef/resource/windows_firewall_rule.rb +1 -1
- data/lib/chef/resource/windows_font.rb +2 -2
- data/lib/chef/resource/windows_package.rb +2 -2
- data/lib/chef/resource/windows_pagefile.rb +3 -3
- data/lib/chef/resource/windows_path.rb +1 -1
- data/lib/chef/resource/windows_printer.rb +1 -1
- data/lib/chef/resource/windows_printer_port.rb +1 -1
- data/lib/chef/resource/windows_script.rb +1 -1
- data/lib/chef/resource/windows_security_policy.rb +1 -1
- data/lib/chef/resource/windows_service.rb +2 -2
- data/lib/chef/resource/windows_share.rb +4 -4
- data/lib/chef/resource/windows_shortcut.rb +1 -1
- data/lib/chef/resource/windows_task.rb +3 -5
- data/lib/chef/resource/windows_uac.rb +1 -1
- data/lib/chef/resource/windows_update_settings.rb +3 -3
- data/lib/chef/resource/windows_user_privilege.rb +3 -3
- data/lib/chef/resource/windows_workgroup.rb +1 -1
- data/lib/chef/resource/yum_package.rb +5 -4
- data/lib/chef/resource/yum_repository.rb +3 -2
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource/zypper_repository.rb +4 -3
- data/lib/chef/resource.rb +12 -4
- 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 +12 -7
- 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 +4 -3
- 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 +2 -2
- 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 -2
- 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 -2
- 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/model_wrapper.rb +1 -1
- data/lib/chef/shell/shell_session.rb +1 -1
- data/lib/chef/shell.rb +30 -8
- 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 +2 -2
- 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 +127 -87
- data/distro/powershell/chef/chef.psm1 +0 -459
- data/lib/chef/resource/osx_profile.rb +0 -334
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Edwards (<adamed@chef.io>)
|
|
3
3
|
#
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -114,7 +114,7 @@ class Chef
|
|
|
114
114
|
r = case found.length
|
|
115
115
|
when 0
|
|
116
116
|
raise Chef::Exceptions::ResourceNotFound,
|
|
117
|
-
"Could not find #{dsc_resource_name}. Check to make "\
|
|
117
|
+
"Could not find #{dsc_resource_name}. Check to make " \
|
|
118
118
|
"sure that it shows up when running Get-DscResource"
|
|
119
119
|
when 1
|
|
120
120
|
if found[0]["Module"].nil?
|
|
@@ -162,7 +162,7 @@ class Chef
|
|
|
162
162
|
|
|
163
163
|
def invoke_resource(method)
|
|
164
164
|
properties = translate_type(new_resource.properties)
|
|
165
|
-
switches = "-Method #{method} -Name #{new_resource.resource}"\
|
|
165
|
+
switches = "-Method #{method} -Name #{new_resource.resource}" \
|
|
166
166
|
" -Property #{properties} -Module #{module_info_object} -Verbose"
|
|
167
167
|
Timeout.timeout(new_resource.timeout) {
|
|
168
168
|
powershell_exec!("Invoke-DscResource #{switches}")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Edwards (<adamed@chef.io>)
|
|
3
3
|
#
|
|
4
|
-
# Copyright:: Copyright (c)
|
|
4
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
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,7 +27,7 @@ class Chef
|
|
|
27
27
|
|
|
28
28
|
provides :execute, target_mode: true
|
|
29
29
|
|
|
30
|
-
def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated, :default_env, :timeout, :input, :login
|
|
30
|
+
def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated, :default_env, :timeout, :input, :login, :cgroup
|
|
31
31
|
|
|
32
32
|
def load_current_resource
|
|
33
33
|
current_resource = Chef::Resource::Execute.new(new_resource.name)
|
|
@@ -96,6 +96,7 @@ class Chef
|
|
|
96
96
|
opts[:default_env] = default_env
|
|
97
97
|
opts[:log_level] = :info
|
|
98
98
|
opts[:log_tag] = new_resource.to_s
|
|
99
|
+
opts[:cgroup] = cgroup if cgroup
|
|
99
100
|
if (logger.info? || live_stream?) && !sensitive?
|
|
100
101
|
if run_context.events.formatter?
|
|
101
102
|
opts[:live_stream] = Chef::EventDispatch::EventsOutputStream.new(run_context.events, name: :execute)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Lamont Granquist (<lamont@chef.io>)
|
|
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");
|
data/lib/chef/provider/file.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
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");
|
|
@@ -29,6 +29,7 @@ require_relative "../mixin/file_class"
|
|
|
29
29
|
require_relative "../mixin/enforce_ownership_and_permissions"
|
|
30
30
|
require_relative "../resource/file/verification/json"
|
|
31
31
|
require_relative "../resource/file/verification/yaml"
|
|
32
|
+
require_relative "../target_io"
|
|
32
33
|
require_relative "../util/backup"
|
|
33
34
|
require_relative "../util/diff"
|
|
34
35
|
require_relative "../util/selinux"
|
|
@@ -53,7 +54,7 @@ class Chef
|
|
|
53
54
|
include Chef::Util::Selinux
|
|
54
55
|
include Chef::Mixin::FileClass
|
|
55
56
|
|
|
56
|
-
provides :file
|
|
57
|
+
provides :file, target_mode: true
|
|
57
58
|
|
|
58
59
|
attr_reader :deployment_strategy
|
|
59
60
|
|
|
@@ -76,7 +77,7 @@ class Chef
|
|
|
76
77
|
|
|
77
78
|
# true if there is a non-file thing in the way that we need to unlink first
|
|
78
79
|
@needs_unlinking =
|
|
79
|
-
if ::File.exist?(new_resource_path)
|
|
80
|
+
if ::TargetIO::File.exist?(new_resource_path)
|
|
80
81
|
if managing_symlink?
|
|
81
82
|
!symlink_to_real_file?(new_resource_path)
|
|
82
83
|
else
|
|
@@ -87,7 +88,7 @@ class Chef
|
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
# true if we are going to be creating a new file
|
|
90
|
-
@needs_creating = !::File.exist?(new_resource_path) || needs_unlinking?
|
|
91
|
+
@needs_creating = !::TargetIO::File.exist?(new_resource_path) || needs_unlinking?
|
|
91
92
|
|
|
92
93
|
# Let children resources override constructing the current_resource
|
|
93
94
|
@current_resource ||= Chef::Resource::File.new(new_resource.name)
|
|
@@ -97,7 +98,11 @@ class Chef
|
|
|
97
98
|
# we are updating an existing file
|
|
98
99
|
if managing_content?
|
|
99
100
|
logger.trace("#{new_resource} checksumming file at #{new_resource_path}.")
|
|
100
|
-
|
|
101
|
+
|
|
102
|
+
resource_to_check = current_resource.path
|
|
103
|
+
resource_to_check = ::TargetIO::File.open(current_resource.path) if ChefConfig::Config.target_mode?
|
|
104
|
+
|
|
105
|
+
current_resource.checksum(checksum(resource_to_check))
|
|
101
106
|
else
|
|
102
107
|
# if the file does not exist or is not a file, then the checksum is invalid/pointless
|
|
103
108
|
current_resource.checksum(nil)
|
|
@@ -115,15 +120,15 @@ class Chef
|
|
|
115
120
|
# Make sure the parent directory exists, otherwise fail. For why-run assume it would have been created.
|
|
116
121
|
requirements.assert(:create, :create_if_missing, :touch) do |a|
|
|
117
122
|
parent_directory = ::File.dirname(new_resource.path)
|
|
118
|
-
a.assertion { ::File.directory?(parent_directory) }
|
|
123
|
+
a.assertion { ::TargetIO::File.directory?(parent_directory) }
|
|
119
124
|
a.failure_message(Chef::Exceptions::EnclosingDirectoryDoesNotExist, "Parent directory #{parent_directory} does not exist.")
|
|
120
125
|
a.whyrun("Assuming directory #{parent_directory} would have been created")
|
|
121
126
|
end
|
|
122
127
|
|
|
123
128
|
# Make sure the file is deletable if it exists, otherwise fail.
|
|
124
|
-
if ::File.exist?(new_resource.path)
|
|
129
|
+
if ::TargetIO::File.exist?(new_resource.path)
|
|
125
130
|
requirements.assert(:delete) do |a|
|
|
126
|
-
a.assertion { ::File.writable?(new_resource.path) }
|
|
131
|
+
a.assertion { ::TargetIO::File.writable?(new_resource.path) }
|
|
127
132
|
a.failure_message(Chef::Exceptions::InsufficientPermissions, "File #{new_resource.path} exists but is not writable so it cannot be deleted")
|
|
128
133
|
end
|
|
129
134
|
end
|
|
@@ -152,7 +157,7 @@ class Chef
|
|
|
152
157
|
end
|
|
153
158
|
|
|
154
159
|
action :create_if_missing do
|
|
155
|
-
unless ::File.exist?(new_resource.path)
|
|
160
|
+
unless ::TargetIO::File.exist?(new_resource.path)
|
|
156
161
|
action_create
|
|
157
162
|
else
|
|
158
163
|
logger.debug("#{new_resource} exists at #{new_resource.path} taking no action.")
|
|
@@ -160,10 +165,10 @@ class Chef
|
|
|
160
165
|
end
|
|
161
166
|
|
|
162
167
|
action :delete do
|
|
163
|
-
if ::File.exist?(new_resource.path)
|
|
168
|
+
if ::TargetIO::File.exist?(new_resource.path)
|
|
164
169
|
converge_by("delete file #{new_resource.path}") do
|
|
165
170
|
do_backup unless file_class.symlink?(new_resource.path)
|
|
166
|
-
::File.delete(new_resource.path)
|
|
171
|
+
::TargetIO::File.delete(new_resource.path)
|
|
167
172
|
logger.info("#{new_resource} deleted file at #{new_resource.path}")
|
|
168
173
|
end
|
|
169
174
|
end
|
|
@@ -173,7 +178,7 @@ class Chef
|
|
|
173
178
|
action_create
|
|
174
179
|
converge_by("update utime on file #{new_resource.path}") do
|
|
175
180
|
time = Time.now
|
|
176
|
-
::File.utime(time, time, new_resource.path)
|
|
181
|
+
::TargetIO::File.utime(time, time, new_resource.path)
|
|
177
182
|
logger.info("#{new_resource} updated atime and mtime to #{time}")
|
|
178
183
|
end
|
|
179
184
|
end
|
|
@@ -255,7 +260,7 @@ class Chef
|
|
|
255
260
|
# If any of the above apply, returns a 3-tuple of Exception class,
|
|
256
261
|
# exception message, whyrun message; otherwise returns a 3-tuple of nil.
|
|
257
262
|
def verify_symlink_sanity(path)
|
|
258
|
-
real_path = ::File.realpath(path)
|
|
263
|
+
real_path = ::TargetIO::File.realpath(path)
|
|
259
264
|
if real_file?(real_path)
|
|
260
265
|
[nil, nil, nil]
|
|
261
266
|
else
|
|
@@ -284,15 +289,15 @@ class Chef
|
|
|
284
289
|
|
|
285
290
|
def file_type_string(path)
|
|
286
291
|
case
|
|
287
|
-
when ::File.blockdev?(path)
|
|
292
|
+
when ::TargetIO::File.blockdev?(path)
|
|
288
293
|
"block device"
|
|
289
|
-
when ::File.chardev?(path)
|
|
294
|
+
when ::TargetIO::File.chardev?(path)
|
|
290
295
|
"char device"
|
|
291
|
-
when ::File.directory?(path)
|
|
296
|
+
when ::TargetIO::File.directory?(path)
|
|
292
297
|
"directory"
|
|
293
|
-
when ::File.pipe?(path)
|
|
298
|
+
when ::TargetIO::File.pipe?(path)
|
|
294
299
|
"pipe"
|
|
295
|
-
when ::File.socket?(path)
|
|
300
|
+
when ::TargetIO::File.socket?(path)
|
|
296
301
|
"socket"
|
|
297
302
|
when file_class.symlink?(path)
|
|
298
303
|
"symlink"
|
|
@@ -302,12 +307,12 @@ class Chef
|
|
|
302
307
|
end
|
|
303
308
|
|
|
304
309
|
def real_file?(path)
|
|
305
|
-
!file_class.symlink?(path) && ::File.file?(path)
|
|
310
|
+
!file_class.symlink?(path) && ::TargetIO::File.file?(path)
|
|
306
311
|
end
|
|
307
312
|
|
|
308
313
|
# like real_file? that follows (sane) symlinks
|
|
309
314
|
def symlink_to_real_file?(path)
|
|
310
|
-
real_file?(::File.realpath(path))
|
|
315
|
+
real_file?(::TargetIO::File.realpath(path))
|
|
311
316
|
rescue Errno::ELOOP, Errno::ENOENT
|
|
312
317
|
false
|
|
313
318
|
end
|
|
@@ -315,15 +320,15 @@ class Chef
|
|
|
315
320
|
# Similar to File.exist?, but also returns true in the case that the
|
|
316
321
|
# named file is a broken symlink.
|
|
317
322
|
def l_exist?(path)
|
|
318
|
-
::File.exist?(path) || file_class.symlink?(path)
|
|
323
|
+
::TargetIO::File.exist?(path) || file_class.symlink?(path)
|
|
319
324
|
end
|
|
320
325
|
|
|
321
326
|
def unlink(path)
|
|
322
327
|
# Directories can not be unlinked. Remove them using FileUtils.
|
|
323
|
-
if ::File.directory?(path)
|
|
324
|
-
FileUtils.rm_rf(path)
|
|
328
|
+
if ::TargetIO::File.directory?(path)
|
|
329
|
+
TargetIO::FileUtils.rm_rf(path)
|
|
325
330
|
else
|
|
326
|
-
::File.unlink(path)
|
|
331
|
+
::TargetIO::File.unlink(path)
|
|
327
332
|
end
|
|
328
333
|
end
|
|
329
334
|
|
|
@@ -345,8 +350,8 @@ class Chef
|
|
|
345
350
|
new_resource.verify.each do |v|
|
|
346
351
|
unless v.verify(tempfile.path)
|
|
347
352
|
backupfile = "#{Chef::Config[:file_cache_path]}/failed_validations/#{::File.basename(tempfile.path)}"
|
|
348
|
-
FileUtils.mkdir_p ::File.dirname(backupfile)
|
|
349
|
-
FileUtils.cp tempfile.path, backupfile
|
|
353
|
+
TargetIO::FileUtils.mkdir_p ::File.dirname(backupfile)
|
|
354
|
+
TargetIO::FileUtils.cp tempfile.path, backupfile
|
|
350
355
|
raise Chef::Exceptions::ValidationFailed.new "Proposed content for #{new_resource.path} failed verification #{new_resource.sensitive ? "[sensitive]" : "#{v}\n#{v.output}"}\nTemporary file moved to #{backupfile}"
|
|
351
356
|
end
|
|
352
357
|
end
|
|
@@ -375,6 +380,11 @@ class Chef
|
|
|
375
380
|
end
|
|
376
381
|
|
|
377
382
|
def do_backup(file = nil)
|
|
383
|
+
if ChefConfig::Config.target_mode?
|
|
384
|
+
Chef::Log.info("#{@new_resource} backup skipped in Target Mode")
|
|
385
|
+
return
|
|
386
|
+
end
|
|
387
|
+
|
|
378
388
|
Chef::Util::Backup.new(new_resource, file).backup!
|
|
379
389
|
end
|
|
380
390
|
|
|
@@ -384,11 +394,14 @@ class Chef
|
|
|
384
394
|
|
|
385
395
|
def update_file_contents
|
|
386
396
|
do_backup unless needs_creating?
|
|
387
|
-
deployment_strategy.deploy(tempfile.path, ::File.realpath(new_resource.path).force_encoding(Chef::Config[:ruby_encoding]))
|
|
397
|
+
deployment_strategy.deploy(tempfile.path, ::TargetIO::File.realpath(new_resource.path).force_encoding(Chef::Config[:ruby_encoding]))
|
|
388
398
|
logger.info("#{new_resource} updated file contents #{new_resource.path}")
|
|
389
399
|
if managing_content?
|
|
390
400
|
# save final checksum for reporting.
|
|
391
|
-
|
|
401
|
+
resource_to_check = new_resource.path
|
|
402
|
+
resource_to_check = ::TargetIO::File.open(resource_to_check) if ChefConfig::Config.target_mode?
|
|
403
|
+
|
|
404
|
+
new_resource.final_checksum = checksum(resource_to_check)
|
|
392
405
|
end
|
|
393
406
|
end
|
|
394
407
|
|
|
@@ -401,7 +414,7 @@ class Chef
|
|
|
401
414
|
end
|
|
402
415
|
|
|
403
416
|
# the file? on the next line suppresses the case in why-run when we have a not-file here that would have otherwise been removed
|
|
404
|
-
if ::File.file?(new_resource.path) && contents_changed?
|
|
417
|
+
if ::TargetIO::File.file?(new_resource.path) && contents_changed?
|
|
405
418
|
description = [ "update content in file #{new_resource.path} from \
|
|
406
419
|
#{short_cksum(current_resource.checksum)} to #{short_cksum(tempfile_checksum)}" ]
|
|
407
420
|
|
|
@@ -433,7 +446,7 @@ class Chef
|
|
|
433
446
|
if resource_updated? && Chef::Config[:enable_selinux_file_permission_fixup]
|
|
434
447
|
if selinux_enabled?
|
|
435
448
|
converge_by("restore selinux security context") do
|
|
436
|
-
restore_security_context(::File.realpath(new_resource.path), recursive)
|
|
449
|
+
restore_security_context(::TargetIO::File.realpath(new_resource.path), recursive)
|
|
437
450
|
end
|
|
438
451
|
else
|
|
439
452
|
logger.trace "selinux utilities can not be found. Skipping selinux permission fixup."
|
data/lib/chef/provider/git.rb
CHANGED
|
@@ -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");
|
|
@@ -26,7 +26,7 @@ class Chef
|
|
|
26
26
|
class Git < Chef::Provider
|
|
27
27
|
|
|
28
28
|
extend Forwardable
|
|
29
|
-
provides :git
|
|
29
|
+
provides :git, target_mode: true
|
|
30
30
|
|
|
31
31
|
GIT_VERSION_PATTERN = Regexp.compile("git version (\\d+\\.\\d+.\\d+)")
|
|
32
32
|
|
|
@@ -58,7 +58,7 @@ class Chef
|
|
|
58
58
|
# Parent directory of the target must exist.
|
|
59
59
|
requirements.assert(:checkout, :sync) do |a|
|
|
60
60
|
dirname = ::File.dirname(cwd)
|
|
61
|
-
a.assertion { ::File.directory?(dirname) }
|
|
61
|
+
a.assertion { ::TargetIO::File.directory?(dirname) }
|
|
62
62
|
a.whyrun("Directory #{dirname} does not exist, this run will fail unless it has been previously created. Assuming it would have been created.")
|
|
63
63
|
a.failure_message(Chef::Exceptions::MissingParentDirectory,
|
|
64
64
|
"Cannot clone #{new_resource} to #{cwd}, the enclosing directory #{dirname} does not exist")
|
|
@@ -101,7 +101,7 @@ class Chef
|
|
|
101
101
|
action :export do
|
|
102
102
|
action_checkout
|
|
103
103
|
converge_by("complete the export by removing #{cwd}.git after checkout") do
|
|
104
|
-
FileUtils.rm_rf(::File.join(cwd, ".git"))
|
|
104
|
+
TargetIO::FileUtils.rm_rf(::File.join(cwd, ".git"))
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
@@ -138,16 +138,16 @@ class Chef
|
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
def existing_git_clone?
|
|
141
|
-
::File.exist?(::File.join(cwd, ".git"))
|
|
141
|
+
::TargetIO::File.exist?(::File.join(cwd, ".git"))
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
def target_dir_non_existent_or_empty?
|
|
145
|
-
!::File.exist?(cwd) || Dir.entries(cwd).sort == [".", ".."]
|
|
145
|
+
!::TargetIO::File.exist?(cwd) || TargetIO::Dir.entries(cwd).sort == [".", ".."]
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
def find_current_revision
|
|
149
149
|
logger.trace("#{new_resource} finding current git revision")
|
|
150
|
-
if ::File.exist?(::File.join(cwd, ".git"))
|
|
150
|
+
if ::TargetIO::File.exist?(::File.join(cwd, ".git"))
|
|
151
151
|
# 128 is returned when we're not in a git repo. this is fine
|
|
152
152
|
result = git("rev-parse", "HEAD", cwd: cwd, returns: [0, 128]).stdout.strip
|
|
153
153
|
end
|
|
@@ -413,9 +413,9 @@ class Chef
|
|
|
413
413
|
require "etc" unless defined?(Etc)
|
|
414
414
|
case user
|
|
415
415
|
when Integer
|
|
416
|
-
Etc.getpwuid(user).dir
|
|
416
|
+
TargetIO::Etc.getpwuid(user).dir
|
|
417
417
|
else
|
|
418
|
-
Etc.getpwnam(user.to_s).dir
|
|
418
|
+
TargetIO::Etc.getpwnam(user.to_s).dir
|
|
419
419
|
end
|
|
420
420
|
end
|
|
421
421
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Dreamcat4 (<dreamcat4@gmail.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");
|
|
@@ -21,7 +21,7 @@ class Chef
|
|
|
21
21
|
class Group
|
|
22
22
|
class Dscl < Chef::Provider::Group
|
|
23
23
|
|
|
24
|
-
provides :group, os: "darwin"
|
|
24
|
+
provides :group, os: "darwin", target_mode: true
|
|
25
25
|
|
|
26
26
|
def dscl(*args)
|
|
27
27
|
argdup = args.dup
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@chef.io>)
|
|
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 Group
|
|
24
24
|
class Gpasswd < Chef::Provider::Group::Groupadd
|
|
25
|
-
provides :group
|
|
25
|
+
provides :group, target_mode: true
|
|
26
26
|
|
|
27
27
|
def load_current_resource
|
|
28
28
|
super
|
|
@@ -31,7 +31,7 @@ class Chef
|
|
|
31
31
|
def define_resource_requirements
|
|
32
32
|
super
|
|
33
33
|
requirements.assert(:all_actions) do |a|
|
|
34
|
-
a.assertion { ::File.exist?("/usr/bin/gpasswd") }
|
|
34
|
+
a.assertion { ::TargetIO::File.exist?("/usr/bin/gpasswd") }
|
|
35
35
|
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/bin/gpasswd for #{new_resource}"
|
|
36
36
|
# No whyrun alternative: this component should be available in the base install of any given system that uses it
|
|
37
37
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@chef.io>)
|
|
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");
|
|
@@ -35,7 +35,7 @@ class Chef
|
|
|
35
35
|
super
|
|
36
36
|
required_binaries.each do |required_binary|
|
|
37
37
|
requirements.assert(:all_actions) do |a|
|
|
38
|
-
a.assertion { ::File.exist?(required_binary) }
|
|
38
|
+
a.assertion { ::TargetIO::File.exist?(required_binary) }
|
|
39
39
|
a.failure_message Chef::Exceptions::Group, "Could not find binary #{required_binary} for #{new_resource}"
|
|
40
40
|
# No whyrun alternative: this component should be available in the base install of any given system that uses it
|
|
41
41
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Dan Crosta (<dcrosta@late.am>)
|
|
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");
|
|
@@ -21,12 +21,12 @@ class Chef
|
|
|
21
21
|
class Group
|
|
22
22
|
class Groupmod < Chef::Provider::Group
|
|
23
23
|
|
|
24
|
-
provides :group, os: "netbsd"
|
|
24
|
+
provides :group, os: "netbsd", target_mode: true
|
|
25
25
|
|
|
26
26
|
def load_current_resource
|
|
27
27
|
super
|
|
28
28
|
%w{group user}.each do |binary|
|
|
29
|
-
raise Chef::Exceptions::Group, "Could not find binary /usr/sbin/#{binary} for #{new_resource}" unless ::File.exist?("/usr/sbin/#{binary}")
|
|
29
|
+
raise Chef::Exceptions::Group, "Could not find binary /usr/sbin/#{binary} for #{new_resource}" unless ::TargetIO::File.exist?("/usr/sbin/#{binary}")
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Stephen Haynes (<sh@nomitor.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");
|
|
@@ -20,7 +20,7 @@ class Chef
|
|
|
20
20
|
class Provider
|
|
21
21
|
class Group
|
|
22
22
|
class Pw < Chef::Provider::Group
|
|
23
|
-
provides :group, platform: "freebsd"
|
|
23
|
+
provides :group, platform: "freebsd", target_mode: true
|
|
24
24
|
|
|
25
25
|
def load_current_resource
|
|
26
26
|
super
|
|
@@ -30,7 +30,7 @@ class Chef
|
|
|
30
30
|
super
|
|
31
31
|
|
|
32
32
|
requirements.assert(:all_actions) do |a|
|
|
33
|
-
a.assertion { ::File.exist?("/usr/sbin/pw") }
|
|
33
|
+
a.assertion { ::TargetIO::File.exist?("/usr/sbin/pw") }
|
|
34
34
|
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/pw for #{new_resource}"
|
|
35
35
|
# No whyrun alternative: this component should be available in the base install of any given system that uses it
|
|
36
36
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Joshua Justice (<jjustice6@bloomberg.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
|
|
|
26
26
|
# this provides line is setup to only catch the solaris2 platform, but
|
|
27
27
|
# NOT other platforms in the Solaris platform_family. (See usermod provider.)
|
|
28
|
-
provides :group, platform: "solaris2"
|
|
28
|
+
provides :group, platform: "solaris2", target_mode: true
|
|
29
29
|
|
|
30
30
|
def load_current_resource
|
|
31
31
|
super
|
|
@@ -35,7 +35,7 @@ class Chef
|
|
|
35
35
|
super
|
|
36
36
|
|
|
37
37
|
requirements.assert(:all_actions) do |a|
|
|
38
|
-
a.assertion { ::File.exist?("/usr/sbin/usermod") && ::File.exist?("/usr/sbin/groupmod") }
|
|
38
|
+
a.assertion { ::TargetIO::File.exist?("/usr/sbin/usermod") && ::TargetIO::File.exist?("/usr/sbin/groupmod") }
|
|
39
39
|
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod or /usr/sbin/groupmod for #{new_resource}"
|
|
40
40
|
# No whyrun alternative: this component should be available in the base install of any given system that uses it
|
|
41
41
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@chef.io>)
|
|
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 Group
|
|
24
24
|
class Usermod < Chef::Provider::Group::Groupadd
|
|
25
25
|
|
|
26
|
-
provides :group, os: %w{openbsd solaris2}
|
|
26
|
+
provides :group, os: %w{openbsd solaris2}, target_mode: true
|
|
27
27
|
|
|
28
28
|
def load_current_resource
|
|
29
29
|
super
|
|
@@ -33,7 +33,7 @@ class Chef
|
|
|
33
33
|
super
|
|
34
34
|
|
|
35
35
|
requirements.assert(:all_actions) do |a|
|
|
36
|
-
a.assertion { ::File.exist?("/usr/sbin/usermod") }
|
|
36
|
+
a.assertion { ::TargetIO::File.exist?("/usr/sbin/usermod") }
|
|
37
37
|
a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod for #{new_resource}"
|
|
38
38
|
# No whyrun alternative: this component should be available in the base install of any given system that uses it
|
|
39
39
|
end
|
data/lib/chef/provider/group.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: AJ Christensen (<aj@chef.io>)
|
|
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");
|
|
@@ -36,7 +36,7 @@ class Chef
|
|
|
36
36
|
|
|
37
37
|
group_info = nil
|
|
38
38
|
begin
|
|
39
|
-
group_info = Etc.getgrnam(new_resource.group_name)
|
|
39
|
+
group_info = TargetIO::Etc.getgrnam(new_resource.group_name)
|
|
40
40
|
rescue ArgumentError
|
|
41
41
|
@group_exists = false
|
|
42
42
|
logger.trace("#{new_resource} group does not exist")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
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,12 +23,12 @@ class Chef
|
|
|
23
23
|
class Provider
|
|
24
24
|
class HttpRequest < Chef::Provider
|
|
25
25
|
|
|
26
|
-
provides :http_request
|
|
26
|
+
provides :http_request, target_mode: true
|
|
27
27
|
|
|
28
28
|
attr_writer :http
|
|
29
29
|
|
|
30
30
|
def http
|
|
31
|
-
@http ||=
|
|
31
|
+
@http ||= TargetIO::HTTP.new(new_resource.url)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def load_current_resource; end
|
|
@@ -60,7 +60,6 @@ class Chef
|
|
|
60
60
|
new_resource.headers
|
|
61
61
|
)
|
|
62
62
|
logger.info("#{new_resource} GET to #{new_resource.url} successful")
|
|
63
|
-
logger.trace("#{new_resource} GET request response: #{body}")
|
|
64
63
|
end
|
|
65
64
|
end
|
|
66
65
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Kaustubh Deorukhkar (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 Ifconfig
|
|
24
24
|
class Aix < Chef::Provider::Ifconfig
|
|
25
|
-
provides :ifconfig, platform: "aix"
|
|
25
|
+
provides :ifconfig, platform: "aix", target_mode: true
|
|
26
26
|
|
|
27
27
|
def load_current_resource
|
|
28
28
|
@current_resource = Chef::Resource::Ifconfig.new(new_resource.name)
|
|
@@ -23,7 +23,7 @@ class Chef
|
|
|
23
23
|
class Provider
|
|
24
24
|
class Ifconfig
|
|
25
25
|
class Debian < Chef::Provider::Ifconfig
|
|
26
|
-
provides :ifconfig, platform_family: %w{debian}
|
|
26
|
+
provides :ifconfig, platform_family: %w{debian}, target_mode: true
|
|
27
27
|
|
|
28
28
|
INTERFACES_FILE = "/etc/network/interfaces".freeze
|
|
29
29
|
INTERFACES_DOT_D_DIR = "/etc/network/interfaces.d".freeze
|
|
@@ -81,16 +81,16 @@ iface <%= new_resource.device %> <%= new_resource.family %> static
|
|
|
81
81
|
|
|
82
82
|
def enforce_interfaces_dot_d_sanity
|
|
83
83
|
# on ubuntu 18.04+ there's no interfaces file and it uses interfaces.d by default
|
|
84
|
-
return if ::File.directory?(INTERFACES_DOT_D_DIR) && !::File.exist?(INTERFACES_FILE)
|
|
84
|
+
return if ::TargetIO::File.directory?(INTERFACES_DOT_D_DIR) && !::TargetIO::File.exist?(INTERFACES_FILE)
|
|
85
85
|
|
|
86
86
|
# create /etc/network/interfaces.d via dir if it's missing
|
|
87
87
|
directory INTERFACES_DOT_D_DIR
|
|
88
88
|
|
|
89
89
|
# roll our own file_edit resource, this will not get reported until we have a file_edit resource
|
|
90
|
-
interfaces_dot_d_for_regexp = INTERFACES_DOT_D_DIR.gsub(
|
|
90
|
+
interfaces_dot_d_for_regexp = INTERFACES_DOT_D_DIR.gsub(".", "\\.") # escape dots for the regexp
|
|
91
91
|
regexp = %r{^\s*source\s+#{interfaces_dot_d_for_regexp}/\*\s*$}
|
|
92
92
|
|
|
93
|
-
return if ::File.exist?(INTERFACES_FILE) && regexp.match(IO.read(INTERFACES_FILE))
|
|
93
|
+
return if ::TargetIO::File.exist?(INTERFACES_FILE) && regexp.match(IO.read(INTERFACES_FILE))
|
|
94
94
|
|
|
95
95
|
converge_by("modifying #{INTERFACES_FILE} to source #{INTERFACES_DOT_D_DIR}") do
|
|
96
96
|
conf = Chef::Util::FileEdit.new(INTERFACES_FILE)
|
|
@@ -22,7 +22,7 @@ class Chef
|
|
|
22
22
|
class Provider
|
|
23
23
|
class Ifconfig
|
|
24
24
|
class Redhat < Chef::Provider::Ifconfig
|
|
25
|
-
provides :ifconfig, platform_family: "fedora_derived"
|
|
25
|
+
provides :ifconfig, platform_family: "fedora_derived", target_mode: true
|
|
26
26
|
|
|
27
27
|
def initialize(new_resource, run_context)
|
|
28
28
|
super(new_resource, run_context)
|