common/tasks/syslog/config.yaml
2026-03-02 16:45:57 +01:00

47 lines
1.4 KiB
YAML

---
# manage syslog
- name: "manage syslog"
tags: "syslog"
block:
# configure rsyslogd - debian
- name: "syslog - config - rsyslog - debian"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.debian.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Debian"'
notify: "restart rsyslog"
# configure rsyslogd - ubuntu
- name: "syslog - config - rsyslog - ubuntu"
ansible.builtin.template:
src: "templates/syslog/rsyslog/rsyslog.ubuntu.conf.j2"
dest: "/etc/rsyslog.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_distribution == "Ubuntu"'
notify: "restart rsyslog"
# configure rsyslogd - apt
- name: "syslog - config - apt"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/apt.conf.j2"
dest: "/etc/rsyslog.d/apt.conf"
owner: "root"
group: "root"
mode: "0644"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"
# configure rsyslogd
- name: "syslog - config - remote-logging"
ansible.builtin.template:
src: "templates/syslog/rsyslog.d/remote-logging.conf"
path: "/etc/rsyslog.d/remote-logging.conf"
when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog"