---
- name: DBus and Avahi packages installed
  community.general.pkgng:
    name: "avahi-app nss_mdns dbus ca_root_nss"
    state: latest

- name: DBus enabled
  shell: sysrc dbus_enable="YES"

- name: Avahi enabled
  shell: sysrc avahi_daemon_enable="YES"

- name: NSS switch config file installed
  patch:
    src: nsswitch.patch
    dest: /etc/nsswitch.conf
  notify:
    - DBus restarted
    - Avahi restarted
