]> git.phdru.name Git - ansible.git/commitdiff
Feat: Truncate Linux logs monthly
authorOleg Broytman <phd@phdru.name>
Tue, 2 Jul 2019 13:10:12 +0000 (16:10 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 16 Jul 2019 18:28:36 +0000 (21:28 +0300)
Add monthly-truncate-logs.yml playbook.

playbooks/monthly-truncate-logs.yml [new file with mode: 0644]

diff --git a/playbooks/monthly-truncate-logs.yml b/playbooks/monthly-truncate-logs.yml
new file mode 100644 (file)
index 0000000..ad80bfe
--- /dev/null
@@ -0,0 +1,7 @@
+- name: Truncate Linux logs monthly
+  hosts: "{{ hosts | default('all') }}"
+  gather_facts: false
+  tasks:
+    - name: Truncate mail logs
+      copy: dst="{{ item }}" content='' force=yes
+      loop: ['mail/procmail.log', 'mail/sent-mail']