]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/logcheck/tasks/main.yml
Feat: Combine Debian/RedHat playbooks and roles
[ansible.git] / playbooks / roles / logcheck / tasks / main.yml
diff --git a/playbooks/roles/logcheck/tasks/main.yml b/playbooks/roles/logcheck/tasks/main.yml
new file mode 100644 (file)
index 0000000..a303e5a
--- /dev/null
@@ -0,0 +1,38 @@
+- name: Install logcheck
+  become: true
+  apt:
+    autoclean: yes
+    autoremove: yes
+    cache_valid_time: 3600
+    install_recommends: no
+    name: logcheck
+    state: latest
+    update_cache: yes
+  when: ansible_facts.os_family == 'Debian'
+
+- name: Install logcheck
+  become: true
+  dnf:
+    name: logcheck
+    state: latest
+    update_cache: yes
+  when: ansible_facts.os_family == 'RedHat'
+
+- name: Configure logcheck
+  become: true
+  lineinfile:
+    path: /etc/logcheck/logcheck.conf
+    regexp: "^INTRO=0$"
+    line: "INTRO=0"
+    insertafter: "^#INTRO=1$"
+
+- name: Update logcheck ignore patterns
+  become: true
+  copy:
+    src: ignore.d/
+    dest: "/etc/logcheck/ignore.d.{{ item }}"
+    owner: root
+    group: logcheck
+    directory_mode: '0750'
+    mode: 0640
+  loop: ['server', 'workstation']