metno.rsyslog
rsyslog
Redirect all logs to one or more log servers. Choose between UDP or TCP, defaults to UDP. Will drop all logs lower than EMERG/PANIC if connection is interrupted and queue gets full.
Important! Sends logs unencrypted to remote syslog server.
Version
3.0.0--- Add Unsible-core 2.16. Removed support for Ubuntu xenial and bionic2.2.0--- Support Ubuntu 24.042.1.1--- Allow Fedora CoreOS 392.1.0--- Initial support for Fedora CoreOS, but with no tests2.0.1--- bug fix, ansible-lint2.0.0--- updated ansible to 2.12.91.5.0--- add RHEL9 and CentOS Stream 8 support1.4.0--- add jammy support; remove centos8 support1.3.0--- add rhel8 support; remove trusty and centos6 support1.2.0--- remove ubuntu precise from testing1.1.1--- fix lint warnings1.1.0--- added ubuntu focal, 20.041.0.6--- tested with Ansible 2.9.111.0.5--- prepare for github1.0.4--- bugfix, error when running in check mode1.0.3--- install rsyslog even in check mode1.0.2--- bugfix, allow running Ansible in check mode1.0.1--- fixed missing default1.0.0--- initial rolemaster--- latest development version
Requirements
This role is limited to
- Ubuntu 24.04 - Noble
- Ubuntu 22.04 - Jammy
- Ubuntu 20.04 - Focal
- CentOS 7
- CentOS Stream 8
- RHEL 8
- RHEL 9
- Fedora CoreOS 38
- Fedora CoreOS 39
Role Variables
rsyslog_journald_size---1Grsyslog_config--- list of dicts configuring syslog servers - see below for dictionary keywords, default[]type--- syslog type - defaults to forward, defaultomfwdresume_retry_count--- number of retries before loosing data, default-1queue_type--- which kind of queue to use, defaultLinkedListqueue_size--- max size of the queue, default10000queue_save_on_shutdown--- save state of queue on shutdown, defaulttruetarget_ip--- destination syslog server, requiredtarget_port--- destination syslog port, default514target_protocol--- protocol to use when talking to syslog server, defaultudp
Dependencies
The RHEL8 image needs to be registered with RedHat to install packages.
Example Playbook
- hosts: servers
roles:
- role: rsyslog
rsyslog_config:
- target_ip: 10.100.10.10
target_protocol: udp
queue.discardseverity=”8”)
Testing
NOTICE: Fedora CoreOS is tested manually, but currently no automatic tests are added for FCOS.
To test RHEL8 with vagrant, install vagrant-register
vagrant plugin install vagrant-registration
Test environment for all OSes
cd tests
vagrant up
Log into the syslog server and look at the logs.
vagrant ssh syslog
cd /var/log
find
Rerun role
Run role on all OSes again.
vagrant provision
Debug interactively
This uses cluster ssh to work with all vagrant boxes at the same time.
vagrant ssh-config > ~/.ssh/config
cat ~/.ssh/config | grep ^Host | cut -d\ -f2 | xargs cssh
License
GPLv2
Author Information
Created 2020 by IT Infrastructure at MET Norway
Contactpoint: IT Infrastructure Basis Team
set vim: spell spelllang=en:
Install
ansible-galaxy install metno.rsyslogLicense
gpl-2.0
Downloads
218
Owner
MET Norway is the meteorological service for military and civil services as well as the general public in Norway.
