ansible-roles/evolinux-base/tasks/log2mail.yml
Jérémy Lecour 1728eaee68
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
Revert "Add “when: not ansible_check_mode” to allow more --check"
This reverts commit fafff25c20.
This reverts commit e64471c5a8084f95a8e6f955d3fa918c55b8e846.
2022-12-14 07:41:18 +01:00

36 lines
822 B
YAML

---
- name: Deploy log2mail systemd unit
copy:
src: log2mail.service
dest: /etc/systemd/system/log2mail.service
mode: "0644"
- name: Remove log2mail sysvinit service
file:
path: /etc/init.d/log2mail
state: absent
- name: Enable and start log2mail service
systemd:
name: log2mail
daemon-reload: yes
state: started
enabled: yes
- name: log2mail config is present
blockinfile:
dest: /etc/log2mail/config/default
owner: log2mail
group: adm
mode: "0640"
marker: "# {mark} ANSIBLE MANAGED RULES FOR DEFAULT INSTANCE"
block: |
file = /var/log/syslog
pattern = "Out of memory: Kill"
mailto = {{ log2mail_alert_email or general_alert_email | mandatory }}
template = /etc/log2mail/mail
notify: restart log2mail
tags:
- log2mail