<commit_before># Chef Client Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/chef-client.svg?branch=master)](https://travis-ci.org/chef-cookbooks/chef-client) [![Cookbook Version](https://img.shields.io/cookbook/v/chef-client.svg)](https://supermarket.chef.io/cookbooks/chef-client)

This cookbook is used to configure a system as a Chef Client.

## Requirements
### Platforms
The following platforms are tested directly under test-kitchen; see .kitchen.yml and TESTING.md for details.
- Ubuntu 12.04, 14.04
- CentOS 5.11, 6.7, 7.2
- Debian 7.9, 8.2
- Fedora 22, 23
- FreeBSD 9.3, 10.2

The following platforms are known to work:
- Debian family (Debian, Ubuntu etc)
- Red Hat family (Redhat, CentOS, Oracle etc)
- Fedora family
- SUSE distributions (OpenSUSE, SLES, etc)
- ArchLinux
- FreeBSD
- Mac OS X
- Mac OS X Server
- Microsoft Windows (7, 8, 2008, 2008 R2, 2012, 2012 R2)
- AIX (6.1, 7.1)

Other platforms may work with or without modification. Most notably, attribute modification may be required.

### Chef
- Chef 11.6.0+

### Dependent Cookbooks
Some cookbooks can be used with this cookbook but they are not explicitly required. The default settings in this cookbook do not require their use. The other cookbooks (on the [supermarket](https://supermarket.chef.io/)) are:
- bluepill
- daemontools
- runit

Cron is a dependency, for default behavior of the `cron` recipe to work. This is a dependency because `cron` is cross platform, and doesn't carry additional dependencies, unlike the other cookbooks listed above.
- cron 1.2.0+
- logrotate 1.2.0+
- windows 1.39.0+

See [USAGE](#usage).

## Attributes
The following attributes affect the behavior of the chef-client program when running as a service through one of the service recipes, or in cron with the cron recipe, or are used in the recipes for various settings that require flexibility.
- `node['chef_client']['interval']` - Sets `Chef::Config[:interval]` via command-line option for number of seconds between chef-client daemon runs. Default 1800.
- `node['chef_client']['splay']` - Sets `Chef::Config[:splay]` via command-line option for a random amount of seconds to add to interval. Default 300.
- `node['chef_client']['log_dir']` - Sets directory used in
- `Chef::Config[:log_location]` via command-line option to a location where chef-client should log output. Default "/var/log/chef".
- `node['chef_client']['log_rotation']['options']` - Set options to logrotation of chef-client log file. Default `['compress']`.
- `node['chef_client']['log_rotation']['prerotate']` - Set prerotate action for chef-client logrotation. Default to `nil`.
- `node['chef_client']['log_rotation']['postrotate']` - Set postrotate action for chef-client logrotation. Default to chef-client service reload depending on init system.
- `node['chef_client']['conf_dir']` - Sets directory used via command-line option to a location where chef-client search for the client config file . Default "/etc/chef".
- `node['chef_client']['bin']` - Sets the full path to the `chef-client` binary. Mainly used to set a specific path if multiple versions of chef-client exist on a system or the bin has been installed in a non-sane path. Default "/usr/bin/chef-client".
- `node['chef_client']['cron']['minute']` - The minute that chef-client will run as a cron task, only applicable if you set `'cron'` as the `'init_style'`
- `node['chef_client']['cron']['hour']` - The hour that chef-client will run as a cron task, only applicable if you set `'cron'` as the `'init_style'`
- `node['chef_client']['cron']['environment_variables']` - Environment variables to pass to chef-client's execution (e.g. `SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt` chef-client)
- `node['chef_client']['cron']['log_file']` - Location to capture the
- `node['chef_client']['cron']['append_log']` - Whether to append to the log. Default: `false` chef-client output.
- `node['chef_client']['cron']['use_cron_d']` - If true, use the [`cron_d` LWRP](https://github.com/chef-cookbooks/cron). If false (default), use the cron resource built-in to Chef.
- `node['chef_client']['cron']['mailto']` - If set, `MAILTO` env variable is set for cron definition
- `node['chef_client']['reload_config']` - If true, reload Chef config of current Chef run when `client.rb` template changes (defaults to true)
- `node['chef_client']['daemon_options']` - An array of additional options to pass to the chef-client service, empty by default, and must be an array if specified.
- `node['chef_client']['task']['frequency']` - Frequency with which to run the `chef-client` scheduled task (e.g., `'hourly'`, `'daily'`, etc.) Default is `'minute'`.
- `node['chef_client']['task']['frequency_modifier']` - Numeric value to go with the scheduled task frequency. Default is the value of
- `node['chef_client']['interval']` in minutes.
- `node['chef_client']['task']['start_time']` - The start time for the task in `HH:mm` format. If the `frequency` is `minute` default start time will be `Time.now` plus the `frequency_modifier` number of minutes.
- `node['chef_client']['task']['user']` - The user the scheduled task will run as, defaults to `'SYSTEM'`.
- `node['chef_client']['task']['password']` - The password for the user the scheduled task will run as, defaults to `nil` because the default user, `'SYSTEM'`, does not need a password.

The following attributes are set on a per-platform basis, see the `attributes/default.rb` file for default values.
- `node['chef_client']['init_style']` - Sets up the client service based on the style of init system to use. Default is based on platform and falls back to `'none'`. See [service recipes](#service-recipes).
- `node['chef_client']['run_path']` - Directory location where chef-client should write the PID file. Default based on platform, falls back to "/var/run".
- `node['chef_client']['cache_path']` - Directory location for
- `Chef::Config[:file_cache_path]` where chef-client will cache various files. Default is based on platform, falls back to "/var/chef/cache".
- `node['chef_client']['backup_path']` - Directory location for `Chef::Config[:file_backup_path]` where chef-client will backup templates and cookbook files. Default is based on platform, falls back to "/var/chef/backup".
- `node['chef_client']['launchd_mode']` - (Only for Mac OS X) if set to `'daemon'`, runs chef-client with `-d` and `-s` options; defaults to `'interval'`.
- When `chef_client['log_file']` is set and running on a [logrotate](http://ckbk.it/logrotate) supported platform (debian, rhel, fedora family), use the following attributes to tune log rotation.<commit_msg>Remove redundant (and wrong) attribute listing<commit_after># Chef Client Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/chef-client.svg?branch=master)](https://travis-ci.org/chef-cookbooks/chef-client) [![Cookbook Version](https://img.shields.io/cookbook/v/chef-client.svg)](https://supermarket.chef.io/cookbooks/chef-client)

This cookbook is used to configure a system as a Chef Client.

## Requirements
### Platforms
The following platforms are tested directly under test-kitchen; see .kitchen.yml and TESTING.md for details.
- Ubuntu 12.04, 14.04
- CentOS 5.11, 6.7, 7.2
- Debian 7.9, 8.2
- Fedora 22, 23
- FreeBSD 9.3, 10.2

The following platforms are known to work:
- Debian family (Debian, Ubuntu etc)
- Red Hat family (Redhat, CentOS, Oracle etc)
- Fedora family
- SUSE distributions (OpenSUSE, SLES, etc)
- ArchLinux
- FreeBSD
- Mac OS X
- Mac OS X Server
- Microsoft Windows (7, 8, 2008, 2008 R2, 2012, 2012 R2)
- AIX (6.1, 7.1)

Other platforms may work with or without modification. Most notably, attribute modification may be required.

### Chef
- Chef 11.6.0+

### Dependent Cookbooks
Some cookbooks can be used with this cookbook but they are not explicitly required. The default settings in this cookbook do not require their use. The other cookbooks (on the [supermarket](https://supermarket.chef.io/)) are:
- bluepill
- daemontools
- runit

Cron is a dependency, for default behavior of the `cron` recipe to work. This is a dependency because `cron` is cross platform, and doesn't carry additional dependencies, unlike the other cookbooks listed above.
- cron 1.2.0+
- logrotate 1.2.0+
- windows 1.39.0+

See [USAGE](#usage).

## Attributes
The following attributes affect the behavior of the chef-client program when running as a service through one of the service recipes, or in cron with the cron recipe, or are used in the recipes for various settings that require flexibility.
- `node['chef_client']['interval']` - Sets `Chef::Config[:interval]` via command-line option for number of seconds between chef-client daemon runs. Default 1800.
- `node['chef_client']['splay']` - Sets `Chef::Config[:splay]` via command-line option for a random amount of seconds to add to interval. Default 300.
- `node['chef_client']['log_dir']` - Sets directory used in
- `Chef::Config[:log_location]` via command-line option to a location where chef-client should log output. Default "/var/log/chef".
- `node['chef_client']['log_rotation']['options']` - Set options to logrotation of chef-client log file. Default `['compress']`.
- `node['chef_client']['log_rotation']['prerotate']` - Set prerotate action for chef-client logrotation. Default to `nil`.
- `node['chef_client']['log_rotation']['postrotate']` - Set postrotate action for chef-client logrotation. Default to chef-client service reload depending on init system.
- `node['chef_client']['conf_dir']` - Sets directory used via command-line option to a location where chef-client search for the client config file . Default "/etc/chef".
- `node['chef_client']['bin']` - Sets the full path to the `chef-client` binary. Mainly used to set a specific path if multiple versions of chef-client exist on a system or the bin has been installed in a non-sane path. Default "/usr/bin/chef-client".
- `node['chef_client']['cron']['minute']` - The minute that chef-client will run as a cron task, only applicable if you set `'cron'` as the `'init_style'`
- `node['chef_client']['cron']['hour']` - The hour that chef-client will run as a cron task, only applicable if you set `'cron'` as the `'init_style'`
- `node['chef_client']['cron']['environment_variables']` - Environment variables to pass to chef-client's execution (e.g. `SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt` chef-client)
- `node['chef_client']['cron']['log_file']` - Location to capture the
- `node['chef_client']['cron']['append_log']` - Whether to append to the log. Default: `false` chef-client output.
- `node['chef_client']['cron']['use_cron_d']` - If true, use the [`cron_d` LWRP](https://github.com/chef-cookbooks/cron). If false (default), use the cron resource built-in to Chef.
- `node['chef_client']['cron']['mailto']` - If set, `MAILTO` env variable is set for cron definition
- `node['chef_client']['reload_config']` - If true, reload Chef config of current Chef run when `client.rb` template changes (defaults to true)
- `node['chef_client']['daemon_options']` - An array of additional options to pass to the chef-client service, empty by default, and must be an array if specified.
- `node['chef_client']['task']['frequency']` - Frequency with which to run the `chef-client` scheduled task (e.g., `'hourly'`, `'daily'`, etc.) Default is `'minute'`.
- `node['chef_client']['task']['frequency_modifier']` - Numeric value to go with the scheduled task frequency. Default is the value of
- `node['chef_client']['task']['start_time']` - The start time for the task in `HH:mm` format. If the `frequency` is `minute` default start time will be `Time.now` plus the `frequency_modifier` number of minutes.
- `node['chef_client']['task']['user']` - The user the scheduled task will run as, defaults to `'SYSTEM'`.
- `node['chef_client']['task']['password']` - The password for the user the scheduled task will run as, defaults to `nil` because the default user, `'SYSTEM'`, does not need a password.

The following attributes are set on a per-platform basis, see the `attributes/default.rb` file for default values.
- `node['chef_client']['init_style']` - Sets up the client service based on the style of init system to use. Default is based on platform and falls back to `'none'`. See [service recipes](#service-recipes).
- `node['chef_client']['run_path']` - Directory location where chef-client should write the PID file. Default based on platform, falls back to "/var/run".
- `node['chef_client']['cache_path']` - Directory location for
- `Chef::Config[:file_cache_path]` where chef-client will cache various files. Default is based on platform, falls back to "/var/chef/cache".
- `node['chef_client']['backup_path']` - Directory location for `Chef::Config[:file_backup_path]` where chef-client will backup templates and cookbook files. Default is based on platform, falls back to "/var/chef/backup".
- `node['chef_client']['launchd_mode']` - (Only for Mac OS X) if set to `'daemon'`, runs chef-client with `-d` and `-s` options; defaults to `'interval'`.
- When `chef_client['log_file']` is set and running on a [logrotate](http://ckbk.it/logrotate) supported platform (debian, rhel, fedora family), use the following attributes to tune log rotation.
{'fraction_non_alphanumeric': 0.13530079455164587, 'fraction_numerical': 0.011048051456678018, 'mean_word_length': 4.879003558718861, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6754342', 'n_tokens_mistral': 4105, 'n_tokens_neox': 3908, 'n_words': 1529}