logrotate: template statt blockinfile (#39)
Merge branch 'master' into logrotate cv4 rasdaemon musterrolle rechte restic sanoid Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#39 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
parent
c0ef189607
commit
0c016ea2b7
11 changed files with 76 additions and 93 deletions
|
@ -50,24 +50,11 @@
|
|||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: Add Log to be Rotated
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/logrotate.d/cv4pve-autosnap
|
||||
state: present
|
||||
create: yes
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_cv4pve
|
||||
dest: /etc/logrotate.d/cv4pve-autosnap
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
block: |
|
||||
/var/log/cv4pve-autosnap.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
||||
|
|
11
roles/mgrote.cv4pve-autosnap/templates/logrotate_cv4pve
Normal file
11
roles/mgrote.cv4pve-autosnap/templates/logrotate_cv4pve
Normal file
|
@ -0,0 +1,11 @@
|
|||
/var/log/cv4pve-autosnap.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
- name: Install rasdaemon
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
|
@ -27,27 +28,14 @@
|
|||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: Add rasdaemon Log to be Rotated
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/logrotate.d/rasdaemon
|
||||
state: present
|
||||
create: yes
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_rasdaemon
|
||||
dest: /etc/logrotate.d/rasdaemon
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
block: |
|
||||
/var/log/rasdaemon.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
||||
|
||||
- name: rasdaemon-cron kopieren
|
||||
become: yes
|
||||
|
|
11
roles/mgrote.ecc-rasdaemon/templates/logrotate_rasdaemon
Normal file
11
roles/mgrote.ecc-rasdaemon/templates/logrotate_rasdaemon
Normal file
|
@ -0,0 +1,11 @@
|
|||
/var/log/rasdaemon.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
|
@ -32,27 +32,14 @@
|
|||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: Add restic Log to be Rotated
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/logrotate.d/restic
|
||||
state: present
|
||||
create: yes
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_chrony
|
||||
dest: /etc/logrotate.d/chrony
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
block: |
|
||||
/var/log/restic.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
mode: 0755
|
||||
notify: restart_chrony
|
||||
|
||||
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_chrony
|
||||
dest: /etc/logrotate.d/chrony
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Create chrony driftfile folder
|
||||
become: yes
|
||||
|
|
|
@ -29,13 +29,14 @@
|
|||
mode: 0755
|
||||
notify: restart_chrony
|
||||
|
||||
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_chrony
|
||||
dest: /etc/logrotate.d/chrony
|
||||
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: Create chrony driftfile folder
|
||||
become: yes
|
||||
file:
|
||||
|
|
|
@ -76,24 +76,11 @@
|
|||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: Add restic Log to be Rotated
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/logrotate.d/restic
|
||||
state: present
|
||||
create: yes
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_restic
|
||||
dest: /etc/logrotate.d/restic
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
block: |
|
||||
/var/log/restic.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
||||
|
|
11
roles/mgrote.restic/templates/logrotate_restic
Normal file
11
roles/mgrote.restic/templates/logrotate_restic
Normal file
|
@ -0,0 +1,11 @@
|
|||
/var/log/restic.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
|
@ -63,27 +63,14 @@
|
|||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: Add Sanoid Log to be Rotated
|
||||
become: true
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/logrotate.d/sanoid
|
||||
state: present
|
||||
create: yes
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_sanoid
|
||||
dest: /etc/logrotate.d/sanoid
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
block: |
|
||||
/var/log/sanoid-cron.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
||||
|
||||
- name: Generate Sanoid Cron Scripts
|
||||
become: true
|
||||
|
|
11
roles/mgrote.zfs_sanoid/templates/logrotate_sanoid
Normal file
11
roles/mgrote.zfs_sanoid/templates/logrotate_sanoid
Normal file
|
@ -0,0 +1,11 @@
|
|||
/var/log/sanoid-cron.log {
|
||||
su root root
|
||||
create 0640 root root
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateyesterday
|
||||
}
|
Loading…
Reference in a new issue