Class: Chef

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/pwsh.rb,
lib/chef/key.rb,
lib/chef/log.rb,
lib/chef/org.rb,
lib/chef/http.rb,
lib/chef/node.rb,
lib/chef/role.rb,
lib/chef/user.rb,
lib/chef/group.rb,
lib/chef/client.rb,
lib/chef/config.rb,
lib/chef/daemon.rb,
lib/chef/recipe.rb,
lib/chef/runner.rb,
lib/chef/chef_fs.rb,
lib/chef/handler.rb,
lib/chef/sandbox.rb,
lib/chef/user_v1.rb,
lib/chef/version.rb,
lib/chef/data_bag.rb,
lib/chef/digester.rb,
lib/chef/dsl/toml.rb,
lib/chef/node_map.rb,
lib/chef/platform.rb,
lib/chef/property.rb,
lib/chef/provider.rb,
lib/chef/resource.rb,
lib/chef/run_list.rb,
lib/chef/run_lock.rb,
lib/chef/constants.rb,
lib/chef/decorator.rb,
lib/chef/util/diff.rb,
lib/chef/win32/api.rb,
lib/chef/win32/net.rb,
lib/chef/api_client.rb,
lib/chef/chef_class.rb,
lib/chef/deprecated.rb,
lib/chef/dsl/recipe.rb,
lib/chef/dsl/secret.rb,
lib/chef/exceptions.rb,
lib/chef/file_cache.rb,
lib/chef/local_mode.rb,
lib/chef/log/syslog.rb,
lib/chef/log/winevt.rb,
lib/chef/mixin/uris.rb,
lib/chef/request_id.rb,
lib/chef/server_api.rb,
lib/chef/win32/file.rb,
lib/chef/application.rb,
lib/chef/environment.rb,
lib/chef/http/simple.rb,
lib/chef/json_compat.rb,
lib/chef/mixin/which.rb,
lib/chef/null_logger.rb,
lib/chef/run_context.rb,
lib/chef/util/backup.rb,
lib/chef/util/editor.rb,
lib/chef/win32/error.rb,
lib/chef/win32/mutex.rb,
lib/chef/dsl/cheffish.rb,
lib/chef/provider/git.rb,
lib/chef/resource/csh.rb,
lib/chef/resource/ksh.rb,
lib/chef/resource/log.rb,
lib/chef/search/query.rb,
lib/chef/util/selinux.rb,
lib/chef/util/windows.rb,
lib/chef/win32/crypto.rb,
lib/chef/win32/handle.rb,
lib/chef/win32/memory.rb,
lib/chef/win32/system.rb,
lib/chef/api_client_v1.rb,
lib/chef/data_bag_item.rb,
lib/chef/dsl/resources.rb,
lib/chef/dsl/universal.rb,
lib/chef/mixin/why_run.rb,
lib/chef/provider/cron.rb,
lib/chef/provider/file.rb,
lib/chef/provider/link.rb,
lib/chef/provider/noop.rb,
lib/chef/provider/user.rb,
lib/chef/resource/bash.rb,
lib/chef/resource/file.rb,
lib/chef/resource/link.rb,
lib/chef/resource/ohai.rb,
lib/chef/resource/perl.rb,
lib/chef/resource/ruby.rb,
lib/chef/resource/sudo.rb,
lib/chef/resource/user.rb,
lib/chef/version_class.rb,
lib/chef/win32/api/net.rb,
lib/chef/win32/process.rb,
lib/chef/win32/unicode.rb,
lib/chef/win32/version.rb,
lib/chef/chef_fs/config.rb,
lib/chef/config_fetcher.rb,
lib/chef/data_collector.rb,
lib/chef/decorator/lazy.rb,
lib/chef/dsl/chef_vault.rb,
lib/chef/dsl/compliance.rb,
lib/chef/dsl/data_query.rb,
lib/chef/dsl/powershell.rb,
lib/chef/formatters/doc.rb,
lib/chef/mixin/checksum.rb,
lib/chef/mixin/provides.rb,
lib/chef/mixin/template.rb,
lib/chef/node/attribute.rb,
lib/chef/policy_builder.rb,
lib/chef/provider/batch.rb,
lib/chef/provider/group.rb,
lib/chef/provider/mount.rb,
lib/chef/provider/route.rb,
lib/chef/reserved_names.rb,
lib/chef/resource/batch.rb,
lib/chef/resource/group.rb,
lib/chef/resource/mdadm.rb,
lib/chef/resource/mount.rb,
lib/chef/resource/plist.rb,
lib/chef/resource/route.rb,
lib/chef/secret_fetcher.rb,
lib/chef/util/file_edit.rb,
lib/chef/version_string.rb,
lib/chef/win32/api/file.rb,
lib/chef/win32/registry.rb,
lib/chef/win32/security.rb,
lib/chef/cookbook_loader.rb,
lib/chef/dsl/definitions.rb,
lib/chef/formatters/base.rb,
lib/chef/http/cookie_jar.rb,
lib/chef/http/json_input.rb,
lib/chef/mixin/from_file.rb,
lib/chef/mixin/securable.rb,
lib/chef/mixin/shell_out.rb,
lib/chef/node/common_api.rb,
lib/chef/provider/script.rb,
lib/chef/resource/locale.rb,
lib/chef/resource/python.rb,
lib/chef/resource/reboot.rb,
lib/chef/resource/script.rb,
lib/chef/resource/sysctl.rb,
lib/chef/train_transport.rb,
lib/chef/win32/api/error.rb,
lib/chef/win32/api/psapi.rb,
lib/chef/win32/file/info.rb,
lib/chef/compliance/input.rb,
lib/chef/cookbook_version.rb,
lib/chef/http/json_output.rb,
lib/chef/http/simple_json.rb,
lib/chef/mixin/deep_merge.rb,
lib/chef/mixin/file_class.rb,
lib/chef/mixin/properties.rb,
lib/chef/mixin/xml_escape.rb,
lib/chef/provider/execute.rb,
lib/chef/provider/launchd.rb,
lib/chef/provider/package.rb,
lib/chef/provider/service.rb,
lib/chef/provider/user/pw.rb,
lib/chef/resource/execute.rb,
lib/chef/resource/launchd.rb,
lib/chef/resource/package.rb,
lib/chef/resource/scm/git.rb,
lib/chef/resource/service.rb,
lib/chef/resource_builder.rb,
lib/chef/util/path_helper.rb,
lib/chef/version/platform.rb,
lib/chef/win32/api/crypto.rb,
lib/chef/win32/api/memory.rb,
lib/chef/win32/api/system.rb,
lib/chef/action_collection.rb,
lib/chef/compliance/runner.rb,
lib/chef/compliance/waiver.rb,
lib/chef/cookbook/metadata.rb,
lib/chef/cookbook_manifest.rb,
lib/chef/cookbook_uploader.rb,
lib/chef/decorator/unchain.rb,
lib/chef/delayed_evaluator.rb,
lib/chef/dsl/rest_resource.rb,
lib/chef/guard_interpreter.rb,
lib/chef/handler/json_file.rb,
lib/chef/http/api_versions.rb,
lib/chef/http/basic_client.rb,
lib/chef/http/decompressor.rb,
lib/chef/http/http_request.rb,
lib/chef/http/ssl_policies.rb,
lib/chef/mixin/create_path.rb,
lib/chef/mixin/deprecation.rb,
lib/chef/mixin/path_sanity.rb,
lib/chef/mixin/unformatter.rb,
lib/chef/mixin/wide_string.rb,
lib/chef/platform/rebooter.rb,
lib/chef/provider/cron/aix.rb,
lib/chef/provider/group/pw.rb,
lib/chef/provider/ifconfig.rb,
lib/chef/provider/template.rb,
lib/chef/provider/user/aix.rb,
lib/chef/provider/user/mac.rb,
lib/chef/provider_resolver.rb,
lib/chef/resource/chef_gem.rb,
lib/chef/resource/hostname.rb,
lib/chef/resource/ifconfig.rb,
lib/chef/resource/template.rb,
lib/chef/resource/timezone.rb,
lib/chef/resource_reporter.rb,
lib/chef/resource_resolver.rb,
lib/chef/win32/api/process.rb,
lib/chef/win32/api/unicode.rb,
lib/chef/chef_fs/path_utils.rb,
lib/chef/compliance/profile.rb,
lib/chef/dsl/include_recipe.rb,
lib/chef/dsl/reader_helpers.rb,
lib/chef/dsl/reboot_pending.rb,
lib/chef/dsl/render_helpers.rb,
lib/chef/event_dispatch/dsl.rb,
lib/chef/event_loggers/base.rb,
lib/chef/formatters/minimal.rb,
lib/chef/http/authenticator.rb,
lib/chef/mixin/user_context.rb,
lib/chef/provider/cron/unix.rb,
lib/chef/provider/directory.rb,
lib/chef/provider/group/aix.rb,
lib/chef/provider/lwrp_base.rb,
lib/chef/provider/mount/aix.rb,
lib/chef/provider/user/dscl.rb,
lib/chef/resource/cron/cron.rb,
lib/chef/resource/directory.rb,
lib/chef/resource/lwrp_base.rb,
lib/chef/resource/ohai_hint.rb,
lib/chef/resource/rhsm_repo.rb,
lib/chef/resource/swap_file.rb,
lib/chef/resource_inspector.rb,
lib/chef/version_constraint.rb,
lib/chef/win32/api/registry.rb,
lib/chef/win32/api/security.rb,
lib/chef/win32/security/ace.rb,
lib/chef/win32/security/acl.rb,
lib/chef/win32/security/sid.rb,
lib/chef/attribute_allowlist.rb,
lib/chef/attribute_blocklist.rb,
lib/chef/chef_fs/file_system.rb,
lib/chef/cookbook/chefignore.rb,
lib/chef/dsl/registry_helper.rb,
lib/chef/event_dispatch/base.rb,
lib/chef/file_access_control.rb,
lib/chef/handler/slow_report.rb,
lib/chef/http/cookie_manager.rb,
lib/chef/mixin/default_paths.rb,
lib/chef/mixin/homebrew_user.rb,
lib/chef/mixin/versioned_api.rb,
lib/chef/provider/dsc_script.rb,
lib/chef/provider/group/dscl.rb,
lib/chef/provider/ruby_block.rb,
lib/chef/provider/subversion.rb,
lib/chef/provider/user/linux.rb,
lib/chef/resource/apt_update.rb,
lib/chef/resource/breakpoint.rb,
lib/chef/resource/chef_sleep.rb,
lib/chef/resource/dsc_script.rb,
lib/chef/resource/ruby_block.rb,
lib/chef/resource_collection.rb,
lib/chef/resource_definition.rb,
lib/chef/scan_access_control.rb,
lib/chef/secret_fetcher/base.rb,
lib/chef/server_api_versions.rb,
lib/chef/win32/api/installer.rb,
lib/chef/chef_fs/command_line.rb,
lib/chef/chef_fs/file_pattern.rb,
lib/chef/cookbook/file_vendor.rb,
lib/chef/cookbook/manifest_v0.rb,
lib/chef/cookbook/manifest_v2.rb,
lib/chef/decorator/lazy_array.rb,
lib/chef/deprecation/warnings.rb,
lib/chef/dsl/declare_resource.rb,
lib/chef/handler/error_report.rb,
lib/chef/mixin/openssl_helper.rb,
lib/chef/mixin/powershell_out.rb,
lib/chef/provider/mount/linux.rb,
lib/chef/provider/mount/mount.rb,
lib/chef/provider/package/apt.rb,
lib/chef/provider/package/bff.rb,
lib/chef/provider/package/cab.rb,
lib/chef/provider/package/deb.rb,
lib/chef/provider/package/dnf.rb,
lib/chef/provider/package/ips.rb,
lib/chef/provider/package/msu.rb,
lib/chef/provider/package/rpm.rb,
lib/chef/provider/package/yum.rb,
lib/chef/provider/remote_file.rb,
lib/chef/provider/service/aix.rb,
lib/chef/resource/apt_package.rb,
lib/chef/resource/bff_package.rb,
lib/chef/resource/cab_package.rb,
lib/chef/resource/conditional.rb,
lib/chef/resource/cron/cron_d.rb,
lib/chef/resource/cron_access.rb,
lib/chef/resource/dmg_package.rb,
lib/chef/resource/dnf_package.rb,
lib/chef/resource/gem_package.rb,
lib/chef/resource/ips_package.rb,
lib/chef/resource/msu_package.rb,
lib/chef/resource/osx_profile.rb,
lib/chef/resource/remote_file.rb,
lib/chef/resource/rhsm_errata.rb,
lib/chef/resource/rpm_package.rb,
lib/chef/resource/user_ulimit.rb,
lib/chef/resource/windows_env.rb,
lib/chef/resource/windows_uac.rb,
lib/chef/resource/yum_package.rb,
lib/chef/win32/security/token.rb,
lib/chef/application/exit_code.rb,
lib/chef/cookbook/synchronizer.rb,
lib/chef/cookbook/syntax_check.rb,
lib/chef/dsl/include_attribute.rb,
lib/chef/http/auth_credentials.rb,
lib/chef/mixin/notifying_block.rb,
lib/chef/mixin/params_validate.rb,
lib/chef/mixin/powershell_exec.rb,
lib/chef/platform/priority_map.rb,
lib/chef/provider/dsc_resource.rb,
lib/chef/provider/file/content.rb,
lib/chef/provider/http_request.rb,
lib/chef/provider/ifconfig/aix.rb,
lib/chef/provider/package/dpkg.rb,
lib/chef/provider/package/snap.rb,
lib/chef/provider/registry_key.rb,
lib/chef/provider/service/init.rb,
lib/chef/provider/systemd_unit.rb,
lib/chef/provider/user/solaris.rb,
lib/chef/provider/user/windows.rb,
lib/chef/resource/action_class.rb,
lib/chef/resource/alternatives.rb,
lib/chef/resource/archive_file.rb,
lib/chef/resource/chef_handler.rb,
lib/chef/resource/dpkg_package.rb,
lib/chef/resource/dsc_resource.rb,
lib/chef/resource/homebrew_tap.rb,
lib/chef/resource/http_request.rb,
lib/chef/resource/inspec_input.rb,
lib/chef/resource/notify_group.rb,
lib/chef/resource/registry_key.rb,
lib/chef/resource/selinux_port.rb,
lib/chef/resource/selinux_user.rb,
lib/chef/resource/snap_package.rb,
lib/chef/resource/systemd_unit.rb,
lib/chef/resource/user/pw_user.rb,
lib/chef/resource/windows_font.rb,
lib/chef/resource/windows_path.rb,
lib/chef/resource/windows_task.rb,
lib/chef/cookbook/gem_installer.rb,
lib/chef/http/remote_request_id.rb,
lib/chef/mixin/proxified_socket.rb,
lib/chef/node/mixin/mashy_array.rb,
lib/chef/platform/query_helpers.rb,
lib/chef/policy_builder/dynamic.rb,
lib/chef/provider/cookbook_file.rb,
lib/chef/provider/group/gpasswd.rb,
lib/chef/provider/group/solaris.rb,
lib/chef/provider/group/usermod.rb,
lib/chef/provider/group/windows.rb,
lib/chef/provider/mount/solaris.rb,
lib/chef/provider/mount/windows.rb,
lib/chef/resource/cookbook_file.rb,
lib/chef/resource/homebrew_cask.rb,
lib/chef/resource/inspec_waiver.rb,
lib/chef/resource/kernel_module.rb,
lib/chef/resource/rhsm_register.rb,
lib/chef/resource/selinux_login.rb,
lib/chef/resource/selinux_state.rb,
lib/chef/resource/user/aix_user.rb,
lib/chef/resource/user/mac_user.rb,
lib/chef/resource/windows_share.rb,
lib/chef/run_list/run_list_item.rb,
lib/chef/secret_fetcher/example.rb,
lib/chef/util/dsc/resource_info.rb,
lib/chef/api_client/registration.rb,
lib/chef/compliance/reporter/cli.rb,
lib/chef/formatters/error_mapper.rb,
lib/chef/mixin/chef_utils_wiring.rb,
lib/chef/provider/group/groupadd.rb,
lib/chef/provider/group/groupmod.rb,
lib/chef/provider/package/pacman.rb,
lib/chef/provider/package/zypper.rb,
lib/chef/provider/service/debian.rb,
lib/chef/provider/service/macosx.rb,
lib/chef/provider/service/redhat.rb,
lib/chef/provider/service/simple.rb,
lib/chef/provider/windows_script.rb,
lib/chef/provider/yum_repository.rb,
lib/chef/resource/apt_preference.rb,
lib/chef/resource/apt_repository.rb,
lib/chef/resource/habitat_config.rb,
lib/chef/resource/macosx_service.rb,
lib/chef/resource/pacman_package.rb,
lib/chef/resource/scm/subversion.rb,
lib/chef/resource/selinux_module.rb,
lib/chef/resource/windows_script.rb,
lib/chef/resource/yum_repository.rb,
lib/chef/resource/zypper_package.rb,
lib/chef/util/dsc/resource_store.rb,
lib/chef/util/threaded_job_queue.rb,
lib/chef/win32/file/version_info.rb,
lib/chef/win32_service_constants.rb,
lib/chef/file_access_control/unix.rb,
lib/chef/mixin/subclass_directive.rb,
lib/chef/mixin/windows_env_helper.rb,
lib/chef/platform/service_helpers.rb,
lib/chef/provider/ifconfig/debian.rb,
lib/chef/provider/ifconfig/redhat.rb,
lib/chef/provider/package/habitat.rb,
lib/chef/provider/package/openbsd.rb,
lib/chef/provider/package/paludis.rb,
lib/chef/provider/package/portage.rb,
lib/chef/provider/package/smartos.rb,
lib/chef/provider/package/solaris.rb,
lib/chef/provider/package/windows.rb,
lib/chef/provider/remote_file/ftp.rb,
lib/chef/provider/resource_update.rb,
lib/chef/provider/service/aixinit.rb,
lib/chef/provider/service/freebsd.rb,
lib/chef/provider/service/insserv.rb,
lib/chef/provider/service/openbsd.rb,
lib/chef/provider/service/solaris.rb,
lib/chef/provider/service/upstart.rb,
lib/chef/provider/template_finder.rb,
lib/chef/resource/build_essential.rb,
lib/chef/resource/freebsd_package.rb,
lib/chef/resource/habitat_install.rb,
lib/chef/resource/habitat_service.rb,
lib/chef/resource/homebrew_update.rb,
lib/chef/resource/openbsd_package.rb,
lib/chef/resource/openssl_dhparam.rb,
lib/chef/resource/paludis_package.rb,
lib/chef/resource/portage_package.rb,
lib/chef/resource/selinux_boolean.rb,
lib/chef/resource/selinux_install.rb,
lib/chef/resource/smartos_package.rb,
lib/chef/resource/solaris_package.rb,
lib/chef/resource/user/linux_user.rb,
lib/chef/resource/windows_ad_join.rb,
lib/chef/resource/windows_feature.rb,
lib/chef/resource/windows_package.rb,
lib/chef/resource/windows_printer.rb,
lib/chef/resource/windows_service.rb,
lib/chef/resource_definition_list.rb,
lib/chef/chef_fs/file_system_cache.rb,
lib/chef/event_dispatch/dispatcher.rb,
lib/chef/http/json_to_model_output.rb,
lib/chef/mixin/descendants_tracker.rb,
lib/chef/mixin/lazy_module_include.rb,
lib/chef/node/mixin/state_tracking.rb,
lib/chef/platform/provider_mapping.rb,
lib/chef/policy_builder/policyfile.rb,
lib/chef/provider/package/homebrew.rb,
lib/chef/provider/package/macports.rb,
lib/chef/provider/package/rubygems.rb,
lib/chef/provider/remote_directory.rb,
lib/chef/provider/remote_file/http.rb,
lib/chef/provider/remote_file/sftp.rb,
lib/chef/provider/template/content.rb,
lib/chef/resource/chef_client_cron.rb,
lib/chef/resource/homebrew_package.rb,
lib/chef/resource/macports_package.rb,
lib/chef/resource/openssl_x509_crl.rb,
lib/chef/resource/remote_directory.rb,
lib/chef/resource/selinux_fcontext.rb,
lib/chef/resource/windows_auto_run.rb,
lib/chef/resource/windows_defender.rb,
lib/chef/resource/windows_dns_zone.rb,
lib/chef/resource/windows_pagefile.rb,
lib/chef/resource/windows_shortcut.rb,
lib/chef/win32/api/synchronization.rb,
lib/chef/workstation_config_loader.rb,
lib/chef/chef_fs/chef_fs_data_store.rb,
lib/chef/dsl/platform_introspection.rb,
lib/chef/node/attribute_collections.rb,
lib/chef/node/immutable_collections.rb,
lib/chef/provider/powershell_script.rb,
lib/chef/provider/service/invokercd.rb,
lib/chef/provider/zypper_repository.rb,
lib/chef/resource/chef_vault_secret.rb,
lib/chef/resource/chocolatey_config.rb,
lib/chef/resource/chocolatey_source.rb,
lib/chef/resource/file/verification.rb,
lib/chef/resource/habitat_user_toml.rb,
lib/chef/resource/powershell_script.rb,
lib/chef/resource/rhsm_errata_level.rb,
lib/chef/resource/rhsm_subscription.rb,
lib/chef/resource/user/solaris_user.rb,
lib/chef/resource/user/windows_user.rb,
lib/chef/resource/windows_workgroup.rb,
lib/chef/resource/zypper_repository.rb,
lib/chef/secret_fetcher/hashi_vault.rb,
lib/chef/util/dsc/lcm_output_parser.rb,
lib/chef/util/windows/logon_session.rb,
lib/chef/compliance/fetcher/automate.rb,
lib/chef/compliance/input_collection.rb,
lib/chef/cookbook/remote_file_vendor.rb,
lib/chef/file_access_control/windows.rb,
lib/chef/formatters/error_inspectors.rb,
lib/chef/mixin/convert_to_class_name.rb,
lib/chef/node/mixin/deep_merge_cache.rb,
lib/chef/node/mixin/immutablize_hash.rb,
lib/chef/provider/package/chocolatey.rb,
lib/chef/provider/package/powershell.rb,
lib/chef/resource/chef_client_config.rb,
lib/chef/resource/chocolatey_feature.rb,
lib/chef/resource/chocolatey_package.rb,
lib/chef/resource/macos_userdefaults.rb,
lib/chef/resource/powershell_package.rb,
lib/chef/resource/selinux_permissive.rb,
lib/chef/resource/windows_dfs_folder.rb,
lib/chef/resource/windows_dfs_server.rb,
lib/chef/resource/windows_dns_record.rb,
lib/chef/run_list/run_list_expansion.rb,
lib/chef/version_constraint/platform.rb,
lib/chef/compliance/reporter/automate.rb,
lib/chef/compliance/waiver_collection.rb,
lib/chef/cookbook/cookbook_collection.rb,
lib/chef/formatters/error_description.rb,
lib/chef/http/validate_content_length.rb,
lib/chef/node/mixin/immutablize_array.rb,
lib/chef/provider/package/dnf/version.rb,
lib/chef/provider/package/windows/exe.rb,
lib/chef/provider/package/windows/msi.rb,
lib/chef/provider/package/yum/version.rb,
lib/chef/provider/remote_file/content.rb,
lib/chef/provider/remote_file/fetcher.rb,
lib/chef/resource/chef_client_launchd.rb,
lib/chef/resource/habitat/habitat_sup.rb,
lib/chef/resource/windows_certificate.rb,
lib/chef/compliance/default_attributes.rb,
lib/chef/compliance/profile_collection.rb,
lib/chef/compliance/reporter/json_file.rb,
lib/chef/data_collector/error_handlers.rb,
lib/chef/mixin/get_source_from_package.rb,
lib/chef/platform/provider_handler_map.rb,
lib/chef/platform/resource_handler_map.rb,
lib/chef/provider/package/freebsd/base.rb,
lib/chef/provider/package/freebsd/port.rb,
lib/chef/resource/openssl_x509_request.rb,
lib/chef/resource/windows_audit_policy.rb,
lib/chef/resource/windows_feature_dism.rb,
lib/chef/resource/windows_printer_port.rb,
lib/chef/run_context/cookbook_compiler.rb,
lib/chef/secret_fetcher/akeyless_vault.rb,
lib/chef/util/powershell/ps_credential.rb,
lib/chef/win32/api/command_line_helper.rb,
lib/chef/chef_fs/file_system/exceptions.rb,
lib/chef/compliance/fetcher/chef_server.rb,
lib/chef/data_collector/message_helpers.rb,
lib/chef/data_collector/run_end_message.rb,
lib/chef/event_loggers/windows_eventlog.rb,
lib/chef/file_content_management/deploy.rb,
lib/chef/platform/provider_priority_map.rb,
lib/chef/platform/resource_priority_map.rb,
lib/chef/provider/cookbook_file/content.rb,
lib/chef/provider/package/freebsd/pkgng.rb,
lib/chef/provider/package/yum/rpm_utils.rb,
lib/chef/provider/package/yum/yum_cache.rb,
lib/chef/resource/openssl_ec_public_key.rb,
lib/chef/resource/resource_notification.rb,
lib/chef/resource/ssh_known_hosts_entry.rb,
lib/chef/resource/windows_dfs_namespace.rb,
lib/chef/resource/windows_firewall_rule.rb,
lib/chef/run_list/versioned_recipe_list.rb,
lib/chef/secret_fetcher/azure_key_vault.rb,
lib/chef/chef_fs/file_system/base_fs_dir.rb,
lib/chef/mixin/powershell_type_coercions.rb,
lib/chef/provider/package/zypper/version.rb,
lib/chef/provider/remote_file/local_file.rb,
lib/chef/provider/whyrun_safe_ruby_block.rb,
lib/chef/resource/file/verification/json.rb,
lib/chef/resource/file/verification/yaml.rb,
lib/chef/resource/openssl_ec_private_key.rb,
lib/chef/resource/openssl_rsa_public_key.rb,
lib/chef/resource/selinux/common_helpers.rb,
lib/chef/resource/whyrun_safe_ruby_block.rb,
lib/chef/resource/windows_user_privilege.rb,
lib/chef/win32/security/securable_object.rb,
lib/chef/cookbook/cookbook_version_loader.rb,
lib/chef/cookbook/file_system_file_vendor.rb,
lib/chef/data_collector/config_validation.rb,
lib/chef/data_collector/run_start_message.rb,
lib/chef/file_content_management/tempfile.rb,
lib/chef/http/socketless_chef_zero_client.rb,
lib/chef/resource/habitat/habitat_package.rb,
lib/chef/resource/openssl_rsa_private_key.rb,
lib/chef/resource/windows_security_policy.rb,
lib/chef/resource/windows_update_settings.rb,
lib/chef/resource_collection/resource_set.rb,
lib/chef/file_content_management/deploy/cp.rb,
lib/chef/mixin/windows_architecture_helper.rb,
lib/chef/policy_builder/expand_node_object.rb,
lib/chef/provider/remote_file/network_file.rb,
lib/chef/resource/helpers/cron_validations.rb,
lib/chef/resource/inspec_waiver_file_entry.rb,
lib/chef/resource/openssl_x509_certificate.rb,
lib/chef/resource/windows_firewall_profile.rb,
lib/chef/resource_collection/resource_list.rb,
lib/chef/chef_fs/file_system/base_fs_object.rb,
lib/chef/chef_fs/file_system/repository/acl.rb,
lib/chef/mixin/api_version_request_handling.rb,
lib/chef/provider/package/dnf/python_helper.rb,
lib/chef/provider/package/yum/python_helper.rb,
lib/chef/resource/chef_client_systemd_timer.rb,
lib/chef/resource/powershell_package_source.rb,
lib/chef/secret_fetcher/aws_secrets_manager.rb,
lib/chef/win32/security/security_descriptor.rb,
lib/chef/chef_fs/file_system/multiplexed_dir.rb,
lib/chef/chef_fs/file_system/repository/node.rb,
lib/chef/chef_fs/file_system/repository/role.rb,
lib/chef/chef_fs/file_system/repository/user.rb,
lib/chef/event_dispatch/events_output_stream.rb,
lib/chef/formatters/indentable_output_stream.rb,
lib/chef/resource/chef_client_scheduled_task.rb,
lib/chef/resource/windows_defender_exclusion.rb,
lib/chef/resource/windows_feature_powershell.rb,
lib/chef/chef_fs/file_system/repository/group.rb,
lib/chef/file_content_management/content_base.rb,
lib/chef/resource/habitat/habitat_sup_systemd.rb,
lib/chef/resource/habitat/habitat_sup_windows.rb,
lib/chef/chef_fs/data_handler/acl_data_handler.rb,
lib/chef/chef_fs/file_system/memory/memory_dir.rb,
lib/chef/chef_fs/file_system/repository/client.rb,
lib/chef/chef_fs/file_system/repository/policy.rb,
lib/chef/resource_collection/stepable_iterator.rb,
lib/chef/chef_fs/data_handler/data_handler_base.rb,
lib/chef/chef_fs/data_handler/node_data_handler.rb,
lib/chef/chef_fs/data_handler/role_data_handler.rb,
lib/chef/chef_fs/data_handler/user_data_handler.rb,
lib/chef/chef_fs/file_system/memory/memory_file.rb,
lib/chef/chef_fs/file_system/memory/memory_root.rb,
lib/chef/file_content_management/deploy/mv_unix.rb,
lib/chef/chef_fs/data_handler/group_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/acl_dir.rb,
lib/chef/chef_fs/file_system/repository/acls_dir.rb,
lib/chef/chef_fs/file_system/repository/data_bag.rb,
lib/chef/compliance/reporter/compliance_enforcer.rb,
lib/chef/mixin/enforce_ownership_and_permissions.rb,
lib/chef/provider/remote_file/cache_control_data.rb,
lib/chef/resource/conditional_action_not_nothing.rb,
lib/chef/resource/file/verification/systemd_unit.rb,
lib/chef/chef_fs/data_handler/client_data_handler.rb,
lib/chef/chef_fs/data_handler/policy_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/acls_dir.rb,
lib/chef/chef_fs/file_system/repository/base_file.rb,
lib/chef/chef_fs/file_system/repository/container.rb,
lib/chef/chef_fs/file_system/repository/directory.rb,
lib/chef/chef_fs/file_system/repository/nodes_dir.rb,
lib/chef/chef_fs/file_system/repository/roles_dir.rb,
lib/chef/chef_fs/file_system/repository/users_dir.rb,
lib/chef/compliance/reporter/chef_server_automate.rb,
lib/chef/resource/chef_client_trusted_certificate.rb,
lib/chef/chef_fs/file_system/chef_server/acl_entry.rb,
lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb,
lib/chef/chef_fs/file_system/chef_server/org_entry.rb,
lib/chef/chef_fs/file_system/nonexistent_fs_object.rb,
lib/chef/chef_fs/file_system/repository/client_key.rb,
lib/chef/chef_fs/file_system/repository/groups_dir.rb,
lib/chef/file_content_management/deploy/mv_windows.rb,
lib/chef/chef_fs/data_handler/cookbook_data_handler.rb,
lib/chef/chef_fs/file_system/repository/clients_dir.rb,
lib/chef/chef_fs/file_system/repository/environment.rb,
lib/chef/chef_fs/data_handler/container_data_handler.rb,
lib/chef/chef_fs/file_system/repository/acls_sub_dir.rb,
lib/chef/chef_fs/file_system/repository/policies_dir.rb,
lib/chef/chef_fs/file_system/repository/policy_group.rb,
lib/chef/guard_interpreter/default_guard_interpreter.rb,
lib/chef/chef_fs/data_handler/client_key_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb,
lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb,
lib/chef/chef_fs/file_system/chef_server/policies_dir.rb,
lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb,
lib/chef/chef_fs/file_system/repository/data_bag_item.rb,
lib/chef/chef_fs/file_system/repository/data_bags_dir.rb,
lib/chef/guard_interpreter/resource_guard_interpreter.rb,
lib/chef/chef_fs/data_handler/environment_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb,
lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb,
lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb,
lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb,
lib/chef/chef_fs/file_system/repository/containers_dir.rb,
lib/chef/chef_fs/data_handler/organization_data_handler.rb,
lib/chef/chef_fs/data_handler/policy_group_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/data_bag_entry.rb,
lib/chef/chef_fs/file_system/repository/client_keys_dir.rb,
lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb,
lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb,
lib/chef/chef_fs/file_system/repository/environments_dir.rb,
lib/chef/chef_fs/file_system/chef_server/environments_dir.rb,
lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb,
lib/chef/chef_fs/file_system/repository/file_system_entry.rb,
lib/chef/chef_fs/file_system/repository/policy_groups_dir.rb,
lib/chef/formatters/error_inspectors/api_error_formatting.rb,
lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb,
lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb,
lib/chef/provider/package/windows/registry_uninstall_entry.rb,
lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb,
lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb,
lib/chef/formatters/error_inspectors/compile_error_inspector.rb,
lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb,
lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb,
lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb,
lib/chef/chef_fs/file_system/repository/cookbook_artifacts_dir.rb,
lib/chef/formatters/error_inspectors/node_load_error_inspector.rb,
lib/chef/resource_collection/resource_collection_serialization.rb,
lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb,
lib/chef/chef_fs/data_handler/organization_members_data_handler.rb,
lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb,
lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb,
lib/chef/chef_fs/file_system/repository/versioned_cookbooks_dir.rb,
lib/chef/formatters/error_inspectors/resource_failure_inspector.rb,
lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb,
lib/chef/formatters/error_inspectors/registration_error_inspector.rb,
lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb,
lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb,
lib/chef/chef_fs/file_system/chef_server/organization_members_entry.rb,
lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb,
lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb,
lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb,
lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb,
lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb,
lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb,
lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb

Overview

-- Author:: Daniel DeLeo ([email protected]) Copyright:: Copyright (c) Chef Software Inc. License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Modules: ChefFS, Compliance, DSL, Deprecation, EventDispatch, EventLoggers, Formatters, LocalMode, Mixin, PolicyBuilder, ReservedNames, ResourceHelpers, ResourceInspector, SELinux, Win32ServiceConstants Classes: ActionCollection, ApiClient, ApiClientV1, Application, AttributeAllowlist, AttributeBlocklist, Client, Config, ConfigFetcher, Cookbook, CookbookCacheCleaner, CookbookCollection, CookbookLoader, CookbookManifest, CookbookManifestVersions, CookbookSynchronizer, CookbookUploader, CookbookVersion, Daemon, DataBag, DataBagItem, DataCollector, Decorator, DelayedEvaluator, Deprecated, Digester, EncryptedDataBagItem, Environment, Exceptions, FileAccessControl, FileCache, FileContentManagement, Group, GuardInterpreter, HTTP, Handler, JSONCompat, Key, Log, Node, NodeMap, NullLogger, Org, Platform, Property, Provider, ProviderResolver, Pwsh, Recipe, RequestID, Resource, ResourceBuilder, ResourceCollection, ResourceDefinition, ResourceDefinitionList, ResourceReporter, ResourceResolver, Role, RunContext, RunList, RunLock, RunStatus, Runner, Sandbox, ScanAccessControl, Search, SecretFetcher, ServerAPI, ServerAPIVersions, TrainTransport, User, UserV1, Util, Version, VersionConstraint, Win32

Constant Summary collapse

CHEF_ROOT =
File.expand_path("..", __dir__)
VERSION =
Chef::VersionString.new("18.3.9")
NOT_PASSED =
Object.new
VersionString =
ChefUtils::VersionString
Win32EventLogLoaded =

rubocop:disable Naming/ConstantName

true
WorkstationConfigLoader =
ChefConfig::WorkstationConfigLoader

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.nodeChef::Node (readonly)

Get the node object

Returns:

  • (Chef::Node)

    node object of the chef-client run



48
49
50
# File 'lib/chef/chef_class.rb', line 48

def node
  @node
end

.run_contextChef::RunContext (readonly)

Get the run context

Returns:



55
56
57
# File 'lib/chef/chef_class.rb', line 55

def run_context
  @run_context
end

Class Method Details

.deprecated(type, message, location = nil) ⇒ void

This method returns an undefined value.

Emit a deprecation message.

Examples:

Chef.deprecated(:my_deprecation, message: "This is deprecated!")

Parameters:

  • type (Symbol)

    The message to send. This should refer to a class defined in Chef::Deprecated

  • message (String, nil)

    An explicit message to display, rather than the generic one associated with the deprecation.

  • location (String, nil) (defaults to: nil)

    The location. Defaults to the caller who called you (since generally the person who triggered the check is the one that needs to be fixed).



216
217
218
219
220
221
222
223
224
225
226
# File 'lib/chef/chef_class.rb', line 216

def deprecated(type, message, location = nil)
  location ||= Chef::Log.caller_location
  deprecation = Chef::Deprecated.create(type, message, location)
  # `run_context.events` is the primary deprecation target if we're in a
  # run. If we are not yet in a run, print to `Chef::Log`.
  if run_context && run_context.events
    run_context.events.deprecation(deprecation, location)
  elsif !deprecation.silenced?
    Chef::Log.deprecation(deprecation.to_s)
  end
end

.event_handler(&block) ⇒ Object

Register an event handler with user specified block

@return[Chef::EventDispatch::Base] handler object



60
61
62
63
# File 'lib/chef/chef_class.rb', line 60

def event_handler(&block)
  dsl = Chef::EventDispatch::DSL.new("Chef client DSL")
  dsl.instance_eval(&block)
end

.get_provider_priority_array(resource_name) ⇒ Array<Class>

Get the array of providers associated with a resource_name for the current node

Parameters:

  • resource_name (Symbol)

    name of the resource as a symbol

Returns:

  • (Array<Class>)

    Priority Array of Provider Classes to use for the resource_name on the node



71
72
73
74
75
# File 'lib/chef/chef_class.rb', line 71

def get_provider_priority_array(resource_name)
  result = provider_priority_map.get_priority_array(node, resource_name.to_sym)
  result = result.dup if result
  result
end

.get_resource_priority_array(resource_name) ⇒ Array<Class>

Get the array of resources associated with a resource_name for the current node

Parameters:

  • resource_name (Symbol)

    name of the resource as a symbol

Returns:

  • (Array<Class>)

    Priority Array of Resource Classes to use for the resource_name on the node



84
85
86
87
88
# File 'lib/chef/chef_class.rb', line 84

def get_resource_priority_array(resource_name)
  result = resource_priority_map.get_priority_array(node, resource_name.to_sym)
  result = result.dup if result
  result
end

.log_deprecation(message, location = nil) ⇒ Object

Log a generic deprecation warning that doesn't have a specific class in Chef::Deprecated.

This should generally not be used, as the user will not be given a link to get more information on fixing the deprecation warning.

See Also:

  • #deprecated


235
236
237
238
# File 'lib/chef/chef_class.rb', line 235

def log_deprecation(message, location = nil)
  location ||= Chef::Log.caller_location
  Chef.deprecated(:generic, message, location)
end

.provider_handler_mapObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



190
191
192
# File 'lib/chef/chef_class.rb', line 190

def provider_handler_map
  @provider_handler_map ||= Chef::Platform::ProviderHandlerMap.instance
end

.provider_priority_mapObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



179
180
181
182
# File 'lib/chef/chef_class.rb', line 179

def provider_priority_map
  # these slurp in the resource+provider world, so be exceedingly lazy about requiring them
  @provider_priority_map ||= Chef::Platform::ProviderPriorityMap.instance
end

.reset!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Resets the internal state



169
170
171
172
173
174
175
176
# File 'lib/chef/chef_class.rb', line 169

def reset!
  @run_context = nil
  @node = nil
  @provider_priority_map = nil
  @resource_priority_map = nil
  @provider_handler_map = nil
  @resource_handler_map = nil
end

.resource_handler_mapObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



195
196
197
# File 'lib/chef/chef_class.rb', line 195

def resource_handler_map
  @resource_handler_map ||= Chef::Platform::ResourceHandlerMap.instance
end

.resource_priority_mapObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



185
186
187
# File 'lib/chef/chef_class.rb', line 185

def resource_priority_map
  @resource_priority_map ||= Chef::Platform::ResourcePriorityMap.instance
end

.set_node(node) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the node object

Parameters:



151
152
153
# File 'lib/chef/chef_class.rb', line 151

def set_node(node)
  @node = node
end

.set_provider_priority_array(resource_name, priority_array, **filter, &block) ⇒ Array<Class>

Set the array of providers associated with a resource_name for the current node

Parameters:

  • resource_name (Symbol)

    name of the resource as a symbol

  • priority_array (Class, Array<Class>)

    Class or Array of Classes to set as the priority for resource_name on the node

  • filter (Hash)

    Chef::Nodearray-style filter

Returns:

  • (Array<Class>)

    Modified Priority Array of Provider Classes to use for the resource_name on the node



99
100
101
102
103
# File 'lib/chef/chef_class.rb', line 99

def set_provider_priority_array(resource_name, priority_array, **filter, &block)
  result = provider_priority_map.set_priority_array(resource_name.to_sym, priority_array, **filter, &block)
  result = result.dup if result
  result
end

.set_provider_priority_map(provider_priority_map) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the provider_priority_map

Parameters:

  • provider_priority_map (Chef::Platform::providerPriorityMap)


142
143
144
# File 'lib/chef/chef_class.rb', line 142

def set_provider_priority_map(provider_priority_map)
  @provider_priority_map = provider_priority_map
end

.set_resource_priority_array(resource_name, priority_array, **filter, &block) ⇒ Array<Class>

Get the array of resources associated with a resource_name for the current node

Parameters:

  • resource_name (Symbol)

    name of the resource as a symbol

  • priority_array (Class, Array<Class>)

    Class or Array of Classes to set as the priority for resource_name on the node

  • filter (Hash)

    Chef::Nodearray-style filter

Returns:

  • (Array<Class>)

    Modified Priority Array of Resource Classes to use for the resource_name on the node



114
115
116
117
118
# File 'lib/chef/chef_class.rb', line 114

def set_resource_priority_array(resource_name, priority_array, **filter, &block)
  result = resource_priority_map.set_priority_array(resource_name.to_sym, priority_array, **filter, &block)
  result = result.dup if result
  result
end

.set_resource_priority_map(resource_priority_map) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the resource_priority_map

Parameters:



132
133
134
# File 'lib/chef/chef_class.rb', line 132

def set_resource_priority_map(resource_priority_map)
  @resource_priority_map = resource_priority_map
end

.set_run_context(run_context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Sets the run_context object

Parameters:



161
162
163
# File 'lib/chef/chef_class.rb', line 161

def set_run_context(run_context)
  @run_context = run_context
end