Merge branch 'master' into monitoring_pdu
commit
a8af3c9c72
@ -1,2 +1,7 @@
|
||||
skip_list:
|
||||
- '301'
|
||||
|
||||
warn_list:
|
||||
- '305' # Use shell only when shell functionality is required
|
||||
- '503' # Tasks that run when changed should likely be handlers
|
||||
- experimental # all rules tagged as experimental
|
||||
|
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env ansible-playbook
|
||||
---
|
||||
# Playbook to run ONLY the logrotate role
|
||||
# Install logrotate
|
||||
- hosts: all,!unifi,!pve
|
||||
roles:
|
||||
- logrotate
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Reload nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
|
||||
- name: Generate certificates
|
||||
command: "certbot certonly --non-interactive --config /etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: reload logrotate
|
||||
service:
|
||||
name: logrotate
|
||||
state: reloaded
|
@ -0,0 +1,29 @@
|
||||
---
|
||||
# Install and configure logrotate
|
||||
|
||||
# Install the apt package
|
||||
- name: Install logrotate
|
||||
apt:
|
||||
name:
|
||||
- logrotate
|
||||
|
||||
# Copy the configuration and reload the service if it has changed
|
||||
- name: Configure logrotate
|
||||
template:
|
||||
src: logrotate.d/rsyslog.j2
|
||||
dest: /etc/logrotate.d/rsyslog
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
notify: reload logrotate
|
||||
|
||||
# Make sure the service is enabled and started
|
||||
- name: Enable logrotate service
|
||||
service:
|
||||
name: logrotate
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
# Enforce new logrotate rules now
|
||||
- name: Run logrotate now
|
||||
command: /usr/sbin/logrotate -f /etc/logrotate.d/rsyslog
|
@ -0,0 +1,39 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
/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 1
|
||||
daily
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
sharedscripts
|
||||
postrotate
|
||||
/usr/lib/rsyslog/rsyslog-rotate
|
||||
endscript
|
||||
}
|
Loading…
Reference in New Issue