---
- include_tasks: debian_family.yml
  when: ansible_os_family == 'Debian'

- include_tasks: redhat_family.yml
  when: ansible_os_family == "RedHat"
...