Skip to content

Commit

Permalink
Merge pull request #2 from gabops/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Gabriel Suarez authored Jul 3, 2019
2 parents 9299f54 + 711ab49 commit cd4695c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
- TEST_DISTRO: amazonlinux:2017.09
- TEST_DISTRO: amazonlinux:2017.12
- TEST_DISTRO: amazonlinux:2018.03
- TEST_DISTRO: amazonlinux:2
- TEST_DISTRO: debian:9
- TEST_DISTRO: ubuntu:18.04

Expand Down
83 changes: 40 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ gabops.papertrail
[![Build Status](https://travis-ci.org/gabops/ansible-role-papertrail.svg?branch=master)](https://travis-ci.org/gabops/ansible-role-papertrail)

Installs and configure papertrail using remote_syslog2 (see
[Papertrail official documentation](https://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-text-log-files-in-unix/).
[Papertrail official documentation](https://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-text-log-files-in-unix/)
and [remote_syslog2 Github repo](https://github.com/papertrail/remote_syslog2)

Requirements
Expand All @@ -14,45 +14,42 @@ None
Role Variables
--------------

| Variable | Default value | Description |
| :--- | :--- | :--- |
| papertrail_version | "0.20" | Version to install. 0.20 is the latest at the moment |
| papertrail_config_file_path | /etc/papertrail_conf.yml | Name of the configuration file for remote_syslog |
| papertrail_service_enabled | true | Configure remote_syslog for starting when the system is booted |
| papertrail_service_started | true | The role will start the service after applying the configuration |
| papertrail_managed_conf_file | true | If disabled, no configuration will be applied (None of the following variables will be used). Just the installation so far |
| papertrail_custom_hostname | "" | By default remote_syslog2 uses the hostname of the node. This can be this can be overwritten here |
| papertrail_destination_host | "" | The papertrail destination host to send the logs to. Check your papertrail account for it. |
| papertrail_destination_port | "" | The papertrail destination port to connect to the destination host. Check your papertrail account for it. |
| papertrail_destination_protocol | tls | This value can be tls(encrypted) or tcp (unencrypted) |
| papertrail_log_facility | "" | The syslog facility to use. See [syslog facility](https://en.wikipedia.org/wiki/Syslog#Facility) |
| papertrail_log_severity | "" | The syslog severity to use. See [syslog severity](https://en.wikipedia.org/wiki/Syslog#Severity_level) |
| papertrail_new_file_check_interval | "" | If a glob pattern for logs files is used this parameter controls the frecuency of checking for new log files in the directory |
| papertrail_files_to_log | [] | The file or globs to read. See examples. |
| papertrail_files_to_exclude | [] | Files to exclude in a directory. See examples |
| papertrail_exclude_patterns | [] | The pattern in the log file you are reading you want to ignore. |

For more detailed information about remote_syslog2 configuration see https://github.com/papertrail/remote_syslog2/blob/master/README.md

---
This role uses internally the next variables (see vars/):

For every os:
- `papertrail_download_url`: "https://github.com/papertrail/remote_syslog2/releases/download/v{{ papertrail_version }}"
- `papertrail_executable`: /usr/local/bin/remote_syslog
- `papertrail_systemd_unit_path`: /etc/systemd/system
- `papertrail_sysvinit_script_path`: /etc/init.d
- `papertrail_pid_directory`: /var/run
- `papertrail_service_name`: remote_syslog

RedHat os family:
- `papertrail_package_name`: "remote_syslog2-{{ papertrail_version }}-1.{{ ansible_architecture }}.rpm"

Debian os family:
- `papertrail_package_name`: "remote-syslog2_{{ papertrail_version }}_{{ installer_arch }}.deb"

> Usually you will not need to modify never any of the previous values but just in case I added the possibility of overwriting them for covering unexpected scenarios.
*Role defaults:*

| Variable | Value | Description |
| :--- | :--- | :--- |
| papertrail_version | "0.20" | Version to install. 0.20 is the latest at the moment |
| papertrail_config_file_path | /etc/papertrail_conf.yml | Name of the configuration file for remote_syslog |
| papertrail_service_enabled | true | Configure remote_syslog for starting when the system is booted |
| papertrail_service_started | true | The role will start the service after applying the configuration |
| papertrail_managed_conf_file | true | If disabled, no configuration will be applied (None of the following variables will be used). Just the installation so far |
| papertrail_custom_hostname | "" | By default remote_syslog2 uses the hostname of the node. This can be this can be overwritten here |
| papertrail_destination_host | "" | The papertrail destination host to send the logs to. Check your papertrail account for it |
| papertrail_destination_port | "" | The papertrail destination port to connect to the destination host. Check your papertrail account for it |
| papertrail_destination_protocol | tls | This value can be tls(encrypted) or tcp (unencrypted) |
| papertrail_log_facility | "" | The syslog facility to use. See https://en.wikipedia.org/wiki/Syslog#Facility |
| papertrail_log_severity | "" | The syslog severity to use. See https://en.wikipedia.org/wiki/Syslog#Severity_level |
| papertrail_new_file_check_interval | "" | If a glob pattern for logs files is used this parameter controls the frecuency of checking for new log files in the directory |
| papertrail_files_to_log | [] | The file or globs to read |
| papertrail_files_to_exclude | [] | Files to exclude in a directory |
| papertrail_exclude_patterns | [] | The pattern in the log file you are reading you want to ignore. |

> For more detailed information about remote_syslog2 configuration see https://github.com/papertrail/remote_syslog2/blob/master/README.md
*Role vars:*

Usually you will not need to modify never any of the next values when calling the role but just in case, apart of defining them I've added also the possibility of overwriting them for covering unexpected scenarios

| Variable | Value | Description |
| :--- | :--- | :--- |
| papertrail_download_url | "https://github.com/papertrail/remote_syslog2/releases/download/v{{ papertrail_version }}" | The url pointing to the remote_syslog2 version |
| papertrail_executable | /usr/local/bin/remote_syslog | The binary that the package installs |
| papertrail_systemd_unit_path | /etc/systemd/system | The path where store the systemd unit file is stored |
| papertrail_sysvinit_script_path | /etc/init.d | The path where the sysvinit script file is stored |
| papertrail_pid_directory | /var/run | The directory where the pid file is stored |
| papertrail_service_name | remote_syslog | The service name used for the remote_syslog2 process |
| papertrail_package_name | "remote_syslog2-{{ papertrail_version }}-1.{{ ansible_architecture }}.rpm" | The package name for RedHat based os |
| papertrail_package_name | "remote-syslog2_{{ papertrail_version }}_{{ installer_arch }}.deb" | The package name for Debian based os |

Dependencies
------------
Expand Down Expand Up @@ -81,15 +78,15 @@ Example Playbook
papertrail_log_facility: local7
papertrail_log_severity: warn
roles:
- { role: papertrail }
- role: papertrail
```
License
-------
MIT
[MIT](./LICENSE)
Author Information
------------------
Gabriel Suarez (gabops)
Gabriel Suarez ([Gabops](https://github.com/gabops/))
6 changes: 4 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
galaxy_info:
role_name: papertrail
author: Gabriel Suarez
description: Installs and configures papertrail remote_syslog2
description: Installs and configure papertrail using remote_syslog2
license: MIT
min_ansible_version: 2.0
platforms:
Expand All @@ -15,6 +15,7 @@ galaxy_info:
- 2017.03
- 2017.09
- 2017.12
- Candidate
- name: Debian
versions:
- stretch
Expand All @@ -23,8 +24,9 @@ galaxy_info:
- bionic
galaxy_tags:
- monitoring
- logging
- system
- logging
- logs
- amazonlinux
- papertrail
- centos
Expand Down

0 comments on commit cd4695c

Please sign in to comment.