- name: Setup matter server
  become: "{{ 'no' if inventory_hostname == 'nas.home.lan' else 'yes' }}"
  block:
    - name: Reconfigure config
      ansible.builtin.lineinfile:
        path: /etc/sysctl.conf
        regexp: "^Unet.ipv4.igmp_max_memberships.*"
        line: "net.ipv4.igmp_max_memberships = 80"
    - name: Restart agent
      ansible.builtin.shell: echo 80 > /proc/sys/net/ipv4/igmp_max_memberships
      notify: restart_matter_server
      changed_when: my_output.rc != 0
