From f05c001b578897544333727d399675dd2e49b737 Mon Sep 17 00:00:00 2001 From: mg Date: Wed, 21 Jul 2021 10:53:38 +0200 Subject: [PATCH] Housekeeping (#169) Housekeeping Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/169 Co-Authored-By: mg Co-Committed-By: mg --- group_vars/acng.yml | 2 -- playbooks/3_service/pihole.yml | 2 +- playbooks/on-off/repair_syslog.yml | 11 +++++++++ playbooks/on-off/rsyslog_template | 37 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 playbooks/on-off/repair_syslog.yml create mode 100644 playbooks/on-off/rsyslog_template diff --git a/group_vars/acng.yml b/group_vars/acng.yml index a7b540b2..d8105299 100644 --- a/group_vars/acng.yml +++ b/group_vars/acng.yml @@ -24,8 +24,6 @@ munin_node_additional_plugins: - name: chrony src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/chrony - - name: lvm_ - src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/lvm_ - name: systemd_status src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/systemd_status - name: acng diff --git a/playbooks/3_service/pihole.yml b/playbooks/3_service/pihole.yml index 685235b0..0ec923f9 100644 --- a/playbooks/3_service/pihole.yml +++ b/playbooks/3_service/pihole.yml @@ -10,7 +10,7 @@ create: yes backrefs: false mode: 0664 - - name: Setze DNS-Resolver fuer pihole-* + - name: Setze VIRTUAL_HOST für homer ansible.builtin.blockinfile: path: /etc/lighttpd/external.conf block: | diff --git a/playbooks/on-off/repair_syslog.yml b/playbooks/on-off/repair_syslog.yml new file mode 100644 index 00000000..6f5fd6b3 --- /dev/null +++ b/playbooks/on-off/repair_syslog.yml @@ -0,0 +1,11 @@ +--- +- hosts: all:!proxmox + become: yes + serial: 5 + + tasks: + - name: wirte logrotate config rsyslog + become: yes + template: + src: rsyslog_template + dest: /etc/logrotate.d/rsyslog diff --git a/playbooks/on-off/rsyslog_template b/playbooks/on-off/rsyslog_template new file mode 100644 index 00000000..54b753f8 --- /dev/null +++ b/playbooks/on-off/rsyslog_template @@ -0,0 +1,37 @@ +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /usr/lib/rsyslog/rsyslog-rotate + endscript +}