# platform = multi_platform_all
# reboot = false
# strategy = configure
# complexity = low
# disruption = low




- name: "Configure AIDE To Notify Personnel if Baseline Configurations Are Altered"
  block:
    - name: "Check for duplicate values"
      ansible.builtin.lineinfile:
        path: '/etc/default/aide'
        create: True
        regexp: '(?i)^\s*SILENTREPORTS='
        state: 'absent'
      check_mode: yes
      changed_when: no
      register: 'dupes'
    - name: "Deduplicate values from /etc/default/aide"
      ansible.builtin.lineinfile:
        path: '/etc/default/aide'
        create: True
        regexp: '(?i)^\s*SILENTREPORTS='
        state: 'absent'
      when: 'dupes.found is defined and dupes.found > 1'
    - name: "Insert correct line to /etc/default/aide"
      ansible.builtin.lineinfile:
        path: '/etc/default/aide'
        create: True
        regexp: '(?i)^\s*SILENTREPORTS='
        line: 'SILENTREPORTS=no'
        state: present
