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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
require "chef/mixin/which"
|
|
2
|
+
|
|
3
|
+
class Chef
|
|
4
|
+
module ResourceHelpers
|
|
5
|
+
# Helpers for path manipulation
|
|
6
|
+
module PathHelpers
|
|
7
|
+
extend self
|
|
8
|
+
include Chef::Mixin::Which
|
|
9
|
+
|
|
10
|
+
# This method returns the absolute path to the chef-client binary that is currently executing.
|
|
11
|
+
# In a Habitat environment, you might have multiple versions of chef-client installed,
|
|
12
|
+
# we want to ensure we get the path to the one currently running.
|
|
13
|
+
#
|
|
14
|
+
# @return [String] The absolute path to the chef-client binary if found,
|
|
15
|
+
# or an empty string if no valid binary path is detected.
|
|
16
|
+
# @example
|
|
17
|
+
# chef_client_hab_binary_path
|
|
18
|
+
# # => "/hab/pkgs/chef/chef-infra-client/19.10.0/20250822151044/bin/chef-client"
|
|
19
|
+
# # Or on Windows:
|
|
20
|
+
# # => "C:/hab/pkgs/chef/chef-infra-client/19.10.0/20250822151044/bin/chef-client"
|
|
21
|
+
def chef_client_hab_binary_path
|
|
22
|
+
path = File.realpath($PROGRAM_NAME)
|
|
23
|
+
bin = File.basename(path)
|
|
24
|
+
|
|
25
|
+
# On Windows, temporarily use the c:\\hab\\bin\\*.bat binstubs
|
|
26
|
+
bat_path = "C:\\hab\\bin\\#{bin}.bat"
|
|
27
|
+
return bat_path if File.exist?(bat_path) && ChefUtils.windows?
|
|
28
|
+
return path if bin == "#{ChefUtils::Dist::Infra::CLIENT}"
|
|
29
|
+
|
|
30
|
+
# Return empty string if no valid path is found
|
|
31
|
+
""
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# once the binstubs under hab package have been fixed,
|
|
35
|
+
# restore this as the chef_client_hab_binary_path method
|
|
36
|
+
def chef_client_hab_package_binary_path
|
|
37
|
+
path = File.realpath($PROGRAM_NAME)
|
|
38
|
+
bin = File.basename(path)
|
|
39
|
+
|
|
40
|
+
return path if bin == "#{ChefUtils::Dist::Infra::CLIENT}"
|
|
41
|
+
|
|
42
|
+
# Return empty string if no valid path is found
|
|
43
|
+
""
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def hab_executable_binary_path
|
|
47
|
+
# Find hab in PATH
|
|
48
|
+
which("hab") || ""
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Joshua Timberman (<jtimberman@chef.io>)
|
|
3
3
|
# Author:: Graeme Mathieson (<mathie@woss.name>)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright (c)
|
|
5
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -46,7 +46,7 @@ class Chef
|
|
|
46
46
|
property :owner, [String, Integer],
|
|
47
47
|
description: "The owner of the Homebrew installation.",
|
|
48
48
|
default: lazy { find_homebrew_username },
|
|
49
|
-
default_description: "Calculated default username"\
|
|
49
|
+
default_description: "Calculated default username" \
|
|
50
50
|
|
|
51
51
|
action :install, description: "Install an application that is packaged as a Homebrew cask." do
|
|
52
52
|
unless casked?
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Joshua Timberman (<joshua@chef.io>)
|
|
3
3
|
# Author:: Graeme Mathieson (<mathie@woss.name>)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright (c)
|
|
5
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Joshua Timberman (<jtimberman@chef.io>)
|
|
3
3
|
# Author:: Graeme Mathieson (<mathie@woss.name>)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright (c)
|
|
5
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -29,6 +29,14 @@ class Chef
|
|
|
29
29
|
description "Use the **homebrew_tap** resource to add additional formula repositories to the Homebrew package manager."
|
|
30
30
|
introduced "14.0"
|
|
31
31
|
|
|
32
|
+
examples <<~DOC
|
|
33
|
+
**Tap a repository**:
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
homebrew_tap 'apple/homebrew-apple'
|
|
37
|
+
```
|
|
38
|
+
DOC
|
|
39
|
+
|
|
32
40
|
include Chef::Mixin::Homebrew
|
|
33
41
|
|
|
34
42
|
property :tap_name, String,
|
|
@@ -77,7 +85,7 @@ class Chef
|
|
|
77
85
|
end
|
|
78
86
|
|
|
79
87
|
action_class do
|
|
80
|
-
#
|
|
88
|
+
# Check if the passed tap is already tapped
|
|
81
89
|
#
|
|
82
90
|
# @return [Boolean]
|
|
83
91
|
def tapped?(name)
|
|
@@ -88,7 +96,7 @@ class Chef
|
|
|
88
96
|
"/opt/homebrew",
|
|
89
97
|
"/usr/local/Homebrew",
|
|
90
98
|
"/home/linuxbrew/.linuxbrew",
|
|
91
|
-
].
|
|
99
|
+
].select { |x| Dir.exist?(x) }.first
|
|
92
100
|
tap_dir = name.gsub("/", "/homebrew-")
|
|
93
101
|
::File.directory?("#{base_path}/Library/Taps/#{tap_dir}")
|
|
94
102
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Joshua Timberman (<jtimberman@chef.io>)
|
|
3
3
|
# Author:: Dan Webb (<dan@webb-agile-solutions.ltd>)
|
|
4
4
|
#
|
|
5
|
-
# Copyright:: Copyright (c)
|
|
5
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
6
6
|
# Copyright:: Copyright (c) Webb Agile Solutions Ltd.
|
|
7
7
|
#
|
|
8
8
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright:: Copyright (c)
|
|
2
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
# License:: Apache License, Version 2.0
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -24,7 +24,9 @@ class Chef
|
|
|
24
24
|
# @since 14.0.0
|
|
25
25
|
class Hostname < Chef::Resource
|
|
26
26
|
|
|
27
|
-
provides :hostname
|
|
27
|
+
provides :hostname, target_mode: true
|
|
28
|
+
target_mode support: :full,
|
|
29
|
+
platforms: %i{aix bsd linux macos_x solaris}
|
|
28
30
|
|
|
29
31
|
description "Use the **hostname** resource to set the system's hostname, configure hostname and hosts config file, and re-run the Ohai hostname plugin so the hostname will be available in subsequent cookbooks."
|
|
30
32
|
introduced "14.0"
|
|
@@ -99,7 +101,7 @@ class Chef
|
|
|
99
101
|
|
|
100
102
|
action_class do
|
|
101
103
|
def append_replacing_matching_lines(path, regex, string)
|
|
102
|
-
text = IO.read(path).split("\n")
|
|
104
|
+
text = TargetIO::IO.read(path).split("\n")
|
|
103
105
|
text.reject! { |s| s =~ regex }
|
|
104
106
|
text += [ string ]
|
|
105
107
|
file path do
|
|
@@ -107,7 +109,7 @@ class Chef
|
|
|
107
109
|
owner "root"
|
|
108
110
|
group node["root_group"]
|
|
109
111
|
mode "0644"
|
|
110
|
-
not_if { IO.read(path).split("\n").include?(string) }
|
|
112
|
+
not_if { TargetIO::IO.read(path).split("\n").include?(string) }
|
|
111
113
|
end
|
|
112
114
|
end
|
|
113
115
|
|
|
@@ -181,14 +183,14 @@ class Chef
|
|
|
181
183
|
end
|
|
182
184
|
when linux?
|
|
183
185
|
case
|
|
184
|
-
when ::File.exist?("/usr/bin/hostnamectl") && !docker?
|
|
186
|
+
when ::TargetIO::File.exist?("/usr/bin/hostnamectl") && !docker?
|
|
185
187
|
# use hostnamectl whenever we find it on linux (as systemd takes over the world)
|
|
186
188
|
# this must come before other methods like /etc/hostname and /etc/sysconfig/network
|
|
187
189
|
execute "hostnamectl set-hostname #{new_resource.hostname}" do
|
|
188
190
|
notifies :reload, "ohai[reload hostname]"
|
|
189
191
|
not_if { shell_out!("hostnamectl status", returns: [0, 1]).stdout =~ /Static hostname:\s*#{new_resource.hostname}\s*$/ }
|
|
190
192
|
end
|
|
191
|
-
when ::File.exist?("/etc/hostname")
|
|
193
|
+
when ::TargetIO::File.exist?("/etc/hostname")
|
|
192
194
|
# debian family uses /etc/hostname
|
|
193
195
|
# arch also uses /etc/hostname
|
|
194
196
|
# the "platform: iox_xr, platform_family: wrlinux, os: linux" platform also hits this
|
|
@@ -201,10 +203,10 @@ class Chef
|
|
|
201
203
|
group node["root_group"]
|
|
202
204
|
mode "0644"
|
|
203
205
|
end
|
|
204
|
-
when ::File.file?("/etc/sysconfig/network")
|
|
206
|
+
when ::TargetIO::File.file?("/etc/sysconfig/network")
|
|
205
207
|
# older non-systemd RHEL/Fedora derived
|
|
206
208
|
append_replacing_matching_lines("/etc/sysconfig/network", /^HOSTNAME\s*=/, "HOSTNAME=#{new_resource.hostname}")
|
|
207
|
-
when ::File.exist?("/etc/HOSTNAME")
|
|
209
|
+
when ::TargetIO::File.exist?("/etc/HOSTNAME")
|
|
208
210
|
# SuSE/openSUSE uses /etc/HOSTNAME
|
|
209
211
|
file "/etc/HOSTNAME" do
|
|
210
212
|
content "#{new_resource.hostname}\n"
|
|
@@ -212,7 +214,7 @@ class Chef
|
|
|
212
214
|
group node["root_group"]
|
|
213
215
|
mode "0644"
|
|
214
216
|
end
|
|
215
|
-
when ::File.exist?("/etc/conf.d/hostname")
|
|
217
|
+
when ::TargetIO::File.exist?("/etc/conf.d/hostname")
|
|
216
218
|
# Gentoo
|
|
217
219
|
file "/etc/conf.d/hostname" do
|
|
218
220
|
content "hostname=\"#{new_resource.hostname}\"\n"
|
|
@@ -226,7 +228,7 @@ class Chef
|
|
|
226
228
|
# that manage sysctls on linux.
|
|
227
229
|
append_replacing_matching_lines("/etc/sysctl.conf", /^\s+kernel\.hostname\s+=/, "kernel.hostname=#{new_resource.hostname}")
|
|
228
230
|
end
|
|
229
|
-
when ::File.exist?("/etc/rc.conf")
|
|
231
|
+
when ::TargetIO::File.exist?("/etc/rc.conf")
|
|
230
232
|
# *BSD systems with /etc/rc.conf + /etc/myname
|
|
231
233
|
append_replacing_matching_lines("/etc/rc.conf", /^\s+hostname\s+=/, "hostname=#{new_resource.hostname}")
|
|
232
234
|
|
|
@@ -236,8 +238,8 @@ class Chef
|
|
|
236
238
|
group node["root_group"]
|
|
237
239
|
mode "0644"
|
|
238
240
|
end
|
|
239
|
-
when ::File.exist?("/usr/sbin/svccfg") # solaris 5.11
|
|
240
|
-
execute "svccfg -s system/identity:node setprop config/nodename
|
|
241
|
+
when ::TargetIO::File.exist?("/usr/sbin/svccfg") # solaris 5.11
|
|
242
|
+
execute "svccfg -s system/identity:node setprop config/nodename='#{new_resource.hostname}'" do
|
|
241
243
|
notifies :run, "execute[svcadm refresh]", :immediately
|
|
242
244
|
notifies :run, "execute[svcadm restart]", :immediately
|
|
243
245
|
not_if { shell_out!("svccfg -s system/identity:node listprop config/nodename").stdout.chomp =~ %r{config/nodename\s+astring\s+#{new_resource.hostname}} }
|
|
@@ -251,7 +253,7 @@ class Chef
|
|
|
251
253
|
action :nothing
|
|
252
254
|
end
|
|
253
255
|
else
|
|
254
|
-
raise "Do not know how to set hostname on os #{node["os"]}, platform #{node["platform"]},"\
|
|
256
|
+
raise "Do not know how to set hostname on os #{node["os"]}, platform #{node["platform"]}," \
|
|
255
257
|
"platform_version #{node["platform_version"]}, platform_family #{node["platform_family"]}"
|
|
256
258
|
end
|
|
257
259
|
|
|
@@ -259,6 +261,7 @@ class Chef
|
|
|
259
261
|
WINDOWS_EC2_CONFIG = 'C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml'.freeze
|
|
260
262
|
|
|
261
263
|
raise "Windows hostnames cannot contain a period." if new_resource.hostname.include?(".")
|
|
264
|
+
raise "Windows not supported in Target Mode" if ChefConfig::Config.target_mode?
|
|
262
265
|
|
|
263
266
|
# suppress EC2 config service from setting our hostname
|
|
264
267
|
if ::File.exist?(WINDOWS_EC2_CONFIG)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
3
|
# Author:: Tyler Cloke (<tyler@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,8 @@ class Chef
|
|
|
23
23
|
class Resource
|
|
24
24
|
class HttpRequest < Chef::Resource
|
|
25
25
|
|
|
26
|
-
provides :http_request
|
|
26
|
+
provides :http_request, target_mode: true
|
|
27
|
+
target_mode support: :full
|
|
27
28
|
|
|
28
29
|
description "Use the **http_request** resource to send an HTTP request (`GET`, `PUT`, `POST`, `DELETE`, `HEAD`, or `OPTIONS`) with an arbitrary message. This resource is often useful when custom callbacks are necessary."
|
|
29
30
|
|
|
@@ -23,7 +23,8 @@ class Chef
|
|
|
23
23
|
class Resource
|
|
24
24
|
class Ifconfig < Chef::Resource
|
|
25
25
|
|
|
26
|
-
provides :ifconfig
|
|
26
|
+
provides :ifconfig, target_mode: true
|
|
27
|
+
target_mode support: :full
|
|
27
28
|
|
|
28
29
|
description "Use the **ifconfig** resource to manage interfaces on Unix and Linux systems. Note: This resource requires the ifconfig binary to be present on the system and may require additional packages to be installed first. On Ubuntu 18.04 or later you will need to install the `ifupdown` package, which disables the built in Netplan functionality. Warning: This resource will not work with Fedora release 33 or later."
|
|
29
30
|
examples <<~DOC
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright:: Copyright (c)
|
|
2
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,8 @@ require_relative "../resource"
|
|
|
19
19
|
class Chef
|
|
20
20
|
class Resource
|
|
21
21
|
class InspecInput < Chef::Resource
|
|
22
|
-
provides :inspec_input
|
|
22
|
+
provides :inspec_input, target_mode: true
|
|
23
|
+
target_mode support: :full
|
|
23
24
|
|
|
24
25
|
description "Use the **inspec_input** resource to add an input to the Compliance Phase."
|
|
25
26
|
introduced "17.5"
|
|
@@ -105,6 +106,8 @@ class Chef
|
|
|
105
106
|
def build_source
|
|
106
107
|
return new_resource.source unless new_resource.source.nil?
|
|
107
108
|
return nil unless new_resource.input.count(::File::SEPARATOR) > 0 || (::File::ALT_SEPARATOR && new_resource.input.count(::File::ALT_SEPARATOR) > 0 )
|
|
109
|
+
|
|
110
|
+
# InSpec gets processed locally, so no TargetIO
|
|
108
111
|
return nil unless ::File.exist?(new_resource.input)
|
|
109
112
|
|
|
110
113
|
new_resource.input
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright:: Copyright (c)
|
|
2
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,8 @@ require_relative "../resource"
|
|
|
19
19
|
class Chef
|
|
20
20
|
class Resource
|
|
21
21
|
class InspecWaiver < Chef::Resource
|
|
22
|
-
provides :inspec_waiver
|
|
22
|
+
provides :inspec_waiver, target_mode: true
|
|
23
|
+
target_mode support: :full
|
|
23
24
|
|
|
24
25
|
description "Use the **inspec_waiver** resource to add a waiver to the Compliance Phase."
|
|
25
26
|
introduced "17.5"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Davin Taddeo (<davin@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
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -23,7 +23,8 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
|
23
23
|
class Chef
|
|
24
24
|
class Resource
|
|
25
25
|
class InspecWaiverFileEntry < Chef::Resource
|
|
26
|
-
provides :inspec_waiver_file_entry
|
|
26
|
+
provides :inspec_waiver_file_entry, target_mode: true
|
|
27
|
+
target_mode support: :full
|
|
27
28
|
|
|
28
29
|
description "Use the **inspec_waiver_file_entry** resource to add or remove entries from an InSpec waiver file. This can be used in conjunction with the Compliance Phase."
|
|
29
30
|
introduced "17.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Jason Williams (<williamsjj@digitar.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,8 +23,9 @@ class Chef
|
|
|
23
23
|
class Resource
|
|
24
24
|
class IpsPackage < ::Chef::Resource::Package
|
|
25
25
|
|
|
26
|
-
provides :ips_package
|
|
27
|
-
provides :package, os: "solaris2"
|
|
26
|
+
provides :ips_package, target_mode: true
|
|
27
|
+
provides :package, os: "solaris2", target_mode: true
|
|
28
|
+
target_mode support: :full
|
|
28
29
|
|
|
29
30
|
description "Use the **ips_package** resource to manage packages (using Image Packaging System (IPS)) on the Solaris 11 platform."
|
|
30
31
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# The MIT License (MIT)
|
|
5
5
|
#
|
|
6
6
|
# Copyright:: 2016-2018, Shopify Inc.
|
|
7
|
-
# Copyright:: Copyright (c)
|
|
7
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
8
8
|
|
|
9
9
|
require_relative "../resource"
|
|
10
10
|
|
|
@@ -12,7 +12,8 @@ class Chef
|
|
|
12
12
|
class Resource
|
|
13
13
|
class KernelModule < Chef::Resource
|
|
14
14
|
|
|
15
|
-
provides :kernel_module
|
|
15
|
+
provides :kernel_module, target_mode: true
|
|
16
|
+
target_mode support: :full
|
|
16
17
|
|
|
17
18
|
description "Use the **kernel_module** resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, disable, enable, install, and uninstall modules."
|
|
18
19
|
introduced "14.3"
|
|
@@ -232,7 +233,7 @@ class Chef
|
|
|
232
233
|
# see if the module is listed in /proc/modules or not
|
|
233
234
|
# @return [Boolean]
|
|
234
235
|
def module_loaded?
|
|
235
|
-
/^#{new_resource.modname}/.match?(::File.read("/proc/modules"))
|
|
236
|
+
/^#{new_resource.modname}/.match?(::TargetIO::File.read("/proc/modules"))
|
|
236
237
|
end
|
|
237
238
|
end
|
|
238
239
|
end
|
data/lib/chef/resource/ksh.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Nolan Davidson (<nolan.davidson@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");
|
|
@@ -22,13 +22,14 @@ class Chef
|
|
|
22
22
|
class Resource
|
|
23
23
|
class Ksh < Chef::Resource::Script
|
|
24
24
|
|
|
25
|
-
provides :ksh
|
|
25
|
+
provides :ksh, target_mode: true
|
|
26
|
+
target_mode support: :full
|
|
26
27
|
|
|
27
|
-
description "Use the **ksh** resource to execute scripts using the Korn shell (ksh)"\
|
|
28
|
-
" interpreter. This resource may also use any of the actions and properties"\
|
|
29
|
-
" that are available to the **execute** resource. Commands that are executed"\
|
|
30
|
-
" with this resource are (by their nature) not idempotent, as they are"\
|
|
31
|
-
" typically unique to the environment in which they are run. Use `not_if`"\
|
|
28
|
+
description "Use the **ksh** resource to execute scripts using the Korn shell (ksh)" \
|
|
29
|
+
" interpreter. This resource may also use any of the actions and properties" \
|
|
30
|
+
" that are available to the **execute** resource. Commands that are executed" \
|
|
31
|
+
" with this resource are (by their nature) not idempotent, as they are" \
|
|
32
|
+
" typically unique to the environment in which they are run. Use `not_if`" \
|
|
32
33
|
" and `only_if` to guard this resource for idempotence."
|
|
33
34
|
introduced "12.6"
|
|
34
35
|
|
|
@@ -190,7 +190,7 @@ class Chef
|
|
|
190
190
|
|
|
191
191
|
property :nice, Integer,
|
|
192
192
|
description: "The program scheduling priority value in the range -20 to 19.",
|
|
193
|
-
callbacks: { "should be a Integer between -20 and 19" => proc { |v| v
|
|
193
|
+
callbacks: { "should be a Integer between -20 and 19" => proc { |v| v.between?(-20, 19) } }
|
|
194
194
|
|
|
195
195
|
property :on_demand, [ TrueClass, FalseClass ],
|
|
196
196
|
description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use `keep_alive` instead for newer versions."
|
data/lib/chef/resource/link.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
3
|
# Author:: Tyler Cloke (<tyler@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");
|
|
@@ -25,16 +25,17 @@ class Chef
|
|
|
25
25
|
class Link < Chef::Resource
|
|
26
26
|
include Chef::Mixin::Securable
|
|
27
27
|
|
|
28
|
-
provides :link
|
|
28
|
+
provides :link, target_mode: true
|
|
29
|
+
target_mode support: :full
|
|
29
30
|
|
|
30
|
-
description "Use the **link** resource to create symbolic or hard links.\n\n"\
|
|
31
|
-
"A symbolic link—sometimes referred to as a soft link—is a directory entry"\
|
|
32
|
-
" that associates a file name with a string that contains an absolute or"\
|
|
33
|
-
" relative path to a file on any file system. In other words, 'a file that"\
|
|
34
|
-
" contains a path that points to another file.' A symbolic link creates a new"\
|
|
35
|
-
" file with a new inode that points to the inode location of the original file.\n\n"\
|
|
36
|
-
"A hard link is a directory entry that associates a file with another file in the"\
|
|
37
|
-
" same file system. In other words, 'multiple directory entries to the same file.'"\
|
|
31
|
+
description "Use the **link** resource to create symbolic or hard links.\n\n" \
|
|
32
|
+
"A symbolic link—sometimes referred to as a soft link—is a directory entry" \
|
|
33
|
+
" that associates a file name with a string that contains an absolute or" \
|
|
34
|
+
" relative path to a file on any file system. In other words, 'a file that" \
|
|
35
|
+
" contains a path that points to another file.' A symbolic link creates a new" \
|
|
36
|
+
" file with a new inode that points to the inode location of the original file.\n\n" \
|
|
37
|
+
"A hard link is a directory entry that associates a file with another file in the" \
|
|
38
|
+
" same file system. In other words, 'multiple directory entries to the same file.'" \
|
|
38
39
|
" A hard link creates a new file that points to the same inode as the original file."
|
|
39
40
|
|
|
40
41
|
state_attrs :owner # required since it's not a property below
|
|
@@ -46,7 +47,7 @@ class Chef
|
|
|
46
47
|
description: "An optional property to set the target file if it differs from the resource block's name.",
|
|
47
48
|
name_property: true
|
|
48
49
|
|
|
49
|
-
property :to, String,
|
|
50
|
+
property :to, [String, nil],
|
|
50
51
|
description: "The actual file to which the link is to be created."
|
|
51
52
|
|
|
52
53
|
property :link_type, [String, Symbol],
|
data/lib/chef/resource/locale.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Copyright:: 2011-2016, Heavy Water Software Inc.
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -21,7 +21,8 @@ require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
|
21
21
|
class Chef
|
|
22
22
|
class Resource
|
|
23
23
|
class Locale < Chef::Resource
|
|
24
|
-
provides :locale
|
|
24
|
+
provides :locale, target_mode: true
|
|
25
|
+
target_mode support: :full
|
|
25
26
|
|
|
26
27
|
description "Use the **locale** resource to set the system's locale on Debian and Windows systems. Windows support was added in Chef Infra Client 16.0"
|
|
27
28
|
introduced "14.5"
|
|
@@ -38,7 +39,7 @@ class Chef
|
|
|
38
39
|
|
|
39
40
|
LC_VARIABLES ||= %w{LC_ADDRESS LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME}.freeze
|
|
40
41
|
LOCALE_CONF ||= "/etc/locale.conf".freeze
|
|
41
|
-
LOCALE_REGEX ||= /\A\S
|
|
42
|
+
LOCALE_REGEX ||= /\A\S+/
|
|
42
43
|
LOCALE_PLATFORM_FAMILIES ||= %w{debian windows}.freeze
|
|
43
44
|
|
|
44
45
|
property :lang, String,
|
|
@@ -79,7 +80,7 @@ class Chef
|
|
|
79
80
|
lang get_system_locale_windows
|
|
80
81
|
else
|
|
81
82
|
begin
|
|
82
|
-
old_content = ::File.read(LOCALE_CONF)
|
|
83
|
+
old_content = ::TargetIO::File.read(LOCALE_CONF)
|
|
83
84
|
locale_values = Hash[old_content.split("\n").map { |v| v.split("=") }]
|
|
84
85
|
lang locale_values["LANG"]
|
|
85
86
|
rescue Errno::ENOENT => e
|
data/lib/chef/resource/log.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Cary Penniman (<cary@rightscale.com>)
|
|
3
3
|
# Author:: Tyler Cloke (<tyler@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");
|
|
@@ -31,11 +31,13 @@ class Chef
|
|
|
31
31
|
class Log < Chef::Resource
|
|
32
32
|
|
|
33
33
|
provides :log, target_mode: true
|
|
34
|
+
target_mode support: :full,
|
|
35
|
+
introduced: "15.1"
|
|
34
36
|
|
|
35
|
-
description "Use the **log** resource to create log entries. The log resource behaves"\
|
|
36
|
-
" like any other resource: built into the resource collection during the"\
|
|
37
|
-
" compile phase, and then run during the execution phase. (To create a log"\
|
|
38
|
-
" entry that is not built into the resource collection, use Chef::Log instead"\
|
|
37
|
+
description "Use the **log** resource to create log entries. The log resource behaves" \
|
|
38
|
+
" like any other resource: built into the resource collection during the" \
|
|
39
|
+
" compile phase, and then run during the execution phase. (To create a log" \
|
|
40
|
+
" entry that is not built into the resource collection, use Chef::Log instead" \
|
|
39
41
|
" of the log resource.)"
|
|
40
42
|
|
|
41
43
|
property :message, String,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Author:: Adam Jacob (<adam@chef.io>)
|
|
3
3
|
# Author:: Christopher Walters (<cw@chef.io>)
|
|
4
4
|
# Author:: Daniel DeLeo (<dan@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:: Joshua Timberman (<jtimberman@chef.io>)
|
|
3
3
|
# Author:: William Theaker (<william.theaker+chef@gusto.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
|
#
|
|
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
|
# Copyright:: 2011-2018, Joshua Timberman
|
|
3
|
-
# Copyright:: Copyright (c)
|
|
3
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: David Balatero (<dbalatero@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");
|
data/lib/chef/resource/mdadm.rb
CHANGED
|
@@ -25,9 +25,9 @@ class Chef
|
|
|
25
25
|
|
|
26
26
|
provides :mdadm
|
|
27
27
|
|
|
28
|
-
description "Use the **mdadm** resource to manage RAID devices in a Linux environment using the mdadm utility. The mdadm resource"\
|
|
29
|
-
" will create and assemble an array, but it will not create the config file that is used to persist the array upon"\
|
|
30
|
-
" reboot. If the config file is required, it must be done by specifying a template with the correct array layout,"\
|
|
28
|
+
description "Use the **mdadm** resource to manage RAID devices in a Linux environment using the mdadm utility. The mdadm resource" \
|
|
29
|
+
" will create and assemble an array, but it will not create the config file that is used to persist the array upon" \
|
|
30
|
+
" reboot. If the config file is required, it must be done by specifying a template with the correct array layout," \
|
|
31
31
|
" and then by using the mount provider to create a file systems table (fstab) entry."
|
|
32
32
|
|
|
33
33
|
examples <<~DOC
|
data/lib/chef/resource/mount.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Joshua Timberman (<joshua@chef.io>)
|
|
3
3
|
# Author:: Tyler Cloke (<tyler@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");
|
|
@@ -24,7 +24,9 @@ class Chef
|
|
|
24
24
|
class Mount < Chef::Resource
|
|
25
25
|
description "Use the **mount** resource to manage a mounted file system."
|
|
26
26
|
|
|
27
|
-
provides :mount
|
|
27
|
+
provides :mount, target_mode: true
|
|
28
|
+
target_mode support: :full,
|
|
29
|
+
platforms: %i{aix bsd linux}
|
|
28
30
|
|
|
29
31
|
default_action :mount
|
|
30
32
|
allowed_actions :mount, :umount, :unmount, :remount, :enable, :disable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.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");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Copyright:: Copyright (c)
|
|
2
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
# you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,8 @@ require_relative "../resource"
|
|
|
19
19
|
class Chef
|
|
20
20
|
class Resource
|
|
21
21
|
class NotifyGroup < Chef::Resource
|
|
22
|
-
provides :notify_group
|
|
22
|
+
provides :notify_group, target_mode: true
|
|
23
|
+
target_mode support: :full
|
|
23
24
|
|
|
24
25
|
description "The notify_group resource does nothing, and always fires notifications which are set on it. Use it to DRY blocks of notifications that are common to multiple resources, and provide a single target for other resources to notify. Unlike most resources, its default action is :nothing."
|
|
25
26
|
introduced "15.8"
|