diff --git a/ubuntu-deb-general/defaults/main.yml b/ubuntu-deb-general/defaults/main.yml index 0d06e094..47c76cb1 100644 --- a/ubuntu-deb-general/defaults/main.yml +++ b/ubuntu-deb-general/defaults/main.yml @@ -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 diff --git a/ubuntu-deb-general/tasks/rsyslogfix.yml b/ubuntu-deb-general/tasks/rsyslogfix.yml index 7202091d..7b8d2636 100644 --- a/ubuntu-deb-general/tasks/rsyslogfix.yml +++ b/ubuntu-deb-general/tasks/rsyslogfix.yml @@ -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 + diff --git a/ubuntu-deb-general/templates/10-custom_rules.conf.j2 b/ubuntu-deb-general/templates/10-custom_rules.conf.j2 new file mode 100644 index 00000000..fc2672f2 --- /dev/null +++ b/ubuntu-deb-general/templates/10-custom_rules.conf.j2 @@ -0,0 +1,6 @@ +{% if default_rsyslog_custom_rules is defined %} +{% for entry in default_rsyslog_custom_rules %} +{{ entry }} +{% endfor %} +{% endif %} +