- block:

  - name: Install auditd
    apt:
      name: auditd
      install_recommends: no
      cache_valid_time: "{{ apt_cache_valid_time }}"

  - name: Configure auditd
    copy:
      src: "{{ item.src }}"
      dest: "{{ item.dest }}"
      owner: root
      group: root
      mode: "{{ item.mode }}"
    with_items:
      - { src: auditd, dest: /etc/default/auditd, mode: "0644" }
      - { src: auditd.conf, dest: /etc/audit/auditd.conf, mode: "0640" }
      - { src: kill_signals.rules, dest: /etc/audit/rules.d/kill_signals.rules, mode: "0644" }
    notify: Restart auditd

  - name: Make audit.log readable
    file:
      path: /var/log/audit.log
      owner: root
      group: root
      mode: "0640"
      state: touch
    notify: Restart auditd

  become: yes
