From 265fd1bb73070cdd526003fe1fab931612c47e38 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 15 Feb 2023 10:19:29 +0100 Subject: [PATCH] copr/base: override rsyslog logrotate config Copy-paste the stuff others use in this repository. While on it, assure logrotate is installed on copr boxes, and install the packages by a single 'package' statement. --- roles/copr/base/files/syslog-logrotate | 20 ++++++++++++ roles/copr/base/tasks/main.yml | 44 ++++++++++++-------------- 2 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 roles/copr/base/files/syslog-logrotate diff --git a/roles/copr/base/files/syslog-logrotate b/roles/copr/base/files/syslog-logrotate new file mode 100644 index 0000000000..7028290a18 --- /dev/null +++ b/roles/copr/base/files/syslog-logrotate @@ -0,0 +1,20 @@ +/var/log/cron +/var/log/maillog +/var/log/messages +/var/log/secure +/var/log/spooler +{ + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + endscript + daily + rotate 7 + missingok + ifempty + compress + compresscmd /usr/bin/xz + uncompresscmd /usr/bin/xz + compressext .xz + dateext +} diff --git a/roles/copr/base/tasks/main.yml b/roles/copr/base/tasks/main.yml index 9475a8ad90..dedee4869c 100644 --- a/roles/copr/base/tasks/main.yml +++ b/roles/copr/base/tasks/main.yml @@ -41,8 +41,20 @@ copy: src=sysconfig.crond dest=/etc/sysconfig/crond notify: restart crond -- name: install anacrontab - package: name=cronie-anacron state=present +- name: install base copr packages + package: + name: + - acl # useful for ansible acl module + - bash-completion + - cronie-anacron + - ethtool + - golang-github-prometheus-node-exporter + - rsyslog-logrotate + - screen + - tmux + state: present + tags: + packages - name: configure anacrond to not send mails to root user lineinfile: dest=/etc/anacrontab @@ -52,35 +64,21 @@ regexp="^MAILTO" notify: restart crond -- name: install copr-selinux - dnf: state=latest pkg=copr-selinux +- name: override the default syslog logrotate file + copy: src=syslog-logrotate dest=/etc/logrotate.d/syslog tags: - - packages + - logrotate -- name: install node_exporter - dnf: state=present pkg=golang-github-prometheus-node-exporter +- name: install copr-selinux + package: + state: latest + name: copr-selinux tags: - packages - name: restart node exporter service: state=started enabled=yes name=node_exporter -- name: install dev helper packages - dnf: - state: present - pkg: - - acl # useful for ansible acl module - - "bash-completion" - - "screen" - - "tmux" - tags: - - packages - -- name: install ethtool - dnf: state=present pkg=ethtool - tags: - - packages - - name: check offloading shell: "ethtool -k eth0 | egrep -q 'tcp-segmentation-offload: on|generic-receive-offload: on|generic-segmentation-offload: on'" register: offloading