robertdebock.logwatch

Ansible Role Logwatch

This guide explains how to install and set up logwatch on your system.

GitHub GitLab Downloads Version
github gitlab downloads Version

Example Playbook

Here’s a sample playbook from molecule/default/converge.yml. It is tested with every change made to the code.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.logwatch

Before running the playbook, your machine should be prepared. In Continuous Integration (CI), this is managed using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.core_dependencies
    - role: robertdebock.postfix
      postfix_relayhost: "[relay.example.com]"
      postfix_myhostname: "smtp.example.com"
      postfix_mydomain: "example.com"
      postfix_myorigin: "example.com"
      postfix_aliases:
        - name: root
          destination: [email protected]

For more detailed guidance, check out a full explanation and example on using these roles.

Role Variables

The default settings for the variables are found in defaults/main.yml:

---
# defaults file for logwatch

logwatch_mailto: root
logwatch_mailfrom: Logwatch

# The time range for the report, either "all", "today" or "yesterday".
logwatch_range: yesterday

# The detail level for the report, either "Low", "Med" or "High" or a number
# ranging from 0 to 10.
logwatch_detail: Low

# A name of a defined service in "/usr/share/logwatch/scripts/services/" or
# "All".
logwatch_service: All

Requirements

You need to install the pip packages listed in requirements.txt.

State of Used Roles

The following roles are used to prepare the system. You can choose different methods to prepare:

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.core_dependencies Build Status GitHub Build Status GitLab
robertdebock.postfix Build Status GitHub Build Status GitLab

Context

This role works with many other compatible roles. For more details, check out the documentation of these roles.

Here’s a visual overview of related roles: dependencies

Compatibility

This role has been tested with the following container images:

container tags
EL 9
Debian all
Fedora all
Ubuntu all

The minimum Ansible version required is 2.12, and tests are done for:

  • The prior version.
  • The current version.
  • The development version.

If you encounter any issues, please report them on GitHub.

License

This project is licensed under Apache-2.0.

Author Information

Created by robertdebock.

If you enjoy this work, please consider sponsoring me.

Informazioni sul progetto

Install and configure logwatch on your system.

Installa
ansible-galaxy install robertdebock.logwatch
Licenza
apache-2.0
Download
807
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.