---
- name: Arpwatch tasks
  block:
    - name: Ensure arpwatch is installed
      package:
        name: arpwatch
        state: latest

    - name: Ensure eth0 is used as device
      lineinfile:
        path: /etc/arpwatch.conf
        state: present
        regexp: "eth0	-m root$" # noqa 203
        line: "eth0	-m root" # noqa 203

    - name: Ensure arpwatch is enabled
      service:
        name: arpwatch
        enabled: yes
        state: started

    - name: Ensure arpwatch user is member of the mail group
      user:
        name: arpwatch
        groups: mail
        append: yes

  become: yes
  tags:
    - arpwatch

---
- name: Arpwatch tasks
  block:
    - name: Ensure arpwatch is installed
      package:
        name: arpwatch
        state: latest

    - name: Ensure args are configured correctly
      lineinfile:
        path: /etc/default/arpwatch
        state: present
        regexp: "ARGS=" # noqa 203
        line: 'ARGS="-N -p -m root"' # noqa 203

    - name: Ensure arpwatch is enabled for eth0
      systemd:
        name: arpwatch@eth0.service
        enabled: yes
        state: started

    - name: Ensure arpwatch user is member of the mail group
      user:
        name: arpwatch
        groups: mail
        append: yes

  become: yes
  tags:
    - arpwatch

Adjust for Debian buster package
Adjust for Debian buster package
