library/isti_vars/isti-global.yml: rsyslog customizations.

library/roles/ubuntu-deb-general: add a task that installs rsyslog custom rules.
This commit is contained in:
Andrea Dell'Amico 2016-10-13 19:59:54 +02:00
parent 2c1ee770b2
commit b446c20fb5
3 changed files with 20 additions and 8 deletions

View File

@ -110,6 +110,9 @@ default_security_limits:
- { domain: 'root', l_item: 'nofile', type: 'soft', value: '8192' }
- { domain: 'root', l_item: 'nofile', type: 'hard', value: '8192' }
# default_rsyslog_custom_rules:
# - ':msg, contains, "icmp6_send: no reply to icmp error" ~'
# - ':msg, contains, "[PYTHON] Can\'t call the metric handler function for" ~'
#
# debian/ubuntu distributions controllers

View File

@ -4,17 +4,20 @@
when:
- is_precise and ansible_kernel != "3.2.0-4-amd64"
- is_not_trusty
notify:
Restart rsyslog
tags:
- rsyslog
notify: Restart rsyslog
tags: rsyslog
- name: Enable the kernel logger on ubuntu 12.04 and kernel major version >= 3
lineinfile: dest=/etc/rsyslog.conf line="$ModLoad imklog" insertafter="^#$ModLoad imklog" backup=yes
when:
- is_precise and ansible_kernel == "3.2.0-4-amd64"
- is_trusty
notify:
Restart rsyslog
tags:
- rsyslog
notify: Restart rsyslog
tags: rsyslog
- name: Install custom rsyslog rules
template: src=10-custom_rules.conf.j2 dest=/etc/rsyslog.d/10-custom_rules.conf owner=root group=root mode=0444
when: default_rsyslog_custom_rules is defined
notify: Restart rsyslog
tags: rsyslog

View File

@ -0,0 +1,6 @@
{% if default_rsyslog_custom_rules is defined %}
{% for entry in default_rsyslog_custom_rules %}
{{ entry }}
{% endfor %}
{% endif %}