chef 18.11.11 → 19.1.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +25 -27
- data/README.md +7 -2
- data/Rakefile +1 -12
- data/chef-universal-mingw-ucrt.gemspec +3 -5
- data/chef.gemspec +22 -27
- data/lib/chef/action_collection.rb +3 -1
- data/lib/chef/api_client/registration.rb +1 -1
- data/lib/chef/api_client.rb +1 -1
- data/lib/chef/api_client_v1.rb +1 -1
- data/lib/chef/application/apply.rb +30 -3
- data/lib/chef/application/base.rb +34 -3
- data/lib/chef/application/client.rb +15 -1
- data/lib/chef/application/exit_code.rb +3 -1
- data/lib/chef/application/solo.rb +1 -1
- data/lib/chef/application.rb +6 -1
- data/lib/chef/chef_class.rb +1 -1
- data/lib/chef/chef_fs/chef_fs_data_store.rb +1 -1
- data/lib/chef/chef_fs/command_line.rb +7 -6
- data/lib/chef/chef_fs/config.rb +1 -1
- data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +1 -1
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/file_system/base_fs_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/base_fs_object.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifact_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +2 -2
- data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/exceptions.rb +1 -1
- data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acl.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acls_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/acls_sub_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/base_file.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +7 -6
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_key.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_keys_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/client_keys_sub_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/clients_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/container.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/containers_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/cookbook_artifacts_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bag.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bag_item.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/data_bags_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/directory.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/environment.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/environments_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/group.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/node.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policies_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy_group.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/policy_groups_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/role.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/roles_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/user.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/users_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system/repository/versioned_cookbooks_dir.rb +1 -1
- data/lib/chef/chef_fs/file_system.rb +1 -1
- data/lib/chef/chef_fs/file_system_cache.rb +1 -1
- data/lib/chef/chef_fs/path_utils.rb +1 -1
- data/lib/chef/client.rb +13 -3
- data/lib/chef/compliance/default_attributes.rb +1 -1
- data/lib/chef/compliance/fetcher/chef_server.rb +1 -1
- data/lib/chef/compliance/input.rb +1 -1
- data/lib/chef/compliance/input_collection.rb +1 -1
- data/lib/chef/compliance/profile.rb +1 -1
- data/lib/chef/compliance/profile_collection.rb +1 -1
- data/lib/chef/compliance/runner.rb +20 -20
- data/lib/chef/compliance/waiver.rb +1 -1
- data/lib/chef/compliance/waiver_collection.rb +1 -1
- data/lib/chef/config.rb +1 -1
- data/lib/chef/constants.rb +1 -1
- data/lib/chef/context.rb +53 -0
- data/lib/chef/cookbook/chefignore.rb +2 -2
- data/lib/chef/cookbook/cookbook_collection.rb +1 -1
- data/lib/chef/cookbook/cookbook_version_loader.rb +2 -1
- data/lib/chef/cookbook/file_system_file_vendor.rb +1 -1
- data/lib/chef/cookbook/file_vendor.rb +1 -1
- data/lib/chef/cookbook/gem_installer.rb +1 -1
- data/lib/chef/cookbook/manifest_v0.rb +1 -1
- data/lib/chef/cookbook/manifest_v2.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +1 -1
- data/lib/chef/cookbook/remote_file_vendor.rb +1 -1
- data/lib/chef/cookbook/synchronizer.rb +5 -0
- data/lib/chef/cookbook/syntax_check.rb +1 -1
- data/lib/chef/cookbook_loader.rb +1 -1
- data/lib/chef/cookbook_manifest.rb +1 -1
- data/lib/chef/cookbook_version.rb +3 -3
- data/lib/chef/daemon.rb +1 -1
- data/lib/chef/data_bag.rb +3 -3
- data/lib/chef/data_bag_item.rb +2 -2
- data/lib/chef/data_collector/config_validation.rb +1 -1
- data/lib/chef/data_collector/error_handlers.rb +1 -1
- data/lib/chef/data_collector/message_helpers.rb +1 -1
- data/lib/chef/data_collector/run_end_message.rb +1 -1
- data/lib/chef/data_collector/run_start_message.rb +2 -2
- data/lib/chef/data_collector.rb +2 -2
- data/lib/chef/decorator/lazy.rb +1 -1
- data/lib/chef/decorator/lazy_array.rb +1 -1
- data/lib/chef/decorator.rb +1 -1
- data/lib/chef/delayed_evaluator.rb +1 -1
- data/lib/chef/deprecated.rb +1 -1
- data/lib/chef/deprecation/warnings.rb +1 -1
- data/lib/chef/digester.rb +1 -1
- data/lib/chef/dsl/chef_vault.rb +2 -2
- data/lib/chef/dsl/cheffish.rb +1 -1
- data/lib/chef/dsl/compliance.rb +1 -1
- data/lib/chef/dsl/data_query.rb +1 -1
- data/lib/chef/dsl/declare_resource.rb +1 -1
- data/lib/chef/dsl/include_attribute.rb +1 -1
- data/lib/chef/dsl/include_recipe.rb +1 -1
- data/lib/chef/dsl/platform_introspection.rb +1 -1
- data/lib/chef/dsl/powershell.rb +1 -1
- data/lib/chef/dsl/reader_helpers.rb +3 -1
- data/lib/chef/dsl/reboot_pending.rb +1 -1
- data/lib/chef/dsl/recipe.rb +1 -1
- data/lib/chef/dsl/registry_helper.rb +1 -1
- data/lib/chef/dsl/render_helpers.rb +1 -1
- data/lib/chef/dsl/resources.rb +1 -1
- data/lib/chef/dsl/rest_resource.rb +17 -64
- data/lib/chef/dsl/secret.rb +1 -1
- data/lib/chef/dsl/universal.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/decryptor.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/encryptor.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +1 -1
- data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +1 -1
- data/lib/chef/encrypted_data_bag_item.rb +1 -1
- data/lib/chef/environment.rb +2 -2
- data/lib/chef/event_loggers/base.rb +1 -1
- data/lib/chef/event_loggers/windows_eventlog.rb +1 -1
- data/lib/chef/exceptions.rb +2 -12
- data/lib/chef/file_access_control/unix.rb +10 -10
- data/lib/chef/file_access_control/windows.rb +1 -1
- data/lib/chef/file_access_control.rb +1 -1
- data/lib/chef/file_cache.rb +1 -1
- data/lib/chef/file_content_management/content_base.rb +1 -1
- data/lib/chef/file_content_management/deploy/cp.rb +1 -1
- data/lib/chef/file_content_management/deploy/mv_unix.rb +1 -1
- data/lib/chef/file_content_management/deploy/mv_windows.rb +1 -1
- data/lib/chef/file_content_management/deploy/target_io.rb +27 -0
- data/lib/chef/file_content_management/deploy.rb +5 -2
- data/lib/chef/file_content_management/tempfile.rb +1 -1
- data/lib/chef/formatters/base.rb +1 -1
- data/lib/chef/formatters/error_description.rb +2 -9
- data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +1 -1
- data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +3 -2
- data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +3 -2
- data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
- data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +1 -1
- data/lib/chef/formatters/error_mapper.rb +1 -1
- data/lib/chef/group.rb +1 -1
- data/lib/chef/guard_interpreter/default_guard_interpreter.rb +1 -1
- data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +1 -1
- data/lib/chef/guard_interpreter.rb +1 -1
- data/lib/chef/handler/error_report.rb +1 -1
- data/lib/chef/handler/json_file.rb +1 -1
- data/lib/chef/handler/slow_report.rb +1 -1
- data/lib/chef/handler.rb +1 -1
- data/lib/chef/http/api_versions.rb +1 -1
- data/lib/chef/http/auth_credentials.rb +1 -1
- data/lib/chef/http/authenticator.rb +13 -26
- data/lib/chef/http/basic_client.rb +1 -2
- data/lib/chef/http/cookie_jar.rb +1 -1
- data/lib/chef/http/cookie_manager.rb +1 -1
- data/lib/chef/http/decompressor.rb +1 -1
- data/lib/chef/http/http_request.rb +17 -16
- data/lib/chef/http/json_input.rb +1 -1
- data/lib/chef/http/json_output.rb +1 -1
- data/lib/chef/http/json_to_model_output.rb +1 -1
- data/lib/chef/http/remote_request_id.rb +1 -1
- data/lib/chef/http/simple.rb +1 -1
- data/lib/chef/http/simple_json.rb +1 -1
- data/lib/chef/http/socketless_chef_zero_client.rb +1 -1
- data/lib/chef/http/ssl_policies.rb +1 -1
- data/lib/chef/http/validate_content_length.rb +1 -1
- data/lib/chef/http.rb +1 -2
- data/lib/chef/json_compat.rb +1 -1
- data/lib/chef/key.rb +1 -1
- data/lib/chef/licensing.rb +105 -0
- data/lib/chef/licensing_config.rb +20 -0
- data/lib/chef/local_mode.rb +1 -1
- data/lib/chef/log/syslog.rb +1 -1
- data/lib/chef/log/winevt.rb +1 -1
- data/lib/chef/log.rb +1 -1
- data/lib/chef/mash.rb +1 -1
- data/lib/chef/mixin/api_version_request_handling.rb +1 -1
- data/lib/chef/mixin/checksum.rb +1 -1
- data/lib/chef/mixin/chef_utils_wiring.rb +1 -1
- data/lib/chef/mixin/convert_to_class_name.rb +1 -1
- data/lib/chef/mixin/create_path.rb +1 -1
- data/lib/chef/mixin/deep_merge.rb +1 -1
- data/lib/chef/mixin/default_paths.rb +1 -1
- data/lib/chef/mixin/deprecation.rb +1 -1
- data/lib/chef/mixin/enforce_ownership_and_permissions.rb +1 -1
- data/lib/chef/mixin/file_class.rb +4 -2
- data/lib/chef/mixin/from_file.rb +1 -1
- data/lib/chef/mixin/get_source_from_package.rb +2 -2
- data/lib/chef/mixin/homebrew.rb +3 -4
- data/lib/chef/mixin/lazy_module_include.rb +1 -1
- data/lib/chef/mixin/notifying_block.rb +1 -1
- data/lib/chef/mixin/openssl_helper.rb +1 -1
- data/lib/chef/mixin/params_validate.rb +1 -1
- data/lib/chef/mixin/path_sanity.rb +1 -1
- data/lib/chef/mixin/powershell_exec.rb +1 -1
- data/lib/chef/mixin/powershell_out.rb +1 -1
- data/lib/chef/mixin/powershell_type_coercions.rb +1 -1
- data/lib/chef/mixin/proxified_socket.rb +1 -1
- data/lib/chef/mixin/securable.rb +1 -1
- data/lib/chef/mixin/shell_out.rb +1 -1
- data/lib/chef/mixin/subclass_directive.rb +1 -1
- data/lib/chef/mixin/template.rb +3 -25
- data/lib/chef/mixin/unformatter.rb +1 -1
- data/lib/chef/mixin/uris.rb +1 -1
- data/lib/chef/mixin/user_context.rb +1 -1
- data/lib/chef/mixin/versioned_api.rb +1 -1
- data/lib/chef/mixin/which.rb +1 -1
- data/lib/chef/mixin/why_run.rb +1 -1
- data/lib/chef/mixin/wide_string.rb +1 -1
- data/lib/chef/mixin/windows_architecture_helper.rb +1 -1
- data/lib/chef/mixin/windows_env_helper.rb +1 -1
- data/lib/chef/mixin/xml_escape.rb +1 -1
- data/lib/chef/monkey_patches/net-http.rb +10 -11
- data/lib/chef/monkey_patches/win32/registry.rb +1 -1
- data/lib/chef/node/attribute.rb +1 -1
- data/lib/chef/node/attribute_collections.rb +1 -1
- data/lib/chef/node/common_api.rb +1 -1
- data/lib/chef/node/immutable_collections.rb +1 -1
- data/lib/chef/node/mixin/deep_merge_cache.rb +1 -1
- data/lib/chef/node/mixin/immutablize_array.rb +27 -1
- data/lib/chef/node/mixin/immutablize_hash.rb +36 -1
- data/lib/chef/node/mixin/mashy_array.rb +1 -1
- data/lib/chef/node/mixin/state_tracking.rb +1 -1
- data/lib/chef/node/mixin/state_tracking_array.rb +1 -1
- data/lib/chef/node.rb +1 -1
- data/lib/chef/node_map.rb +15 -3
- data/lib/chef/null_logger.rb +1 -1
- data/lib/chef/org.rb +1 -1
- data/lib/chef/platform/priority_map.rb +1 -1
- data/lib/chef/platform/provider_handler_map.rb +1 -1
- data/lib/chef/platform/provider_mapping.rb +1 -1
- data/lib/chef/platform/query_helpers.rb +1 -1
- data/lib/chef/platform/rebooter.rb +1 -1
- data/lib/chef/platform/resource_handler_map.rb +1 -1
- data/lib/chef/platform/service_helpers.rb +1 -1
- data/lib/chef/platform.rb +1 -1
- data/lib/chef/policy_builder/dynamic.rb +1 -1
- data/lib/chef/policy_builder/expand_node_object.rb +1 -1
- data/lib/chef/policy_builder/policyfile.rb +1 -1
- data/lib/chef/policy_builder.rb +1 -1
- data/lib/chef/property.rb +3 -3
- data/lib/chef/provider/batch.rb +1 -1
- data/lib/chef/provider/cookbook_file/content.rb +1 -1
- data/lib/chef/provider/cookbook_file.rb +2 -2
- data/lib/chef/provider/cron/aix.rb +1 -1
- data/lib/chef/provider/cron/solaris.rb +1 -1
- data/lib/chef/provider/cron.rb +15 -5
- data/lib/chef/provider/directory.rb +18 -18
- data/lib/chef/provider/dsc_resource.rb +1 -1
- data/lib/chef/provider/dsc_script.rb +1 -1
- data/lib/chef/provider/execute.rb +3 -2
- data/lib/chef/provider/file/content.rb +3 -4
- data/lib/chef/provider/file.rb +44 -31
- data/lib/chef/provider/git.rb +10 -10
- data/lib/chef/provider/group/aix.rb +1 -1
- data/lib/chef/provider/group/dscl.rb +2 -2
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +2 -2
- data/lib/chef/provider/group/groupmod.rb +3 -3
- data/lib/chef/provider/group/pw.rb +3 -3
- data/lib/chef/provider/group/solaris.rb +3 -3
- data/lib/chef/provider/group/usermod.rb +3 -3
- data/lib/chef/provider/group.rb +2 -2
- data/lib/chef/provider/http_request.rb +3 -4
- data/lib/chef/provider/ifconfig/aix.rb +2 -2
- data/lib/chef/provider/ifconfig/debian.rb +3 -3
- data/lib/chef/provider/ifconfig/redhat.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +1 -1
- data/lib/chef/provider/link.rb +22 -11
- data/lib/chef/provider/lwrp_base.rb +1 -1
- data/lib/chef/provider/mount/aix.rb +5 -5
- data/lib/chef/provider/mount/linux.rb +4 -4
- data/lib/chef/provider/mount/mount.rb +12 -12
- data/lib/chef/provider/mount/solaris.rb +1 -1
- data/lib/chef/provider/mount/windows.rb +3 -3
- data/lib/chef/provider/mount.rb +1 -1
- data/lib/chef/provider/noop.rb +1 -1
- data/lib/chef/provider/package/apt.rb +1 -1
- data/lib/chef/provider/package/bff.rb +4 -4
- data/lib/chef/provider/package/cab.rb +1 -1
- data/lib/chef/provider/package/chocolatey.rb +20 -79
- data/lib/chef/provider/package/deb.rb +1 -1
- data/lib/chef/provider/package/dnf/dnf_helper.py +65 -355
- data/lib/chef/provider/package/dnf/python_helper.rb +5 -8
- data/lib/chef/provider/package/dnf/version.rb +1 -1
- data/lib/chef/provider/package/dnf.rb +5 -24
- data/lib/chef/provider/package/dpkg.rb +6 -6
- data/lib/chef/provider/package/freebsd/base.rb +1 -1
- data/lib/chef/provider/package/habitat.rb +6 -6
- data/lib/chef/provider/package/homebrew.rb +1 -1
- data/lib/chef/provider/package/ips.rb +3 -3
- data/lib/chef/provider/package/msu.rb +1 -1
- data/lib/chef/provider/package/openbsd.rb +3 -2
- data/lib/chef/provider/package/pacman.rb +4 -4
- data/lib/chef/provider/package/paludis.rb +3 -3
- data/lib/chef/provider/package/portage.rb +3 -3
- data/lib/chef/provider/package/powershell.rb +1 -1
- data/lib/chef/provider/package/rpm.rb +3 -3
- data/lib/chef/provider/package/rubygems.rb +21 -28
- data/lib/chef/provider/package/smartos.rb +2 -2
- data/lib/chef/provider/package/snap.rb +19 -7
- data/lib/chef/provider/package/snap_tm.rb +79 -0
- data/lib/chef/provider/package/solaris.rb +5 -5
- data/lib/chef/provider/package/windows/exe.rb +1 -1
- data/lib/chef/provider/package/windows/msi.rb +1 -1
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
- data/lib/chef/provider/package/windows.rb +1 -1
- data/lib/chef/provider/package/yum/python_helper.rb +1 -1
- data/lib/chef/provider/package/yum/rpm_utils.rb +1 -1
- data/lib/chef/provider/package/yum/version.rb +1 -1
- data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
- data/lib/chef/provider/package/yum.rb +2 -2
- data/lib/chef/provider/package/yum_tm.rb +132 -0
- data/lib/chef/provider/package/zypper/version.rb +1 -1
- data/lib/chef/provider/package/zypper.rb +5 -5
- data/lib/chef/provider/package.rb +2 -2
- data/lib/chef/provider/powershell_script.rb +85 -85
- data/lib/chef/provider/registry_key.rb +2 -1
- data/lib/chef/provider/remote_directory.rb +6 -6
- data/lib/chef/provider/remote_file/cache_control_data.rb +1 -1
- data/lib/chef/provider/remote_file/content.rb +1 -1
- data/lib/chef/provider/remote_file/fetcher.rb +1 -1
- data/lib/chef/provider/remote_file/http.rb +2 -3
- data/lib/chef/provider/remote_file.rb +2 -2
- data/lib/chef/provider/route.rb +10 -10
- data/lib/chef/provider/ruby_block.rb +1 -1
- data/lib/chef/provider/script.rb +8 -8
- data/lib/chef/provider/service/aix.rb +2 -2
- data/lib/chef/provider/service/aixinit.rb +6 -6
- data/lib/chef/provider/service/arch.rb +6 -6
- data/lib/chef/provider/service/debian.rb +8 -8
- data/lib/chef/provider/service/freebsd.rb +7 -7
- data/lib/chef/provider/service/gentoo.rb +6 -6
- data/lib/chef/provider/service/init.rb +3 -3
- data/lib/chef/provider/service/insserv.rb +3 -3
- data/lib/chef/provider/service/invokercd.rb +2 -2
- data/lib/chef/provider/service/macosx.rb +1 -1
- data/lib/chef/provider/service/openbsd.rb +7 -7
- data/lib/chef/provider/service/redhat.rb +6 -6
- data/lib/chef/provider/service/solaris.rb +3 -3
- data/lib/chef/provider/service/systemd.rb +3 -3
- data/lib/chef/provider/service/upstart.rb +3 -3
- data/lib/chef/provider/service/windows.rb +1 -1
- data/lib/chef/provider/service.rb +1 -1
- data/lib/chef/provider/subversion.rb +10 -10
- data/lib/chef/provider/systemd_unit.rb +3 -3
- data/lib/chef/provider/template/content.rb +1 -1
- data/lib/chef/provider/template.rb +2 -2
- data/lib/chef/provider/template_finder.rb +1 -1
- data/lib/chef/provider/user/aix.rb +4 -4
- data/lib/chef/provider/user/dscl.rb +1 -1
- data/lib/chef/provider/user/linux.rb +8 -3
- data/lib/chef/provider/user/mac.rb +2 -2
- data/lib/chef/provider/user/pw.rb +4 -4
- data/lib/chef/provider/user/solaris.rb +8 -8
- data/lib/chef/provider/user.rb +7 -4
- data/lib/chef/provider/windows_script.rb +2 -2
- data/lib/chef/provider/yum_repository.rb +2 -4
- data/lib/chef/provider/zypper_repository.rb +2 -2
- data/lib/chef/provider.rb +1 -1
- data/lib/chef/providers.rb +3 -1
- data/lib/chef/pwsh.rb +1 -1
- data/lib/chef/recipe.rb +9 -6
- data/lib/chef/request_id.rb +1 -1
- data/lib/chef/resource/_rest_resource.rb +158 -15
- data/lib/chef/resource/action_class.rb +1 -1
- data/lib/chef/resource/alternatives.rb +44 -43
- data/lib/chef/resource/apt_package.rb +38 -33
- data/lib/chef/resource/apt_preference.rb +25 -24
- data/lib/chef/resource/apt_repository.rb +16 -11
- data/lib/chef/resource/apt_update.rb +5 -4
- data/lib/chef/resource/archive_file.rb +6 -40
- data/lib/chef/resource/bash.rb +132 -131
- data/lib/chef/resource/batch.rb +1 -1
- data/lib/chef/resource/bff_package.rb +18 -17
- data/lib/chef/resource/breakpoint.rb +46 -45
- data/lib/chef/resource/build_essential.rb +1 -1
- data/lib/chef/resource/cab_package.rb +23 -23
- data/lib/chef/resource/chef_client_config.rb +88 -253
- data/lib/chef/resource/chef_client_cron.rb +21 -19
- data/lib/chef/resource/chef_client_hab_ca_cert.rb +141 -0
- data/lib/chef/resource/chef_client_launchd.rb +6 -2
- data/lib/chef/resource/chef_client_scheduled_task.rb +35 -32
- data/lib/chef/resource/chef_client_systemd_timer.rb +21 -18
- data/lib/chef/resource/chef_client_trusted_certificate.rb +29 -29
- data/lib/chef/resource/chef_gem.rb +1 -1
- data/lib/chef/resource/chef_handler.rb +108 -108
- data/lib/chef/resource/chef_sleep.rb +3 -2
- data/lib/chef/resource/chef_vault_secret.rb +2 -2
- data/lib/chef/resource/chocolatey_config.rb +15 -15
- data/lib/chef/resource/chocolatey_feature.rb +2 -2
- data/lib/chef/resource/chocolatey_installer.rb +39 -72
- data/lib/chef/resource/chocolatey_package.rb +2 -2
- data/lib/chef/resource/chocolatey_source.rb +16 -16
- data/lib/chef/resource/conditional.rb +1 -1
- data/lib/chef/resource/cookbook_file.rb +3 -2
- data/lib/chef/resource/cron/_cron_shared.rb +1 -1
- data/lib/chef/resource/cron/cron.rb +72 -71
- data/lib/chef/resource/cron/cron_d.rb +3 -2
- data/lib/chef/resource/cron_access.rb +3 -2
- data/lib/chef/resource/csh.rb +3 -2
- data/lib/chef/resource/directory.rb +4 -3
- data/lib/chef/resource/dmg_package.rb +1 -1
- data/lib/chef/resource/dnf_package.rb +2 -2
- data/lib/chef/resource/dpkg_package.rb +9 -6
- data/lib/chef/resource/dsc_resource.rb +1 -1
- data/lib/chef/resource/dsc_script.rb +1 -1
- data/lib/chef/resource/execute.rb +8 -1
- data/lib/chef/resource/file/verification/json.rb +1 -1
- data/lib/chef/resource/file/verification/systemd_unit.rb +5 -2
- data/lib/chef/resource/file/verification/yaml.rb +2 -2
- data/lib/chef/resource/file/verification.rb +4 -1
- data/lib/chef/resource/file.rb +3 -2
- data/lib/chef/resource/freebsd_package.rb +4 -3
- data/lib/chef/resource/gem_package.rb +1 -1
- data/lib/chef/resource/group.rb +33 -30
- data/lib/chef/resource/habitat/_habitat_shared.rb +1 -1
- data/lib/chef/resource/habitat/habitat_package.rb +84 -82
- data/lib/chef/resource/habitat/habitat_sup.rb +98 -97
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +14 -13
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +5 -4
- data/lib/chef/resource/habitat_config.rb +38 -24
- data/lib/chef/resource/habitat_install.rb +22 -22
- data/lib/chef/resource/habitat_service.rb +10 -6
- data/lib/chef/resource/habitat_user_toml.rb +12 -12
- data/lib/chef/resource/helpers/cron_validations.rb +1 -1
- data/lib/chef/resource/helpers/path_helpers.rb +52 -0
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/homebrew_package.rb +21 -21
- data/lib/chef/resource/homebrew_tap.rb +10 -2
- data/lib/chef/resource/homebrew_update.rb +1 -1
- data/lib/chef/resource/hostname.rb +14 -11
- data/lib/chef/resource/http_request.rb +5 -4
- data/lib/chef/resource/ifconfig.rb +36 -35
- data/lib/chef/resource/inspec_input.rb +42 -39
- data/lib/chef/resource/inspec_waiver.rb +66 -65
- data/lib/chef/resource/inspec_waiver_file_entry.rb +28 -27
- data/lib/chef/resource/ips_package.rb +4 -3
- data/lib/chef/resource/kernel_module.rb +4 -3
- data/lib/chef/resource/ksh.rb +3 -2
- data/lib/chef/resource/launchd.rb +1 -1
- data/lib/chef/resource/link.rb +4 -3
- data/lib/chef/resource/locale.rb +11 -10
- data/lib/chef/resource/log.rb +3 -1
- data/lib/chef/resource/lwrp_base.rb +1 -1
- data/lib/chef/resource/macos_pkg.rb +1 -1
- data/lib/chef/resource/macos_userdefaults.rb +1 -1
- data/lib/chef/resource/macports_package.rb +1 -1
- data/lib/chef/resource/mdadm.rb +33 -33
- data/lib/chef/resource/mount.rb +7 -5
- data/lib/chef/resource/msu_package.rb +2 -2
- data/lib/chef/resource/notify_group.rb +3 -2
- data/lib/chef/resource/ohai.rb +37 -36
- data/lib/chef/resource/ohai_hint.rb +27 -26
- data/lib/chef/resource/openbsd_package.rb +4 -3
- data/lib/chef/resource/openssl_dhparam.rb +1 -1
- data/lib/chef/resource/openssl_ec_private_key.rb +2 -2
- data/lib/chef/resource/openssl_ec_public_key.rb +3 -3
- data/lib/chef/resource/openssl_rsa_private_key.rb +2 -2
- data/lib/chef/resource/openssl_rsa_public_key.rb +3 -3
- data/lib/chef/resource/openssl_x509_certificate.rb +7 -3
- data/lib/chef/resource/openssl_x509_crl.rb +16 -16
- data/lib/chef/resource/openssl_x509_request.rb +3 -3
- data/lib/chef/resource/package.rb +4 -3
- data/lib/chef/resource/pacman_package.rb +2 -1
- data/lib/chef/resource/paludis_package.rb +3 -2
- data/lib/chef/resource/perl.rb +3 -2
- data/lib/chef/resource/plist.rb +4 -4
- data/lib/chef/resource/portage_package.rb +3 -2
- data/lib/chef/resource/powershell_package.rb +1 -1
- data/lib/chef/resource/powershell_package_source.rb +12 -12
- data/lib/chef/resource/powershell_script.rb +1 -1
- data/lib/chef/resource/python.rb +3 -2
- data/lib/chef/resource/reboot.rb +3 -2
- data/lib/chef/resource/registry_key.rb +78 -83
- data/lib/chef/resource/remote_directory.rb +3 -2
- data/lib/chef/resource/remote_file.rb +74 -73
- data/lib/chef/resource/resource_notification.rb +1 -1
- data/lib/chef/resource/rhsm_errata.rb +3 -2
- data/lib/chef/resource/rhsm_errata_level.rb +3 -2
- data/lib/chef/resource/rhsm_register.rb +14 -5
- data/lib/chef/resource/rhsm_repo.rb +5 -5
- data/lib/chef/resource/rhsm_subscription.rb +10 -10
- data/lib/chef/resource/route.rb +2 -1
- data/lib/chef/resource/rpm_package.rb +3 -2
- data/lib/chef/resource/ruby.rb +4 -2
- data/lib/chef/resource/ruby_block.rb +3 -1
- data/lib/chef/resource/scm/_scm.rb +1 -1
- data/lib/chef/resource/scm/git.rb +82 -81
- data/lib/chef/resource/scm/subversion.rb +12 -11
- data/lib/chef/resource/script.rb +4 -2
- data/lib/chef/resource/selinux/common_helpers.rb +1 -1
- data/lib/chef/resource/selinux/selinux_debian.erb +1 -1
- data/lib/chef/resource/selinux/selinux_default.erb +1 -1
- data/lib/chef/resource/selinux_boolean.rb +14 -13
- data/lib/chef/resource/selinux_fcontext.rb +23 -22
- data/lib/chef/resource/selinux_install.rb +20 -19
- data/lib/chef/resource/selinux_login.rb +13 -12
- data/lib/chef/resource/selinux_module.rb +20 -19
- data/lib/chef/resource/selinux_permissive.rb +10 -9
- data/lib/chef/resource/selinux_port.rb +17 -16
- data/lib/chef/resource/selinux_state.rb +29 -28
- data/lib/chef/resource/selinux_user.rb +16 -15
- data/lib/chef/resource/service.rb +9 -6
- data/lib/chef/resource/smartos_package.rb +4 -3
- data/lib/chef/resource/snap_package.rb +32 -23
- data/lib/chef/resource/solaris_package.rb +3 -2
- data/lib/chef/resource/ssh_known_hosts_entry.rb +13 -12
- data/lib/chef/resource/sudo.rb +71 -70
- data/lib/chef/resource/swap_file.rb +20 -19
- data/lib/chef/resource/sysctl.rb +49 -48
- data/lib/chef/resource/systemd_unit.rb +42 -39
- data/lib/chef/resource/template.rb +3 -2
- data/lib/chef/resource/timezone.rb +23 -22
- data/lib/chef/resource/user/aix_user.rb +4 -3
- data/lib/chef/resource/user/linux_user.rb +4 -4
- data/lib/chef/resource/user/mac_user.rb +5 -4
- data/lib/chef/resource/user/pw_user.rb +4 -3
- data/lib/chef/resource/user/solaris_user.rb +4 -3
- data/lib/chef/resource/user/windows_user.rb +2 -1
- data/lib/chef/resource/user.rb +8 -7
- data/lib/chef/resource/user_ulimit.rb +25 -24
- data/lib/chef/resource/windows_ad_join.rb +23 -23
- data/lib/chef/resource/windows_audit_policy.rb +35 -35
- data/lib/chef/resource/windows_auto_run.rb +9 -9
- data/lib/chef/resource/windows_certificate.rb +21 -21
- data/lib/chef/resource/windows_defender.rb +23 -23
- data/lib/chef/resource/windows_defender_exclusion.rb +18 -18
- data/lib/chef/resource/windows_dfs_folder.rb +1 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +1 -1
- data/lib/chef/resource/windows_dfs_server.rb +1 -1
- data/lib/chef/resource/windows_dns_record.rb +1 -1
- data/lib/chef/resource/windows_dns_zone.rb +1 -1
- data/lib/chef/resource/windows_env.rb +6 -6
- data/lib/chef/resource/windows_feature.rb +43 -43
- data/lib/chef/resource/windows_feature_dism.rb +9 -9
- data/lib/chef/resource/windows_feature_powershell.rb +21 -21
- data/lib/chef/resource/windows_firewall_profile.rb +29 -29
- data/lib/chef/resource/windows_firewall_rule.rb +48 -48
- data/lib/chef/resource/windows_font.rb +7 -7
- data/lib/chef/resource/windows_package.rb +59 -59
- data/lib/chef/resource/windows_pagefile.rb +30 -30
- data/lib/chef/resource/windows_path.rb +13 -13
- data/lib/chef/resource/windows_printer.rb +29 -29
- data/lib/chef/resource/windows_printer_port.rb +22 -22
- data/lib/chef/resource/windows_script.rb +1 -1
- data/lib/chef/resource/windows_security_policy.rb +24 -24
- data/lib/chef/resource/windows_service.rb +108 -108
- data/lib/chef/resource/windows_share.rb +17 -17
- data/lib/chef/resource/windows_shortcut.rb +8 -8
- data/lib/chef/resource/windows_task.rb +104 -106
- data/lib/chef/resource/windows_uac.rb +15 -15
- data/lib/chef/resource/windows_update_settings.rb +27 -27
- data/lib/chef/resource/windows_user_privilege.rb +59 -59
- data/lib/chef/resource/windows_workgroup.rb +11 -11
- data/lib/chef/resource/yum_package.rb +6 -5
- data/lib/chef/resource/yum_repository.rb +39 -38
- data/lib/chef/resource/zypper_package.rb +3 -2
- data/lib/chef/resource/zypper_repository.rb +4 -3
- data/lib/chef/resource.rb +11 -3
- data/lib/chef/resource_builder.rb +1 -1
- data/lib/chef/resource_collection/resource_collection_serialization.rb +1 -1
- data/lib/chef/resource_collection/resource_list.rb +1 -1
- data/lib/chef/resource_collection/resource_set.rb +10 -4
- data/lib/chef/resource_collection.rb +1 -1
- data/lib/chef/resource_definition.rb +1 -1
- data/lib/chef/resource_definition_list.rb +1 -1
- data/lib/chef/resource_inspector.rb +3 -1
- data/lib/chef/resource_reporter.rb +2 -1
- data/lib/chef/resource_resolver.rb +1 -1
- data/lib/chef/resources.rb +2 -2
- data/lib/chef/role.rb +1 -1
- data/lib/chef/run_context/cookbook_compiler.rb +1 -1
- data/lib/chef/run_context.rb +2 -2
- data/lib/chef/run_list/run_list_expansion.rb +1 -1
- data/lib/chef/run_list/run_list_item.rb +5 -5
- data/lib/chef/run_list/versioned_recipe_list.rb +1 -1
- data/lib/chef/run_list.rb +1 -1
- data/lib/chef/run_lock.rb +4 -1
- data/lib/chef/run_status.rb +1 -1
- data/lib/chef/runner.rb +1 -1
- data/lib/chef/scan_access_control.rb +9 -7
- data/lib/chef/search/query.rb +1 -1
- data/lib/chef/secret_fetcher/akeyless_vault.rb +1 -1
- data/lib/chef/secret_fetcher/aws_secrets_manager.rb +1 -1
- data/lib/chef/secret_fetcher/base.rb +1 -1
- data/lib/chef/secret_fetcher/example.rb +1 -1
- data/lib/chef/secret_fetcher/hashi_vault.rb +10 -1
- data/lib/chef/secret_fetcher.rb +1 -1
- data/lib/chef/server_api.rb +1 -1
- data/lib/chef/server_api_versions.rb +1 -1
- data/lib/chef/shell/ext.rb +20 -20
- data/lib/chef/shell/model_wrapper.rb +1 -1
- data/lib/chef/shell/shell_session.rb +2 -2
- data/lib/chef/shell.rb +30 -15
- data/lib/chef/target_io/dir.rb +12 -0
- data/lib/chef/target_io/etc.rb +16 -0
- data/lib/chef/target_io/file.rb +12 -0
- data/lib/chef/target_io/fileutils.rb +12 -0
- data/lib/chef/target_io/http.rb +35 -0
- data/lib/chef/target_io/io.rb +12 -0
- data/lib/chef/target_io/shadow.rb +44 -0
- data/lib/chef/target_io/support.rb +73 -0
- data/lib/chef/target_io/train/dir.rb +86 -0
- data/lib/chef/target_io/train/etc.rb +108 -0
- data/lib/chef/target_io/train/file.rb +219 -0
- data/lib/chef/target_io/train/fileutils.rb +201 -0
- data/lib/chef/target_io/train/http.rb +117 -0
- data/lib/chef/target_io/train/io.rb +13 -0
- data/lib/chef/target_io/train/shadow.rb +54 -0
- data/lib/chef/target_io/train_compat.rb +7 -0
- data/lib/chef/target_io.rb +11 -0
- data/lib/chef/train_transport.rb +1 -1
- data/lib/chef/user.rb +1 -1
- data/lib/chef/user_v1.rb +1 -1
- data/lib/chef/util/backup.rb +2 -2
- data/lib/chef/util/diff.rb +15 -2
- data/lib/chef/util/dsc/configuration_generator.rb +1 -1
- data/lib/chef/util/dsc/lcm_output_parser.rb +1 -1
- data/lib/chef/util/dsc/local_configuration_manager.rb +1 -1
- data/lib/chef/util/dsc/resource_store.rb +1 -1
- data/lib/chef/util/editor.rb +1 -1
- data/lib/chef/util/file_edit.rb +5 -5
- data/lib/chef/util/path_helper.rb +1 -1
- data/lib/chef/util/powershell/ps_credential.rb +1 -1
- data/lib/chef/util/selinux.rb +1 -1
- data/lib/chef/util/threaded_job_queue.rb +1 -1
- data/lib/chef/util/windows/logon_session.rb +1 -1
- data/lib/chef/version.rb +2 -2
- data/lib/chef/version_class.rb +1 -1
- data/lib/chef/version_constraint.rb +2 -2
- data/lib/chef/win32/api/command_line_helper.rb +1 -1
- data/lib/chef/win32/api/crypto.rb +1 -1
- data/lib/chef/win32/api/error.rb +1 -1
- data/lib/chef/win32/api/file.rb +3 -2
- data/lib/chef/win32/api/installer.rb +1 -1
- data/lib/chef/win32/api/memory.rb +1 -1
- data/lib/chef/win32/api/net.rb +1 -1
- data/lib/chef/win32/api/process.rb +1 -1
- data/lib/chef/win32/api/psapi.rb +1 -1
- data/lib/chef/win32/api/registry.rb +1 -1
- data/lib/chef/win32/api/security.rb +1 -1
- data/lib/chef/win32/api/synchronization.rb +1 -1
- data/lib/chef/win32/api/system.rb +1 -1
- data/lib/chef/win32/api/unicode.rb +1 -1
- data/lib/chef/win32/api.rb +1 -1
- data/lib/chef/win32/crypto.rb +1 -1
- data/lib/chef/win32/error.rb +3 -2
- data/lib/chef/win32/eventlog.rb +1 -1
- data/lib/chef/win32/file/info.rb +1 -1
- data/lib/chef/win32/file/version_info.rb +1 -1
- data/lib/chef/win32/file.rb +1 -1
- data/lib/chef/win32/handle.rb +1 -1
- data/lib/chef/win32/memory.rb +1 -1
- data/lib/chef/win32/mutex.rb +1 -1
- data/lib/chef/win32/net.rb +1 -1
- data/lib/chef/win32/process.rb +1 -1
- data/lib/chef/win32/registry.rb +4 -2
- data/lib/chef/win32/security/ace.rb +1 -1
- data/lib/chef/win32/security/acl.rb +1 -1
- data/lib/chef/win32/security/securable_object.rb +1 -1
- data/lib/chef/win32/security/security_descriptor.rb +1 -1
- data/lib/chef/win32/security/sid.rb +1 -1
- data/lib/chef/win32/security/token.rb +1 -1
- data/lib/chef/win32/security.rb +1 -1
- data/lib/chef/win32/system.rb +1 -1
- data/lib/chef/win32/unicode.rb +1 -1
- data/lib/chef/win32/version.rb +2 -3
- data/lib/chef/workstation_config_loader.rb +1 -1
- data/lib/chef.rb +3 -1
- metadata +136 -120
- data/lib/chef/monkey_patches/reline-windows.rb +0 -116
- data/lib/chef/resource/osx_profile.rb +0 -334
|
@@ -1,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.
|
|
@@ -21,131 +21,82 @@ class Chef
|
|
|
21
21
|
class Resource
|
|
22
22
|
class ChefClientConfig < Chef::Resource
|
|
23
23
|
|
|
24
|
-
provides :chef_client_config
|
|
25
|
-
|
|
26
|
-
DIRECTORY_SPEC_DEFAULTS = {
|
|
27
|
-
config: { mode: "0750", inherits: :auto },
|
|
28
|
-
client_d: { mode: "0750", inherits: :auto },
|
|
29
|
-
logs: { mode: "0755", inherits: :auto },
|
|
30
|
-
cache: { mode: "0750", inherits: :auto },
|
|
31
|
-
backups: { mode: "0750", inherits: :auto },
|
|
32
|
-
}.freeze
|
|
24
|
+
provides :chef_client_config, target_mode: true
|
|
25
|
+
target_mode support: :full
|
|
33
26
|
|
|
34
27
|
description "Use the **chef_client_config** resource to create a client.rb file in the #{ChefUtils::Dist::Infra::PRODUCT} configuration directory. See the [client.rb docs](https://docs.chef.io/config_rb_client/) for more details on options available in the client.rb configuration file."
|
|
35
28
|
introduced "16.6"
|
|
36
29
|
examples <<~DOC
|
|
37
|
-
|
|
30
|
+
**Bare minimum #{ChefUtils::Dist::Infra::PRODUCT} client.rb**:
|
|
38
31
|
|
|
39
|
-
|
|
32
|
+
The absolute minimum configuration necessary for a node to communicate with the #{ChefUtils::Dist::Server::PRODUCT} is the URL of the #{ChefUtils::Dist::Server::PRODUCT}. All other configuration options either have values at the server side (Policyfiles, Roles, Environments, etc) or have default values determined at client startup.
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
**Setup two report handlers in the client.rb**:
|
|
81
|
-
|
|
82
|
-
```ruby
|
|
83
|
-
chef_client_config 'Create client.rb' do
|
|
84
|
-
chef_server_url 'https://chef.example.dmz'
|
|
85
|
-
report_handlers [
|
|
86
|
-
{
|
|
87
|
-
'class' => 'ReportHandler1Class',
|
|
88
|
-
'arguments' => ["'FirstArgument'", "'SecondArgument'"],
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
'class' => 'ReportHandler2Class',
|
|
92
|
-
'arguments' => ["'FirstArgument'", "'SecondArgument'"],
|
|
93
|
-
},
|
|
94
|
-
]
|
|
95
|
-
end
|
|
96
|
-
```
|
|
34
|
+
```ruby
|
|
35
|
+
chef_client_config 'Create client.rb' do
|
|
36
|
+
chef_server_url 'https://chef.example.dmz'
|
|
37
|
+
end
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**More complex #{ChefUtils::Dist::Infra::PRODUCT} client.rb**:
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
chef_client_config 'Create client.rb' do
|
|
44
|
+
chef_server_url 'https://chef.example.dmz'
|
|
45
|
+
log_level :info
|
|
46
|
+
log_location :syslog
|
|
47
|
+
http_proxy 'proxy.example.dmz'
|
|
48
|
+
https_proxy 'proxy.example.dmz'
|
|
49
|
+
no_proxy %w(internal.example.dmz)
|
|
50
|
+
end
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Adding additional config content to the client.rb**:
|
|
54
|
+
|
|
55
|
+
This resource aims to provide common configuration options. Some configuration options are missing and some users may want to use arbitrary Ruby code within their configuration. For this we offer an `additional_config` property that can be used to add any configuration or code to the bottom of the `client.rb` file. Also keep in mind that within the configuration directory is a `client.d` directory where you can put additional `.rb` files containing configuration options. These can be created using `file` or `template` resources within your cookbooks as necessary.
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
chef_client_config 'Create client.rb' do
|
|
59
|
+
chef_server_url 'https://chef.example.dmz'
|
|
60
|
+
additional_config <<~CONFIG
|
|
61
|
+
# Extra config code to safely load a gem into the client run.
|
|
62
|
+
# Since the config is Ruby you can run any Ruby code you want via the client.rb.
|
|
63
|
+
# It's a great way to break things, so be careful
|
|
64
|
+
begin
|
|
65
|
+
require 'aws-sdk'
|
|
66
|
+
rescue LoadError
|
|
67
|
+
Chef::Log.warn "Failed to load aws-sdk."
|
|
68
|
+
end
|
|
69
|
+
CONFIG
|
|
70
|
+
end
|
|
71
|
+
```
|
|
97
72
|
|
|
98
|
-
|
|
73
|
+
**Setup two report handlers in the client.rb**:
|
|
99
74
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
end
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Set Windows directory inheritance and rights**:
|
|
129
|
-
|
|
130
|
-
```ruby
|
|
131
|
-
chef_client_config 'Create client.rb' do
|
|
132
|
-
chef_server_url 'https://chef.example.dmz'
|
|
133
|
-
config_directory 'C:/chef'
|
|
134
|
-
file_cache_path 'C:/chef/cache'
|
|
135
|
-
file_backup_path 'C:/chef/backups'
|
|
136
|
-
log_location 'C:/chef/log/client.log'
|
|
137
|
-
directory_specs(
|
|
138
|
-
config: {
|
|
139
|
-
owner: 'Administrators',
|
|
140
|
-
inherits: false,
|
|
141
|
-
rights: {
|
|
142
|
-
'Administrators' => :full_control,
|
|
143
|
-
'SYSTEM' => :full_control,
|
|
144
|
-
},
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
end
|
|
148
|
-
```
|
|
75
|
+
```ruby
|
|
76
|
+
chef_client_config 'Create client.rb' do
|
|
77
|
+
chef_server_url 'https://chef.example.dmz'
|
|
78
|
+
report_handlers [
|
|
79
|
+
{
|
|
80
|
+
'class' => 'ReportHandler1Class',
|
|
81
|
+
'arguments' => ["'FirstArgument'", "'SecondArgument'"],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
'class' => 'ReportHandler2Class',
|
|
85
|
+
'arguments' => ["'FirstArgument'", "'SecondArgument'"],
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
end
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Report directly to the [Chef Automate data collector endpoint](/automate/data_collection/#configure-chef-infra-client-to-use-the-data-collector-endpoint-in-chef-automate).**
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
chef_client_config 'Create client.rb' do
|
|
95
|
+
chef_server_url 'https://chef.example.dmz'
|
|
96
|
+
data_collector_server_url 'https://automate.example.dmz'
|
|
97
|
+
data_collector_token 'TEST_TOKEN_TEST'
|
|
98
|
+
end
|
|
99
|
+
```
|
|
149
100
|
DOC
|
|
150
101
|
|
|
151
102
|
# @todo policy_file or policy_group being set requires the other to be set so enforce that.
|
|
@@ -191,10 +142,10 @@ class Chef
|
|
|
191
142
|
equal_to: %i{verify_none verify_peer},
|
|
192
143
|
coerce: proc { |x| string_to_symbol(x) },
|
|
193
144
|
description: <<~DESC
|
|
194
|
-
|
|
145
|
+
Set the verify mode for HTTPS requests.
|
|
195
146
|
|
|
196
|
-
|
|
197
|
-
|
|
147
|
+
* Use :verify_none for no validation of SSL certificates.
|
|
148
|
+
* Use :verify_peer for validation of all SSL certificates, including the #{ChefUtils::Dist::Server::PRODUCT} connections, S3 connections, and any HTTPS remote_file resource URLs used in #{ChefUtils::Dist::Infra::PRODUCT} runs. This is the recommended setting.
|
|
198
149
|
DESC
|
|
199
150
|
|
|
200
151
|
property :formatters, Array,
|
|
@@ -224,7 +175,7 @@ class Chef
|
|
|
224
175
|
description: "The proxy server to use for HTTPS connections."
|
|
225
176
|
|
|
226
177
|
property :ftp_proxy, String,
|
|
227
|
-
|
|
178
|
+
description: "The proxy server to use for FTP connections."
|
|
228
179
|
|
|
229
180
|
property :no_proxy, [String, Array],
|
|
230
181
|
description: "A comma-separated list or an array of URLs that do not need a proxy.",
|
|
@@ -304,83 +255,21 @@ class Chef
|
|
|
304
255
|
description: "The data collector token to interact with the data collector server URL (Automate). Note: If possible, use Chef Infra Server to do all data collection reporting, as this removes the need to distribute tokens to individual nodes.",
|
|
305
256
|
introduced: "17.8"
|
|
306
257
|
|
|
307
|
-
property :directory_specs, Hash,
|
|
308
|
-
description: <<~DESC,
|
|
309
|
-
Permission overrides for Chef-managed directories.
|
|
310
|
-
This must be a hash of hashes: top-level keys are directory names, values are per-directory option hashes.
|
|
311
|
-
|
|
312
|
-
Use this property like:
|
|
313
|
-
directory_specs(
|
|
314
|
-
config: { owner: "root", group: "root", mode: "0700" },
|
|
315
|
-
client_d: { owner: "root", group: "root", mode: "0700" },
|
|
316
|
-
logs: { owner: "root", group: "root", mode: "0700" },
|
|
317
|
-
cache: { owner: "root", group: "root", mode: "0700" },
|
|
318
|
-
backups: { owner: "root", group: "root", mode: "0700" }
|
|
319
|
-
)
|
|
320
|
-
|
|
321
|
-
Directory keys: :config, :client_d, :logs, :cache, :backups
|
|
322
|
-
Override keys: :owner, :group, :mode, :rights, :inherits (:rights and :inherits are Windows-only)
|
|
323
|
-
DESC
|
|
324
|
-
callbacks: {
|
|
325
|
-
"keys must be one of :config, :client_d, :logs, :cache, :backups" => lambda { |v|
|
|
326
|
-
valid_keys = %i{config client_d logs cache backups}
|
|
327
|
-
v.keys.all? { |k| valid_keys.include?(k) }
|
|
328
|
-
},
|
|
329
|
-
"values must be a hash with keys only from :owner, :group, :mode, :rights, :inherits" => lambda { |v|
|
|
330
|
-
valid_inner_keys = %i{owner group mode rights inherits}
|
|
331
|
-
v.values.all? { |value| value.is_a?(Hash) && value.keys.all? { |k| valid_inner_keys.include?(k) } }
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
default: DIRECTORY_SPEC_DEFAULTS,
|
|
335
|
-
coerce: proc { |v|
|
|
336
|
-
DIRECTORY_SPEC_DEFAULTS.merge(v) do |_key, base, override|
|
|
337
|
-
override.is_a?(Hash) ? base.merge(override) : override
|
|
338
|
-
end
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
property :client_rb_mode, String,
|
|
342
|
-
description: "The mode to set on the client.rb file that is written out by this resource (e.g., 0600).",
|
|
343
|
-
default: "0640"
|
|
344
|
-
|
|
345
258
|
action :create, description: "Create a client.rb config file and folders for configuring #{ChefUtils::Dist::Infra::PRODUCT}." do
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
cache: new_resource.file_cache_path || ChefConfig::Config.file_cache_path,
|
|
361
|
-
backups: new_resource.file_backup_path || ChefConfig::Config.file_backup_path,
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
# Build directory specs based on user input and defaults
|
|
365
|
-
specs = {}
|
|
366
|
-
new_resource.directory_specs.each do |key, overrides|
|
|
367
|
-
path = spec_paths[key]
|
|
368
|
-
next if path.nil?
|
|
369
|
-
|
|
370
|
-
specs[key] = DirectorySpec.new(
|
|
371
|
-
path: path,
|
|
372
|
-
owner: overrides[:owner] || new_resource.user,
|
|
373
|
-
group: overrides[:group] || new_resource.group,
|
|
374
|
-
mode: overrides[:mode],
|
|
375
|
-
rights: overrides[:rights],
|
|
376
|
-
inherits: overrides[:inherits]
|
|
377
|
-
)
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
# Converge directories
|
|
381
|
-
specs.each_value do |spec|
|
|
382
|
-
directory spec.path do
|
|
383
|
-
spec.apply(self)
|
|
259
|
+
[
|
|
260
|
+
new_resource.config_directory,
|
|
261
|
+
(::File.dirname(new_resource.log_location) if new_resource.log_location.is_a?(String) && !%w{STDOUT STDERR}.include?(new_resource.log_location) && !new_resource.log_location.empty?),
|
|
262
|
+
new_resource.file_backup_path,
|
|
263
|
+
new_resource.file_cache_path,
|
|
264
|
+
::File.join(new_resource.config_directory, "client.d"),
|
|
265
|
+
(::File.dirname(new_resource.pid_file) unless new_resource.pid_file.nil?),
|
|
266
|
+
].compact.each do |dir_path|
|
|
267
|
+
|
|
268
|
+
directory dir_path do
|
|
269
|
+
user new_resource.user unless new_resource.user.nil?
|
|
270
|
+
group new_resource.group unless new_resource.group.nil?
|
|
271
|
+
mode dir_path == ::File.dirname(new_resource.log_location.to_s) ? "0755" : "0750"
|
|
272
|
+
recursive true
|
|
384
273
|
end
|
|
385
274
|
end
|
|
386
275
|
|
|
@@ -421,7 +310,7 @@ class Chef
|
|
|
421
310
|
data_collector_server_url: new_resource.data_collector_server_url,
|
|
422
311
|
data_collector_token: new_resource.data_collector_token
|
|
423
312
|
)
|
|
424
|
-
mode
|
|
313
|
+
mode "0640"
|
|
425
314
|
action :create
|
|
426
315
|
end
|
|
427
316
|
end
|
|
@@ -445,60 +334,6 @@ class Chef
|
|
|
445
334
|
"#{handler["class"]}.new(#{handler["arguments"].join(",")})"
|
|
446
335
|
end
|
|
447
336
|
end
|
|
448
|
-
|
|
449
|
-
# A helper class to encapsulate directory spec data and application logic for both *nix and Windows.
|
|
450
|
-
# This allows us to keep the logic for how to apply permissions to directories in one place and makes it easier to test.
|
|
451
|
-
class DirectorySpec
|
|
452
|
-
attr_reader :path, :owner, :group, :mode, :rights, :inherits
|
|
453
|
-
|
|
454
|
-
def initialize(path:, owner: nil, group: nil, mode: nil, rights: nil, inherits: :auto)
|
|
455
|
-
@path = path
|
|
456
|
-
@owner = owner
|
|
457
|
-
@group = group
|
|
458
|
-
@mode = mode
|
|
459
|
-
@rights = rights
|
|
460
|
-
@inherits = inherits
|
|
461
|
-
end
|
|
462
|
-
|
|
463
|
-
def windows?
|
|
464
|
-
Chef::Platform.windows?
|
|
465
|
-
end
|
|
466
|
-
|
|
467
|
-
def apply(resource)
|
|
468
|
-
resource.recursive true
|
|
469
|
-
|
|
470
|
-
if windows?
|
|
471
|
-
if rights && !rights.empty?
|
|
472
|
-
resource.inherits(inherits == :auto ? false : inherits)
|
|
473
|
-
|
|
474
|
-
rights.each do |principal, permission|
|
|
475
|
-
resource.rights(permission, principal)
|
|
476
|
-
end
|
|
477
|
-
else
|
|
478
|
-
# Ensure defaults can restore inherited ACL behavior after custom rights were applied.
|
|
479
|
-
resource.inherits(inherits == :auto ? true : inherits)
|
|
480
|
-
resource.mode(mode) if mode
|
|
481
|
-
end
|
|
482
|
-
|
|
483
|
-
resource.owner(owner) if owner
|
|
484
|
-
else
|
|
485
|
-
resource.owner(owner) if owner
|
|
486
|
-
resource.group(group) if group
|
|
487
|
-
resource.mode(mode) if mode
|
|
488
|
-
end
|
|
489
|
-
end
|
|
490
|
-
end
|
|
491
|
-
|
|
492
|
-
# A helper method to determine the directory to apply log permissions to based on the log_location property.
|
|
493
|
-
# If log_location is a file path, this returns the directory containing that file.
|
|
494
|
-
# If log_location is not a file path (e.g., it's a symbol for syslog or win_evt, or it's STDOUT/STDERR),
|
|
495
|
-
# this returns nil since there is no directory to apply permissions to.
|
|
496
|
-
def log_directory
|
|
497
|
-
return unless new_resource.log_location.is_a?(String)
|
|
498
|
-
return if %w{STDOUT STDERR}.include?(new_resource.log_location)
|
|
499
|
-
|
|
500
|
-
::File.dirname(new_resource.log_location)
|
|
501
|
-
end
|
|
502
337
|
end
|
|
503
338
|
end
|
|
504
339
|
end
|
|
@@ -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.
|
|
@@ -18,6 +18,7 @@ require_relative "../resource"
|
|
|
18
18
|
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
19
19
|
require_relative "helpers/cron_validations"
|
|
20
20
|
require "digest/md5" unless defined?(Digest::MD5)
|
|
21
|
+
require_relative "helpers/path_helpers"
|
|
21
22
|
|
|
22
23
|
class Chef
|
|
23
24
|
class Resource
|
|
@@ -28,31 +29,32 @@ class Chef
|
|
|
28
29
|
description "Use the **chef_client_cron** resource to setup the #{ChefUtils::Dist::Infra::PRODUCT} to run as a cron job. This resource will also create the specified log directory if it doesn't already exist."
|
|
29
30
|
introduced "16.0"
|
|
30
31
|
examples <<~DOC
|
|
31
|
-
|
|
32
|
+
**Setup #{ChefUtils::Dist::Infra::PRODUCT} to run using the default 30 minute cadence**:
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
```ruby
|
|
35
|
+
chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} as a cron job'
|
|
36
|
+
```
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
**Run #{ChefUtils::Dist::Infra::PRODUCT} twice a day**:
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
```ruby
|
|
41
|
+
chef_client_cron 'Run #{ChefUtils::Dist::Infra::PRODUCT} every 12 hours' do
|
|
42
|
+
minute 0
|
|
43
|
+
hour '0,12'
|
|
44
|
+
end
|
|
45
|
+
```
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
**Run #{ChefUtils::Dist::Infra::PRODUCT} with extra options passed to the client**:
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
```ruby
|
|
50
|
+
chef_client_cron 'Run an override recipe' do
|
|
51
|
+
daemon_options ['--override-runlist mycorp_base::default']
|
|
52
|
+
end
|
|
53
|
+
```
|
|
53
54
|
DOC
|
|
54
55
|
|
|
55
56
|
extend Chef::ResourceHelpers::CronValidations
|
|
57
|
+
extend Chef::ResourceHelpers::PathHelpers
|
|
56
58
|
|
|
57
59
|
property :job_name, String,
|
|
58
60
|
default: ChefUtils::Dist::Infra::CLIENT,
|
|
@@ -126,7 +128,7 @@ class Chef
|
|
|
126
128
|
description: "Append to the log file instead of overwriting the log file on each run."
|
|
127
129
|
|
|
128
130
|
property :chef_binary_path, String,
|
|
129
|
-
default:
|
|
131
|
+
default: lazy { Chef::ResourceHelpers::PathHelpers.chef_client_hab_binary_path },
|
|
130
132
|
description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary."
|
|
131
133
|
|
|
132
134
|
property :daemon_options, Array,
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright:: Copyright (c) 2009-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
|
|
17
|
+
require "pathname"
|
|
18
|
+
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
19
|
+
|
|
20
|
+
class Chef
|
|
21
|
+
class Resource
|
|
22
|
+
class ChefClientHabCaCert < Chef::Resource
|
|
23
|
+
|
|
24
|
+
provides :chef_client_hab_ca_cert
|
|
25
|
+
|
|
26
|
+
description "Use the **chef_client_hab_ca_cert** resource to add certificates to habitat #{ChefUtils::Dist::Infra::PRODUCT}'s CA bundle. This allows the #{ChefUtils::Dist::Infra::PRODUCT} to communicate with internal encrypted resources without errors. To make sure these CA certs take effect the `ssl_ca_file` should be configured to point to the CA Cert file path of `core/cacerts` habitat package."
|
|
27
|
+
introduced "19.1"
|
|
28
|
+
examples <<~DOC
|
|
29
|
+
**Trust a self signed certificate**:
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
chef_client_hab_ca_cert 'self-signed.badssl.com' do
|
|
33
|
+
certificate <<~CERT
|
|
34
|
+
-----BEGIN CERTIFICATE-----
|
|
35
|
+
MIIDeTCCAmGgAwIBAgIJAPziuikCTox4MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV
|
|
36
|
+
BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp
|
|
37
|
+
c2NvMQ8wDQYDVQQKDAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTAeFw0x
|
|
38
|
+
OTEwMDkyMzQxNTJaFw0yMTEwMDgyMzQxNTJaMGIxCzAJBgNVBAYTAlVTMRMwEQYD
|
|
39
|
+
VQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQK
|
|
40
|
+
DAZCYWRTU0wxFTATBgNVBAMMDCouYmFkc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEB
|
|
41
|
+
BQADggEPADCCAQoCggEBAMIE7PiM7gTCs9hQ1XBYzJMY61yoaEmwIrX5lZ6xKyx2
|
|
42
|
+
PmzAS2BMTOqytMAPgLaw+XLJhgL5XEFdEyt/ccRLvOmULlA3pmccYYz2QULFRtMW
|
|
43
|
+
hyefdOsKnRFSJiFzbIRMeVXk0WvoBj1IFVKtsyjbqv9u/2CVSndrOfEk0TG23U3A
|
|
44
|
+
xPxTuW1CrbV8/q71FdIzSOciccfCFHpsKOo3St/qbLVytH5aohbcabFXRNsKEqve
|
|
45
|
+
ww9HdFxBIuGa+RuT5q0iBikusbpJHAwnnqP7i/dAcgCskgjZjFeEU4EFy+b+a1SY
|
|
46
|
+
QCeFxxC7c3DvaRhBB0VVfPlkPz0sw6l865MaTIbRyoUCAwEAAaMyMDAwCQYDVR0T
|
|
47
|
+
BAIwADAjBgNVHREEHDAaggwqLmJhZHNzbC5jb22CCmJhZHNzbC5jb20wDQYJKoZI
|
|
48
|
+
hvcNAQELBQADggEBAGlwCdbPxflZfYOaukZGCaxYK6gpincX4Lla4Ui2WdeQxE95
|
|
49
|
+
w7fChXvP3YkE3UYUE7mupZ0eg4ZILr/A0e7JQDsgIu/SRTUE0domCKgPZ8v99k3A
|
|
50
|
+
vka4LpLK51jHJJK7EFgo3ca2nldd97GM0MU41xHFk8qaK1tWJkfrrfcGwDJ4GQPI
|
|
51
|
+
iLlm6i0yHq1Qg1RypAXJy5dTlRXlCLd8ufWhhiwW0W75Va5AEnJuqpQrKwl3KQVe
|
|
52
|
+
wGj67WWRgLfSr+4QG1mNvCZb2CkjZWmxkGPuoP40/y7Yu5OFqxP5tAjj4YixCYTW
|
|
53
|
+
EVA0pmzIzgBg+JIe3PdRy27T0asgQW/F4TY61Yk=
|
|
54
|
+
-----END CERTIFICATE-----
|
|
55
|
+
CERT
|
|
56
|
+
end
|
|
57
|
+
```
|
|
58
|
+
DOC
|
|
59
|
+
|
|
60
|
+
property :cert_name, String, name_property: true,
|
|
61
|
+
description: "The name to use for the certificate. If not provided the name of the resource block will be used instead."
|
|
62
|
+
|
|
63
|
+
property :certificate, String, required: true,
|
|
64
|
+
description: "The text of the certificate file including the BEGIN/END comment lines."
|
|
65
|
+
|
|
66
|
+
action :add, description: "Add a local certificate to habitat based #{ChefUtils::Dist::Infra::PRODUCT}'s CA bundle." do
|
|
67
|
+
return if cert_installed? new_resource.certificate
|
|
68
|
+
|
|
69
|
+
converge_by("Add new CA bundle #{new_resource.cert_name} to #{ca_cert_path}") do
|
|
70
|
+
::File.open(ca_cert_path, "a") do |f|
|
|
71
|
+
f.puts "\nCert Bundle - #{new_resource.cert_name}"
|
|
72
|
+
f.puts "==========================="
|
|
73
|
+
f.puts new_resource.certificate
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
action_class do
|
|
79
|
+
#
|
|
80
|
+
# The path to the string on disk
|
|
81
|
+
#
|
|
82
|
+
# @return [String]
|
|
83
|
+
#
|
|
84
|
+
def ca_cert_path
|
|
85
|
+
return @ca_cert_path if @ca_cert_path
|
|
86
|
+
|
|
87
|
+
@ca_cert_path = ::File.join(hab_cacerts_pkg_path, "ssl", "certs", "cacert.pem")
|
|
88
|
+
Chef::Log.debug "Determined CA cert path: #{@ca_cert_path}"
|
|
89
|
+
@ca_cert_path
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
# The fully qualified ident of the cacerts package.
|
|
95
|
+
#
|
|
96
|
+
# @api private
|
|
97
|
+
#
|
|
98
|
+
def hab_cacerts_pkg_path
|
|
99
|
+
return @hab_cacerts_pkg_path if @hab_cacerts_pkg_path
|
|
100
|
+
|
|
101
|
+
# Find the current running version of chef to get THAT version's cacerts package.
|
|
102
|
+
current_chef_path = Chef::ResourceHelpers::PathHelpers.chef_client_hab_package_binary_path
|
|
103
|
+
current_hab_path = Chef::ResourceHelpers::PathHelpers.hab_executable_binary_path
|
|
104
|
+
|
|
105
|
+
# Extract package ident from path: /hab/pkgs/chef/chef-infra-client/VERSION/RELEASE/bin/chef-client
|
|
106
|
+
# or: C:\hab\pkgs\chef\chef-infra-client\VERSION\RELEASE\bin\chef-client.exe
|
|
107
|
+
# Result should be: chef/chef-infra-client/VERSION/RELEASE
|
|
108
|
+
package_ident = ::File.join(Pathname.new(current_chef_path).each_filename.to_a[2..5])
|
|
109
|
+
|
|
110
|
+
ca_pkg = shell_out("#{current_hab_path} pkg dependencies #{package_ident}")
|
|
111
|
+
if ca_pkg.error?
|
|
112
|
+
raise "Failed to determine CA Certs for the #{ChefUtils::Dist::Infra::PRODUCT}'s habitat package"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
hab_cacerts_pkg = ca_pkg.stdout.scan(%r{core/cacerts.*$}).flatten.first
|
|
116
|
+
|
|
117
|
+
if hab_cacerts_pkg.nil?
|
|
118
|
+
raise "Unable to find 'core/cacerts' package in dependencies. Failed to determine CA Certs."
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
ca_path = shell_out("#{current_hab_path} pkg path #{hab_cacerts_pkg}")
|
|
122
|
+
if ca_path.error?
|
|
123
|
+
raise "Unable to find path for the 'core/cacerts' habitat package."
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
path = ca_path.stdout.lines.first
|
|
127
|
+
|
|
128
|
+
@hab_cacerts_pkg_path = path.strip
|
|
129
|
+
Chef::Log.debug "Determined cacerts package path: #{@hab_cacerts_pkg_path}"
|
|
130
|
+
@hab_cacerts_pkg_path
|
|
131
|
+
end # hab_cacerts_pkg_path
|
|
132
|
+
|
|
133
|
+
def cert_installed?(certificate)
|
|
134
|
+
chef_cacert_pem = ::File.read(ca_cert_path)
|
|
135
|
+
chef_cacert_pem.include?(certificate)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
end # action_class
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -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.
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
require_relative "../resource"
|
|
18
18
|
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
|
|
19
|
+
require_relative "helpers/path_helpers"
|
|
20
|
+
|
|
19
21
|
class Chef
|
|
20
22
|
class Resource
|
|
21
23
|
class ChefClientLaunchd < Chef::Resource
|
|
@@ -43,6 +45,8 @@ class Chef
|
|
|
43
45
|
```
|
|
44
46
|
DOC
|
|
45
47
|
|
|
48
|
+
extend Chef::ResourceHelpers::PathHelpers
|
|
49
|
+
|
|
46
50
|
property :user, String,
|
|
47
51
|
description: "The name of the user that #{ChefUtils::Dist::Infra::PRODUCT} runs as.",
|
|
48
52
|
default: "root"
|
|
@@ -81,7 +85,7 @@ class Chef
|
|
|
81
85
|
|
|
82
86
|
property :chef_binary_path, String,
|
|
83
87
|
description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary.",
|
|
84
|
-
default:
|
|
88
|
+
default: lazy { Chef::ResourceHelpers::PathHelpers.chef_client_hab_binary_path }
|
|
85
89
|
|
|
86
90
|
property :daemon_options, Array,
|
|
87
91
|
description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command.",
|