{"id":13583840,"url":"https://github.com/robertdebock/ansible-role-rsyslog","last_synced_at":"2026-02-04T12:13:04.336Z","repository":{"id":27862157,"uuid":"115393489","full_name":"robertdebock/ansible-role-rsyslog","owner":"robertdebock","description":"Install and configure rsyslog on your system.","archived":false,"fork":false,"pushed_at":"2025-03-06T16:18:31.000Z","size":327,"stargazers_count":37,"open_issues_count":15,"forks_count":42,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T08:12:10.147Z","etag":null,"topics":["ansible","installer","molecule","monitoring","package","playbook","rsyslog","tox"],"latest_commit_sha":null,"homepage":"https://robertdebock.nl/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"robertdebock"}},"created_at":"2017-12-26T06:37:24.000Z","updated_at":"2025-03-06T16:04:04.000Z","dependencies_parsed_at":"2023-02-15T08:31:31.058Z","dependency_job_id":"37bda2f0-d87e-42cd-bb06-0604d5b815f2","html_url":"https://github.com/robertdebock/ansible-role-rsyslog","commit_stats":{"total_commits":434,"total_committers":15,"mean_commits":"28.933333333333334","dds":"0.14746543778801846","last_synced_commit":"107b87e6f864d6b358867106eeaef357d09f26cb"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-rsyslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-rsyslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-rsyslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-rsyslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/ansible-role-rsyslog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247633921,"owners_count":20970417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","installer","molecule","monitoring","package","playbook","rsyslog","tox"],"created_at":"2024-08-01T15:03:50.501Z","updated_at":"2026-02-04T12:13:04.331Z","avatar_url":"https://github.com/robertdebock.png","language":"Jinja","funding_links":["https://github.com/sponsors/robertdebock"],"categories":["Jinja"],"sub_categories":[],"readme":"# [Ansible role rsyslog](#ansible-role-rsyslog)\n\nInstall and configure rsyslog on your system.\n\n|GitHub|GitLab|Downloads|Version|\n|------|------|---------|-------|\n|[![github](https://github.com/robertdebock/ansible-role-rsyslog/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-rsyslog/actions)|[![gitlab](https://gitlab.com/robertdebock-iac/ansible-role-rsyslog/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-rsyslog)|[![downloads](https://img.shields.io/ansible/role/d/robertdebock/rsyslog)](https://galaxy.ansible.com/robertdebock/rsyslog)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-rsyslog.svg)](https://github.com/robertdebock/ansible-role-rsyslog/releases/)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/robertdebock/ansible-role-rsyslog/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n  gather_facts: true\n\n  roles:\n    - role: robertdebock.rsyslog\n      rsyslog_mods:\n        - imuxsock\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/robertdebock/ansible-role-rsyslog/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: true\n  gather_facts: false\n\n  roles:\n    - role: robertdebock.bootstrap\n\n  # In CI, rsyslog does not send sd_notify(READY=1) in time.\n  # Override to Type=simple so systemd considers the service started\n  # when the process is up and does not wait for READY.\n  tasks:\n    - name: Create systemd drop-in directory for rsyslog.service\n      ansible.builtin.file:\n        path: /etc/systemd/system/rsyslog.service.d\n        state: directory\n        mode: \"0755\"\n\n    - name: Set rsyslog.service Type=simple so systemd does not wait for READY\n      ansible.builtin.copy:\n        dest: /etc/systemd/system/rsyslog.service.d/type-simple.conf\n        content: |\n          [Service]\n          Type=simple\n        mode: \"0644\"\n\n    - name: Reload systemd after rsyslog drop-in\n      ansible.builtin.systemd:\n        daemon_reload: true\n```\n\nAlso see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/robertdebock/ansible-role-rsyslog/blob/master/defaults/main.yml):\n\n```yaml\n---\n# defaults file for rsyslog\n\n# To configure a server to receive logs, set rsyslog_receiver to yes.\nrsyslog_receiver: false\n\n# To forward logs to a remote server, add items to the rsyslog_remotes list.\n# Each item should be a map like the following:\nrsyslog_remotes:\n  - selector: '*.*'\n    hostname: logging.server.net\n    port: 514  # (optional, default 514)\n    tcp: true  # (optional, default true)\n    # extra_params: 'KeepAlive=\"on\"'\n\n# If rsyslog_remotes is set, optional template name for the forward action.\n# Leave empty or unset to use the default format.\nrsyslog_remote_template: \"\"\n\n# Additional parameters to pass to the omfwd action in advanced\n# configuration mode. This value is appended as-is to the action()\n# definition, so it should contain valid omfwd options, for example:\n#   StreamDriver=\"gtls\" StreamDriverMode=\"1\" StreamDriverAuthMode=\"x509/certvalid\"\n# Leave empty to not add any extra parameters.\nrsyslog_remote_extra_params: \"\"\n\n# Set the mode for new directories; only available in legacy template.\nrsyslog_dircreatemode: \"0700\"\n\n# Set the mode for new files; only available in legacy template.\nrsyslog_filecreatemode: \"0644\"\n\n# Security: owner and group for rsyslog config files and directory (CIS recommends root).\nrsyslog_config_owner: root\nrsyslog_config_group: root\n\n# Security: mode for rsyslog config files (CIS recommends 0600).\nrsyslog_config_mode: \"0600\"\n\n# Security: mode for rsyslog config directory /etc/rsyslog.d/.\nrsyslog_config_dir_mode: \"0755\"\n\n# Set the mods enabled. An empty list is valid for receiver-only setups where no\n# input modules (imuxsock, imjournal, imklog, immark, imfile) are needed.\nrsyslog_mods:\n  - imuxsock\n  - imjournal\n\n# Configure rsyslog minimally (may be in conflict with custom configuration files)\nrsyslog_deploy_default_config: true\n\n# Default rsyslogd rules\nrsyslog_default_rules:\n  - { rule: '*.info;mail.none;authpriv.none;cron.none', logpath: '/var/log/messages' }\n  - { rule: 'authpriv.*', logpath: '/var/log/secure' }\n  - { rule: 'mail.*', logpath: '-/var/log/maillog' }\n  - { rule: 'cron.*', logpath: '/var/log/cron' }\n  - { rule: '*.emerg', logpath: ':omusrmsg:*' }\n  - { rule: 'uucp,news.crit', logpath: '/var/log/spooler' }\n  - { rule: 'local7.*', logpath: '/var/log/boot.log' }\n\n# Use the (obsolete) legacy, pre-v6 configuration file format, or the more\n# modern # 'advanced' configuration file format available in v6 and up. The\n# default is to use the 'legacy' format to not change config files for\n# existing users of this role out of the blue.\n# More information on the different formats on the rsyslog website:\n# https://www.rsyslog.com/doc/v8-stable/configuration/conf_formats.html\nrsyslog_config_file_format: legacy\n\n# The rule conf to name to add to /etc/rsyslog.d/ when rsyslog_remote is set.\nrsyslog_forward_rule_name: forwarding\n\n# Configure the rsyslog package to be `present`, or set to `latest` to install\n# the latest available version.\nrsyslog_package_state: present\n\n# if set to false (legacy default to remain compatible to sysklogd), the domain\n# part from a name that is within the same domain as the receiving system is\n# stripped. If set to on, full names are always used.\nrsyslog_preservefqdn: false\n\n# Configure additional config files in /etc/rsyslog.d\n# Example:\n# rsyslog_rsyslog_d_files:\n#   - name: 000-splunk\n#     state: present\n#     validate: true\n#     content: |\n#       auth,authpriv.* action(type=\"omfwd\"\n#                              target=\"splunk\"\n#                              port=\"514\"\n#                              protocol=\"tcp\")\nrsyslog_rsyslog_d_files: []\n\n# Avoid sd_journal_get_cursor() failed: Cannot assign requested address messages\n# due to logrotate\nrsyslog_workaroundjournalbug: false\n\n# Turns off message reception via local log socket\nrsyslog_imuxsock_syssock: false\n\n# Install additional rsyslog packages\n# Example for installing rsyslog-elastisearch:\n# rsyslog_features:\n#   - gnutls\n#   - elastisearch\nrsyslog_features: []\n\n# Default destination of rsyslog config file\nrsyslog_dest_conf_file: \"/etc/rsyslog.conf\"\n\n# Enable / Disable option OmitLocalLogging\nrsyslog_omit_local_logging: true\n\n# Allow using the traditional file format.\nrsyslog_traditional_file_format: true\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-rsyslog/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub | GitLab |\n|-------------|--------|--------|\n|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap)|\n\n## [Context](#context)\n\nThis role is part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.\n\nHere is an overview of related roles:\n![dependencies](https://raw.githubusercontent.com/robertdebock/ansible-role-rsyslog/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/robertdebock):\n\n|container|tags|\n|---------|----|\n|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9|\n|[Debian](https://hub.docker.com/r/robertdebock/debian)|all|\n|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|all|\n|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|all|\n\nThe minimum version of Ansible required is 2.12, tests have been done on:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them on [GitHub](https://github.com/robertdebock/ansible-role-rsyslog/issues).\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/robertdebock/ansible-role-rsyslog/blob/master/LICENSE).\n\n## [Author Information](#author-information)\n\n[robertdebock](https://robertdebock.nl/)\n\nPlease consider [sponsoring me](https://github.com/sponsors/robertdebock).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-rsyslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fansible-role-rsyslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-rsyslog/lists"}