I found error on task Gather the package facts:
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
sometimes it will causing error because of dependencies is missing:
fatal: [ansible-inventory]: FAILED! => {"changed": false, "msg": "Could not detect a supported package manager from the following list: ['portage', 'pkg', 'pacman', 'apt', 'rpm', 'pkg_info', 'apk'], or the required Python library is not installed. Check warnings for details."}
To minimalize changes, I propose solution to adding validation to install dependencies by specific OS family before task Gather the package facts:
# Install dependencies on OS family ['RedHat' | 'Debian' | 'Archlinux']
- ansible.builtin.include_tasks: deps-{{ ansible_os_family }}.yml
when: ansible_os_family in ['RedHat', 'Debian', 'Archlinux']
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
deps-Debian.yml
---
- name: Install prerequisite packages
ansible.builtin.apt:
name: "{{ dependency_packages }}"
state: present
deps-RedHat.yml
- name: Install prerequisite packages
ansible.builtin.package:
name: "{{ dependency_packages }}"
state: present
dependency_packages set in file inside folder vars per OS family. All changes will adding new task below:

I found error on task
Gather the package facts:- name: Gather the package facts ansible.builtin.package_facts: manager: autosometimes it will causing error because of dependencies is missing:
To minimalize changes, I propose solution to adding validation to install dependencies by specific OS family before task
Gather the package facts:deps-Debian.yml
--- - name: Install prerequisite packages ansible.builtin.apt: name: "{{ dependency_packages }}" state: presentdeps-RedHat.yml
- name: Install prerequisite packages ansible.builtin.package: name: "{{ dependency_packages }}" state: presentdependency_packagesset in file inside folder vars per OS family. All changes will adding new task below: