From 84e05f39fd35700a4309a32bc3be8d5e8a3025de Mon Sep 17 00:00:00 2001 From: Jason Field Date: Sat, 20 Jul 2019 19:30:13 +0100 Subject: [PATCH 1/6] Circleci testing --- .circleci/config.yml | 40 +++++++++- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE.md | 20 ----- .github/PULL_REQUEST_TEMPLATE.md | 12 --- .github/lock.yml | 24 +----- .mdlrc | 1 + CHANGELOG.md | 28 +++---- README.md | 95 ++++++++++++----------- .kitchen.dokken.yml => kitchen.dokken.yml | 0 .kitchen.yml => kitchen.yml | 0 10 files changed, 103 insertions(+), 118 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 rename .kitchen.dokken.yml => kitchen.dokken.yml (100%) rename .kitchen.yml => kitchen.yml (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7eb945c..bbd4da6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,45 @@ -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/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/README.md b/README.md index b6a484e..2f904c7 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": { @@ -183,20 +184,20 @@ above. To do so, create them as hashes within: or ```node['nxlog']['papertrails']``` -The name attribute should be the hash key for the object, and all attributes +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 @@ -216,7 +217,7 @@ end **json**: -``` +```ruby { "nxlog": { "sources": { @@ -247,11 +248,12 @@ 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: +* 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 log data needs to be transformed by a method such as `to_syslog_ietf()` @@ -259,7 +261,7 @@ end '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 | | ------------------ | ---------------------------------------------------------------- | ------- | ------------------- | @@ -280,7 +282,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i '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 | | ------------------ | -------------------------------------------- | ------- | ------------------- | @@ -292,7 +294,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 +302,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 +310,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 | | -------------- | --------------------------------------------------- | ------- | ------------ | @@ -321,7 +323,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i **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 +334,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 +351,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,7 +365,7 @@ 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 | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -385,7 +387,7 @@ 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 | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -399,7 +401,7 @@ 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 | | ---------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -412,7 +414,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i '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. -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 | | ---------------| ---------------------------------------------------------------- | ------- | ------------------ | @@ -425,13 +427,13 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#i ### 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 @@ -451,7 +453,7 @@ end **json**: -``` +```json { "nxlog": { "destinations": { @@ -478,7 +480,6 @@ 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 @@ -491,7 +492,7 @@ end '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 | | ------------------ | ------------------------------------------------------------------- | ------- | -------------------- | @@ -504,7 +505,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,7 +513,7 @@ 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 | | ---------------| ----------------------------------------------------------- | ------ | ------------------- | @@ -529,7 +530,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o '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 | | ---------------| -------------------------------------------- | ------ | ------------------- | @@ -544,7 +545,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o '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 | | ----------------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -564,7 +565,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,7 +576,7 @@ 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 | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -594,7 +595,7 @@ 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 | | ----------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -605,7 +606,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o '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 | | ---------------| ---------------------------------------------------------------- | ------- | ------------------- | @@ -618,7 +619,7 @@ http://nxlog.org/documentation/nxlog-community-edition-reference-manual-v20928#o '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. -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 +628,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 @@ -648,7 +649,7 @@ end **json**: -``` +```json { "nxlog": { "sources": { @@ -675,7 +676,7 @@ end ## 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 +687,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 | diff --git a/.kitchen.dokken.yml b/kitchen.dokken.yml similarity index 100% rename from .kitchen.dokken.yml rename to kitchen.dokken.yml diff --git a/.kitchen.yml b/kitchen.yml similarity index 100% rename from .kitchen.yml rename to kitchen.yml From 13ed0e87ccca74cf378c09b1058d0554090687c7 Mon Sep 17 00:00:00 2001 From: Jason Field Date: Sat, 20 Jul 2019 19:33:31 +0100 Subject: [PATCH 2/6] Fixes --- .rubocop.yml | 1 + Rakefile | 1 - kitchen.dokken.yml | 1 + kitchen.yml | 5 +++-- 4 files changed, 5 insertions(+), 3 deletions(-) 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/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 index 809b93b..c3b91ce 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,3 +1,4 @@ +--- driver: name: dokken privileged: true diff --git a/kitchen.yml b/kitchen.yml index 51d5ff9..29b3ab7 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -3,7 +3,8 @@ driver: name: vagrant <% if ENV['TEAMCITY'] == '1' %> synced_folders: - - ['.junit', '/.junit'] + - '.junit' + - '/.junit' <% end %> driver_config: @@ -45,7 +46,7 @@ suites: run_list: - recipe[test::kitchen_log_file] attributes: - + - name: attribute_resources_linux run_list: - recipe[test::kitchen_log_file_attrs] From 0d802cc21da72d6afe33433ca02f332dceedef58 Mon Sep 17 00:00:00 2001 From: Jason Field Date: Sat, 20 Jul 2019 19:35:50 +0100 Subject: [PATCH 3/6] Linting --- kitchen.dokken.yml | 3 ++- kitchen.yml | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index c3b91ce..31251f1 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -8,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 index 29b3ab7..c3c94dd 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -1,11 +1,6 @@ --- driver: name: vagrant -<% if ENV['TEAMCITY'] == '1' %> - synced_folders: - - '.junit' - - '/.junit' -<% end %> driver_config: customize: From 07366ba4b2295ecb619e28be097007dbfca8abdc Mon Sep 17 00:00:00 2001 From: Jason Field Date: Sat, 20 Jul 2019 19:37:38 +0100 Subject: [PATCH 4/6] Lint fixes --- kitchen.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kitchen.yml b/kitchen.yml index c3c94dd..8ba6a41 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -17,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 From 37f1b3474b287322fd4bedf9d75dbd623f7c1e81 Mon Sep 17 00:00:00 2001 From: Xorima <4923914+Xorima@users.noreply.github.com> Date: Mon, 22 Jul 2019 20:18:40 +0100 Subject: [PATCH 5/6] Update config.yml force rerun --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bbd4da6..2ba76d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,6 @@ workflows: context: Danger - kitchen/delivery: name: delivery - - kitchen/dokken-single: name: lwrp-resources suite: lwrp-resources From 7d2a3a75a1c10d1b2a7f7e158996151ede2bede9 Mon Sep 17 00:00:00 2001 From: Jason Field Date: Wed, 31 Jul 2019 08:36:22 +0100 Subject: [PATCH 6/6] readme fixes --- CONTRIBUTING.md | 21 ++++++++ README.md | 136 ++++++++++++++++++++++++------------------------ 2 files changed, 89 insertions(+), 68 deletions(-) create mode 100644 CONTRIBUTING.md 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 2f904c7..d4fba41 100644 --- a/README.md +++ b/README.md @@ -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 @@ -179,10 +179,20 @@ 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']``` + +```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 @@ -211,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**: -```ruby +```json { "nxlog": { "sources": { @@ -229,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 @@ -247,14 +257,14 @@ 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 @@ -265,18 +275,18 @@ end | 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 @@ -286,7 +296,7 @@ end | 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 | @@ -321,7 +331,7 @@ end '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) @@ -370,7 +380,7 @@ is encrypted. | 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 | @@ -392,7 +402,7 @@ to all addresses. | 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 @@ -406,13 +416,13 @@ to all addresses. | 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) @@ -422,7 +432,7 @@ will read from `/dev/log` if the *uds* attribute is not specified. **Notes:** -* Only SOCK_DGRAM type sockets are currently supported by nxlog +- Only SOCK_DGRAM type sockets are currently supported by nxlog ### nxlog_destination @@ -447,9 +457,9 @@ 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**: @@ -465,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 @@ -482,10 +492,10 @@ end **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 @@ -496,7 +506,7 @@ end | 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 | @@ -517,14 +527,14 @@ end | 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 @@ -534,12 +544,12 @@ end | 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 @@ -549,7 +559,7 @@ end | 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 | @@ -580,8 +590,8 @@ is encrypted. | 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 | @@ -599,8 +609,8 @@ is encrypted. | 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 @@ -610,14 +620,14 @@ is encrypted. | 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) @@ -643,9 +653,9 @@ 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**: @@ -661,15 +671,15 @@ 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 | @@ -695,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)