Use multiple logcheck ignore files
This commit is contained in:
parent
1de4e1ddd1
commit
4ebf9a4e14
@ -5,6 +5,6 @@ argument_specs:
|
|||||||
ansible_hostname:
|
ansible_hostname:
|
||||||
type: "str"
|
type: "str"
|
||||||
required: true
|
required: true
|
||||||
system_base_logs_ignore_file:
|
system_base_logs_ignore_dir:
|
||||||
type: "str"
|
type: "str"
|
||||||
required: false
|
required: false
|
||||||
|
@ -11,9 +11,21 @@
|
|||||||
dest: "/etc/logcheck/logcheck.conf"
|
dest: "/etc/logcheck/logcheck.conf"
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
|
||||||
- name: "logs : configure logcheck ignores"
|
- block:
|
||||||
ansible.builtin.copy:
|
|
||||||
src: "{{ system_base_logs_ignore_file }}"
|
- name: "identify logcheck ignore files"
|
||||||
dest: "/etc/logcheck/ignore.d.server/{{ ansible_hostname }}"
|
local_action: stat path="{{ system_base_logs_ignore_dir }}/{{ item }}"
|
||||||
group: "logcheck"
|
register: system_base_logs_ignore_files_stat
|
||||||
mode: 0644
|
loop: "{{ [ansible_hostname, 'all'] | union(group_names) }}"
|
||||||
|
|
||||||
|
- name: "configure logcheck ignores"
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ system_base_logs_ignore_dir }}/{{ item }}"
|
||||||
|
dest: "/etc/logcheck/ignore.d.server/{{ item }}"
|
||||||
|
group: "logcheck"
|
||||||
|
mode: 0644
|
||||||
|
loop: "{{ system_base_logs_ignore_files_stat.results | selectattr('stat.exists') |
|
||||||
|
map(attribute='item') }}"
|
||||||
|
|
||||||
|
when:
|
||||||
|
system_base_logs_ignore_dir is defined
|
||||||
|
Loading…
Reference in New Issue
Block a user