---
- name: Test distribution packages file
  stat:
    path: "{{ role_path }}/tasks/by_os/{{ ansible_distribution|lower }}/main.yml"
  register: distribution_file

- name: Include distribution packages
  include_tasks: "{{ role_path }}/tasks/by_os/{{ ansible_distribution|lower }}/main.yml"
  when: distribution_file.stat.exists

- name: Include common packages
  include_tasks: "{{ role_path }}/tasks/by_os/common/main.yml"
  when: not distribution_file.stat.exists
