From 91c0f8cef689c79dea7616cb26829d508557956f Mon Sep 17 00:00:00 2001 From: Xorima <4923914+Xorima@users.noreply.github.com> Date: Fri, 2 Aug 2019 16:01:59 +0100 Subject: [PATCH] Circleci testing (#14) * Circleci testing * Fixes * Linting * Lint fixes * Update config.yml force rerun * readme fixes --- .circleci/config.yml | 39 +++- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE.md | 20 -- .github/PULL_REQUEST_TEMPLATE.md | 12 -- .github/lock.yml | 24 +-- .mdlrc | 1 + .rubocop.yml | 1 + CHANGELOG.md | 28 +-- CONTRIBUTING.md | 21 ++ README.md | 221 +++++++++++----------- Rakefile | 1 - .kitchen.dokken.yml => kitchen.dokken.yml | 4 +- .kitchen.yml => kitchen.yml | 14 +- 13 files changed, 195 insertions(+), 192 deletions(-) create mode 100644 .github/CODEOWNERS delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .mdlrc create mode 100644 CONTRIBUTING.md rename .kitchen.dokken.yml => kitchen.dokken.yml (92%) rename .kitchen.yml => kitchen.yml (92%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7eb945c..2ba76d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,44 @@ -version: 2.1 +--- +lint_and_unit: &lint_and_unit + - delivery + - danger + - lint-yaml + - lint-markdown +version: 2.1 orbs: - kitchen: sous-chefs/kitchen@1.0.0 + kitchen: sous-chefs/kitchen@2 workflows: kitchen: jobs: + # Lint and Unit Test + - kitchen/yamllint: + name: lint-yaml + - kitchen/mdlint: + name: lint-markdown - kitchen/danger: name: danger context: Danger - - kitchen/lint: - name: lint + - kitchen/delivery: + name: delivery + - kitchen/dokken-single: + name: lwrp-resources + suite: lwrp-resources + requires: + *lint_and_unit + - kitchen/dokken-single: + name: attribute-resources + suite: attribute-resources + requires: + *lint_and_unit + - kitchen/dokken-single: + name: syslog + suite: syslog + requires: + *lint_and_unit + - kitchen/dokken-single: + name: papertrail + suite: papertrail + requires: + *lint_and_unit diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..78424c2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* sous-chefs/sc-nxlog diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 651e753..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,20 +0,0 @@ -### Cookbook version -[Version of the cookbook where you are encountering the issue] - -### Chef-client version -[Version of chef-client in your environment] - -### Platform Details -[Operating system distribution and release version. Cloud provider if running in the cloud] - -### Scenario: -[What you are trying to achieve and you can't?] - -### Steps to Reproduce: -[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?] - -### Expected Result: -[What are you expecting to happen as the consequence of above reproduction steps?] - -### Actual Result: -[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index af09b2e..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,12 +0,0 @@ -## Description - -[Describe what this change achieves] - -### Issues Resolved - -[List any existing issues this PR resolves] - -### Check List -- [ ] All tests pass. See https://github.com/sous-chefs/apache2/blob/master/TESTING.md -- [ ] New functionality includes testing. -- [ ] New functionality has been documented in the README if applicable diff --git a/.github/lock.yml b/.github/lock.yml index 9703715..b0262d4 100644 --- a/.github/lock.yml +++ b/.github/lock.yml @@ -1,28 +1,8 @@ -# Configuration for lock-threads - https://github.com/dessant/lock-threads - -# Number of days of inactivity before a closed issue or pull request is locked -daysUntilLock: 365 - -# Issues and pull requests with these labels will not be locked. Set to `[]` to disable +--- +daysUntilLock: 30 exemptLabels: [] - -# Label to add before locking, such as `outdated`. Set to `false` to disable lockLabel: false - -# Comment to post before locking. Set to `false` to disable lockComment: > This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. - -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings just for `issues` or `pulls` -# issues: -# exemptLabels: -# - help-wanted -# lockLabel: outdated - -# pulls: -# daysUntilLock: 30 diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..ebeef65 --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +rules "~MD013", "~MD024" diff --git a/.rubocop.yml b/.rubocop.yml index 6562000..d88ffa9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,4 @@ +--- AllCops: Exclude: - 'Dangerfile' diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d3243..35cdac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,53 +1,55 @@ -# 0.8.7 +# Changelog + +## 0.8.7 * Prevent installation of package config from .deb packages -# 0.8.6 +## 0.8.6 * Update nokogiri gem due to security alert -# 0.8.5 +## 0.8.5 * Point nxlog base URL at mirror, as nxlog keep taking down old versions and breaking the cookbook * Add cookbook attribute to allow different base URLs -# 0.8.4 +## 0.8.4 * Nxlog version bump * Fix integration tests for Chef 12.5 -# 0.8.3 +## 0.8.3 * Added json extension module -# 0.8.2 +## 0.8.2 * Added checksum validation to nxlog remote_file packages -# 0.8.1 +## 0.8.1 * Remove input_type equal_to validation -# 0.8.0 +## 0.8.0 * Add syslog recipe -# 0.7.2 +## 0.7.2 * Add support for the FlowControl directive in input modules -# 0.7.1 +## 0.7.1 * Update documentation to link to github page, as it looks better than on the supermarket -# 0.7.0 +## 0.7.0 * Add support for creating log resources from node attributes -# 0.6.0 +## 0.6.0 * Fix issue with LWRPs not working in other recipes -# 0.5.0 +## 0.5.0 * Initial release of nxlog cookbook diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b7d9630 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +# Contributing + +## Branches + +### `master` branch + +The master branch is the current committed changes. These changes may not yet be released although we try to release often. + +## Tags + +All releases are tagged in git. To see the releases available to you see the changelog or the tags directly. + +## Pull requests + +- + +## Issues + +Need to report an issue? Use the github issues: + +- diff --git a/README.md b/README.md index b6a484e..d4fba41 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ service that can receive logs from multiple servers and display them all in once You may also create nxlog resources via node attributes, which saves you from having to write a recipe for each one. -It is worth reading the [NXLog documentation](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928) +It is worth reading the [NXLog documentation](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928) to get a better idea of how this stuff works. You will also need a download mirror to store the installation packages, as the NXLog website does not allow unattended @@ -44,9 +44,9 @@ downloads and may block your IP address if you try! The original author of this ## Supported Platforms - * Windows Server 2012r2-2016 (2008r2 did work, but is no longer tested) - * Ubuntu/Debian Linux - * RHEL/Centos Linux +- Windows Server 2012r2-2016 (2008r2 did work, but is no longer tested) +- Ubuntu/Debian Linux +- RHEL/Centos Linux This cookbook supports Chef 12 through 14 @@ -54,7 +54,7 @@ This cookbook supports Chef 12 through 14 Include `nxlog` in your node's `run_list`: -``` +```ruby { "run_list": [ "recipe[nxlog::default]" @@ -64,7 +64,7 @@ Include `nxlog` in your node's `run_list`: If you wish to enable Papertrail support, also include the papertrail recipe: -``` +```ruby { "run_list": [ "recipe[nxlog::default]" @@ -75,7 +75,7 @@ If you wish to enable Papertrail support, also include the papertrail recipe: To set up nxlog as the sytem logger you should include the syslog recipe: -``` +```ruby { "run_list": [ "recipe[nxlog::default]" @@ -84,7 +84,7 @@ To set up nxlog as the sytem logger you should include the syslog recipe: } ``` -The syslog recipe will disable rsyslog. If you are expecting another logging +The syslog recipe will disable rsyslog. If you are expecting another logging daemon you should specify this in node attributes. The default behaviour is to send its log output to the default destinations, but this can be reconfigured in node attributes. @@ -109,7 +109,8 @@ end ``` This can also be accomplished using node attributes as follows: -``` + +```ruby { "nxlog": { "destinations": { @@ -150,7 +151,7 @@ end Again, this can be accomplished using node attributes: -``` +```ruby { "nxlog": { "papertrails": { @@ -178,25 +179,35 @@ The following describes each LWRP provided by this cookbook. It is also possible to create the resources using node attributes as described above. To do so, create them as hashes within: -```node['nxlog']['sources']``` -```node['nxlog']['destinations']``` + +```ruby +node['nxlog']['sources'] +``` + +```ruby +node['nxlog']['destinations'] +``` + or -```node['nxlog']['papertrails']``` -The name attribute should be the hash key for the object, and all attributes +```ruby +node['nxlog']['papertrails'] +``` + +The name attribute should be the hash key for the object, and all attributes supported by the relevant LWRP are supported as name/value pairs inside the object. See above for examples. ### nxlog_source -`nxlog_source` defines a source of log data which will be sent to one or more +`nxlog_source` defines a source of log data which will be sent to one or more the defined log destinations. NXLog has many different input modules that enable log data to be read from a variety of log sources. The default is to read from a file, but any supported module can be selected using the `input_module` attribute. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_input +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_input](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_input) #### Syntax @@ -210,13 +221,13 @@ nxlog_source "name" do end ``` -* `name` is a unique name for the log resource -* `attributes` define how the log source should be configured -* `action` should be either :create, or :delete *\[default: :create\]* +- `name` is a unique name for the log resource +- `attributes` define how the log source should be configured +- `action` should be either :create, or :delete *\[default: :create\]* **json**: -``` +```json { "nxlog": { "sources": { @@ -228,9 +239,9 @@ end } ``` -* `name` is a unique name for the log resource -* `attributes` define how the log source should be configured -* `action` is always :create and should not be specified +- `name` is a unique name for the log resource +- `attributes` define how the log source should be configured +- `action` is always :create and should not be specified #### nxlog_source attributes @@ -246,45 +257,46 @@ end **Notes:** -* input_module must be one of the modules defined below -* to send log data to specific log destinations in addition to the defaults, - include `:defaults` in the destination array. For example: +- input_module must be one of the modules defined below +- to send log data to specific log destinations in addition to the defaults, include `:defaults` in the destination array. For example: + ```ruby destination ['my_special_destination', :defaults] ``` -* it is worth reading the documentation on `Exec` in the nxlog docs. Quite often + +- it is worth reading the documentation on `Exec` in the nxlog docs. Quite often log data needs to be transformed by a method such as `to_syslog_ietf()` ##### 'im_file' module 'im_file' defines a file-based log source -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_file +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_file](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_file) | Attribute name | Description | Type | Default | | ------------------ | ---------------------------------------------------------------- | ------- | ------------------- | -| file | The file to read log data from | String | none - **Required** | +| file | The file to read log data from | String | none - **Required*- | | recursive | Whether to recurse into subdirectories | boolean | false | | rename_check | Check whether files are renamed (e.g. logrotate) | boolean | false | | close_when_idle | Whether to close the file when not being read | boolean | false | | poll_interval | How often to check for new data | float | 1.0 | -| dir_check_interval | How often to check for new files when `file` contains a wildcard | float | 2 * `poll_interval` | +| dir_check_interval | How often to check for new files when `file` contains a wildcard | float | 2 - `poll_interval` | | active_files | Maximum number of files to monitor simultaneously | integer | 10 | | save_pos | Whether to save the file position when nxlog exits | boolean | true | **Notes:** -* `recursive` works in a way that you might not expect. Read the nxlog docs if you plan to use it. +- `recursive` works in a way that you might not expect. Read the nxlog docs if you plan to use it. ##### 'im_exec' module 'im_exec' executes a command and reads log data from stdout -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_exec +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_exec](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_exec) | Attribute name | Description | Type | Default | | ------------------ | -------------------------------------------- | ------- | ------------------- | -| command | The command to execute | String | none - **Required** | +| command | The command to execute | String | none - **Required*- | | args | An array of arguments to pass to the command | Array | none | | restart | Whether to restart the command on exit | boolean | false | @@ -292,7 +304,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i 'im_internal' specifies nxlog's internal logs -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_internal +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_internal](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_internal) *There are no module-specific attributes for this module.* @@ -300,7 +312,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i 'im_kernel' defines the kernel logs on Linux systems (e.g. `dmesg`) -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_kernel +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_kernel](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_kernel) *There are no module-specific attributes for this module.* @@ -308,7 +320,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i 'im_mark' periodically writes a specific string to the destination(s) -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mark +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mark](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mark) | Attribute name | Description | Type | Default | | -------------- | --------------------------------------------------- | ------- | ------------ | @@ -319,9 +331,9 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i 'im_mseventlog' reads from the Windows XP (Server 2003) event log. -**NOTE:** For modern Windows (Vista and above) use 'im_msvistalog' +**NOTE:*- For modern Windows (Vista and above) use 'im_msvistalog' -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mseventlog +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mseventlog](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_mseventlog) | Attribute name | Description | Type | Default | | -------------- | ---------------------------------------| ------- | ------------------ | @@ -332,11 +344,11 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i 'im_msvistalog' reads from the Windows (post-XP / Server 2003) event log. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_msvistalog +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_msvistalog](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_msvistalog) You may also want to read: -https://technet.microsoft.com/en-us/library/cc722404.aspx +[https://technet.microsoft.com/en-us/library/cc722404.aspx](https://technet.microsoft.com/en-us/library/cc722404.aspx) | Attribute name | Description | Type | Default | | -------------- | --------------------------------------------------- | ------- | ------------------ | @@ -349,7 +361,7 @@ https://technet.microsoft.com/en-us/library/cc722404.aspx 'im_null' never generates any messages. However, commands can be executed with the `exec` common attribute. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_null +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_null](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_null) *There are no module-specific attributes for this module.* @@ -363,12 +375,12 @@ to all addresses. This module works identically to the im_tcp module, except that the connection is encrypted. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_ssl +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_ssl](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_ssl) | Attribute name | Description | Type | Default | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | | host | The ip or hostname to listen on | String | 'localhost' | -| port | The tcp port to listen on | Integer | none - **Required** | +| port | The tcp port to listen on | Integer | none - **Required*- | | cert_file | Path to the https certificate file | String | none | | cert_key_file | Path to the https certificate key file | String | none | | key_pass | Password for the certificate key file | String | none | @@ -385,12 +397,12 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i Default behaviour is to listen on 'localhost', but you can use '0.0.0.0' to bind to all addresses. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_tcp +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_tcp](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_tcp) | Attribute name | Description | Type | Default | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | | host | The ip or hostname to listen on | String | 'localhost' | -| port | The tcp port to listen on | Integer | none - **Required** | +| port | The tcp port to listen on | Integer | none - **Required*- | ##### 'im_udp' module @@ -399,20 +411,20 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i Default behaviour is to listen on 'localhost', but you can use '0.0.0.0' to bind to all addresses. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_udp +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_udp](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_udp) | Attribute name | Description | Type | Default | | ---------------| ---------------------------------------------------------------- | ------- | ------------------- | | host | The host to listen on | String | 'localhost' | -| port | The udp port to connect to | Integer | none - **Required** | +| port | The udp port to connect to | Integer | none - **Required*- | | sock_buf_size | Sets the socket buffer size | Integer | OS defaults | ##### 'im_uds' module 'im_uds' messages are read from a unix domain socket, such as `/dev/log`. This module -will read from `/dev/log` if the *uds* attribute is not specified. +will read from `/dev/log` if the *uds- attribute is not specified. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_uds +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_uds](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#im_uds) | Attribute name | Description | Type | Default | | ---------------| ---------------------------------------------------------------- | ------- | ------------------ | @@ -420,18 +432,18 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i **Notes:** -* Only SOCK_DGRAM type sockets are currently supported by nxlog +- Only SOCK_DGRAM type sockets are currently supported by nxlog ### nxlog_destination `nxlog_destination` defines a destination where log data from one or more -sources will be sent. +sources will be sent. NXLog has many different output modules that enable log data to be sent to a variety of log sources. The default is to read from a file, but any supported module can be selected using the `output_module` attribute. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_output +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_output](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#modules_output) #### Syntax @@ -445,13 +457,13 @@ nxlog_destination "name" do end ``` -* `name` is a unique name for the destination resource -* `attributes` define how the log destination should be configured -* `action` should be either :create, or :delete *\[default: :create\]* +- `name` is a unique name for the destination resource +- `attributes` define how the log destination should be configured +- `action` should be either :create, or :delete *\[default: :create\]* **json**: -``` +```json { "nxlog": { "destinations": { @@ -463,9 +475,9 @@ end } ``` -* `name` is a unique name for the destination resource -* `attributes` define how the log destination should be configured -* `action` is always :create and should not be specified +- `name` is a unique name for the destination resource +- `attributes` define how the log destination should be configured +- `action` is always :create and should not be specified #### nxlog_destination attributes @@ -478,24 +490,23 @@ end | exec | commands to execute on the log data | String | none | | default | whether the destination is a default destination | boolean | false | - **Notes:** -* output_module must be one of the modules defined below -* it is worth reading the documentation on `Exec` in the nxlog docs. Quite often +- output_module must be one of the modules defined below +- it is worth reading the documentation on `Exec` in the nxlog docs. Quite often log data needs to be transformed by a method such as `to_syslog_ietf()` -* destinations marked as default will receive log data from all input sources, +- destinations marked as default will receive log data from all input sources, unless they specifically specify otherwise ##### 'om_file' module 'om_file' defines a file-based log destination -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_file +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_file](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_file) | Attribute name | Description | Type | Default | | ------------------ | ------------------------------------------------------------------- | ------- | -------------------- | -| file | The file to write log data to | String | none - **Required** | +| file | The file to write log data to | String | none - **Required*- | | create_dir | Whether to create a directory for the log file if it does not exist | boolean | false | | truncate | Whether to truncate the log file before writing | boolean | false | | sync | Whether to sync the log file after each message, flushing buffers | boolean | false | @@ -504,7 +515,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o 'om_blocker' is a testing output module which simply blocks, simulation an blocked route. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_blocker +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_blocker](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_blocker) *There are no module-specific attributes for this module.* @@ -512,43 +523,43 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o 'om_dbi' writes log data to a database -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_dbi +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_dbi](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_dbi) | Attribute name | Description | Type | Default | | ---------------| ----------------------------------------------------------- | ------ | ------------------- | -| driver | The dbi driver to use | String | none - **Required** | -| sql | The SQL to execute to insert the log data | String | none - **Required** | -| options | Engine-specific options such as host, username and password | Array | none - **Required** | +| driver | The dbi driver to use | String | none - **Required*- | +| sql | The SQL to execute to insert the log data | String | none - **Required*- | +| options | Engine-specific options such as host, username and password | Array | none - **Required*- | **Notes:** -* Requires libdbi the relevant libdbi driver to be installed -* See the nxlog docs for details on how to format SQL and options +- Requires libdbi the relevant libdbi driver to be installed +- See the nxlog docs for details on how to format SQL and options ##### 'om_exec' module 'om_exec' executes a command and pipes log data into it -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_exec +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_exec](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_exec) | Attribute name | Description | Type | Default | | ---------------| -------------------------------------------- | ------ | ------------------- | -| command | The command to execute | String | none - **Required** | +| command | The command to execute | String | none - **Required*- | | args | An array of arguments to pass to the command | Array | none | **Notes:** -* The command is executed when nxlog starts, and must not terminate until it shuts down +- The command is executed when nxlog starts, and must not terminate until it shuts down ##### 'om_http' module 'om_http' posts log data to a specific url over http or https -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_http +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_http](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_http) | Attribute name | Description | Type | Default | | ----------------------| ---------------------------------------------------------------- | ------- | ------------------- | -| url | The url to post the data to | String | none - **Required** | +| url | The url to post the data to | String | none - **Required*- | | content-type | The content-type header of the http request | String | 'text/plain' | | https_cert_file | Path to the https certificate file | String | none | | https_cert_key_file | Path to the https certificate key file | String | none | @@ -564,7 +575,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o 'om_null' messages are discarded and never written anywhere. However, commands can be executed on the log data with the `exec` common attribute. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_null +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_null](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_null) *There are no module-specific attributes for this module.* @@ -575,12 +586,12 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o This module works identically to the om_tcp module, except that the connection is encrypted. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_ssl +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_ssl](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_ssl) | Attribute name | Description | Type | Default | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | -| host | The host to connect to | String | none - **Required** | -| port | The tcp port to connect to | Integer | none - **Required** | +| host | The host to connect to | String | none - **Required*- | +| port | The tcp port to connect to | Integer | none - **Required*- | | cert_file | Path to the https certificate file | String | none | | cert_key_file | Path to the https certificate key file | String | none | | key_pass | Password for the certificate key file | String | none | @@ -594,31 +605,31 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o 'om_tcp' messages are sent over a TCP connection. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_tcp +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_tcp](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_tcp) | Attribute name | Description | Type | Default | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | -| host | The host to connect to | String | none - **Required** | -| port | The tcp port to connect to | Integer | none - **Required** | +| host | The host to connect to | String | none - **Required*- | +| port | The tcp port to connect to | Integer | none - **Required*- | ##### 'om_udp' module 'om_udp' messages are sent over a UDP connection. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_udp +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_udp](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_udp) | Attribute name | Description | Type | Default | | ---------------| ---------------------------------------------------------------- | ------- | ------------------- | -| host | The host to connect to | String | none - **Required** | -| port | The udp port to connect to | Integer | none - **Required** | +| host | The host to connect to | String | none - **Required*- | +| port | The udp port to connect to | Integer | none - **Required*- | | sock_buf_size | Sets the socket buffer size | Integer | OS defaults | ##### 'om_uds' module 'om_uds' messages are written to a unix domain socket, such as `/dev/log`. This module -will write to `/dev/log` if the *uds* attribute is not specified. +will write to `/dev/log` if the *uds- attribute is not specified. -http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_uds +[http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_uds](http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#om_uds) | Attribute name | Description | Type | Default | | ---------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -627,7 +638,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o ### nxlog_papertrail `nxlog_papertrail` defines a special kind of om_ssl destination that is pre-configured -to log to papertrail (https://papertrailapp.com/) and thus requiring only a few options +to log to [papertrail](https://papertrailapp.com/) and thus requiring only a few options to set up. #### Syntax @@ -642,13 +653,13 @@ nxlog_papertrail "name" do end ``` -* `name` is a unique name for the papertrail resource -* `attributes` define how the papertrail log destination should be configured -* `action` should be either :create, or :delete *\[default: :create\]* +- `name` is a unique name for the papertrail resource +- `attributes` define how the papertrail log destination should be configured +- `action` should be either :create, or :delete *\[default: :create\]* **json**: -``` +```json { "nxlog": { "sources": { @@ -660,22 +671,22 @@ end } ``` -* `name` is a unique name for the papertrail resource -* `attributes` define how the papertrail log destination should be configured -* `action` is always :create and should not be specified +- `name` is a unique name for the papertrail resource +- `attributes` define how the papertrail log destination should be configured +- `action` is always :create and should not be specified #### nxlog_papertrail attributes | Attribute name | Description | Type | Default | | ---------------| ----------------------------------------------------------------- | ------- | ------------------- | -| port | The port for your papertrail log destination | String | none - **Required** | +| port | The port for your papertrail log destination | String | none - **Required*- | | host | The \*.papertrailapp.com host to log to (e.g. 'logs', 'logs2') | String | 'logs' | | default | Whether this is a default log destination (see nxlog_destination) | boolean | false | ## Cookbook Attributes The attributes mostly concern default config locations and will most likely work -for your platform without modification. +for your platform without modification. | Key | Description | Default | | ------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------ | @@ -686,7 +697,7 @@ for your platform without modification. | conf_dir | The directory for the nxlog configuration files | platform-specific | | log_file | The location of the nxlog log file | platform-specific | | checksums::\ | The sha256sum of the specified package | nxlog version-specific | -| package_source | The base URL for downloading nxlog packages | https://mirror.widgit.com/nxlog | +| package_source | The base URL for downloading nxlog packages | | | papertrail::bundle_url | The URL to the papertrail CA bundle | [papertrail-bundle.pem](https://papertrailapp.com/tools/papertrail-bundle.pem) | | syslog::logger_disable | The logger service to disable in favour of nxlog | 'rsyslog' | | syslog::destinations | The destinations to log syslog data to | :defaults | @@ -694,16 +705,6 @@ for your platform without modification. | destinations | An array of log destination objects | nil | | papertrails | An array of papertrail log destination objects | nil | -## Contributing - -You know the drill: - -1. Fork -2. Branch -3. Change -4. Test -5. Pull request - ## Contributors This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false) diff --git a/Rakefile b/Rakefile index 3fa98e6..96d939e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ - Dir.glob(File.join('lib', 'tasks', '**/*.rb')).each do |file| require_relative file end diff --git a/.kitchen.dokken.yml b/kitchen.dokken.yml similarity index 92% rename from .kitchen.dokken.yml rename to kitchen.dokken.yml index 809b93b..31251f1 100644 --- a/.kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,3 +1,4 @@ +--- driver: name: dokken privileged: true @@ -7,7 +8,8 @@ transport: name: dokken verifier: - root_path: '/opt/verifier' # required because we're not using InSpec + # required because we're not using InSpec + root_path: '/opt/verifier' provisioner: name: dokken diff --git a/.kitchen.yml b/kitchen.yml similarity index 92% rename from .kitchen.yml rename to kitchen.yml index 51d5ff9..8ba6a41 100644 --- a/.kitchen.yml +++ b/kitchen.yml @@ -1,10 +1,6 @@ --- driver: name: vagrant -<% if ENV['TEAMCITY'] == '1' %> - synced_folders: - - ['.junit', '/.junit'] -<% end %> driver_config: customize: @@ -21,16 +17,16 @@ verifier: platforms: - name: ubuntu-14.04 run_list: - - recipe[apt::default] + - recipe[apt::default] - name: debian-8 run_list: - - recipe[apt::default] + - recipe[apt::default] - name: centos-6.6 run_list: - - recipe[yum::default] + - recipe[yum::default] - name: centos-7 run_list: - - recipe[yum::default] + - recipe[yum::default] - name: windows-2016 driver: box: tas50/windows_2016 @@ -45,7 +41,7 @@ suites: run_list: - recipe[test::kitchen_log_file] attributes: - + - name: attribute_resources_linux run_list: - recipe[test::kitchen_log_file_attrs]