As the role is meant for Debian/Ubuntu, it can leverage the use of ansible.builtin.apt (supports both distros) instead of ansible.builtin.package.
In some occasions the package installation fails because the package cache isn't updated:
ubuntu@netbox:~$ sudo apt install python3-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3-venv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3-venv' has no installation candidate
Using ansible.builtin.apt permits having update_cache: true, that solves the issue.
As the role is meant for Debian/Ubuntu, it can leverage the use of
ansible.builtin.apt
(supports both distros) instead ofansible.builtin.package
. In some occasions the package installation fails because the package cache isn't updated:Using
ansible.builtin.apt
permits havingupdate_cache: true
, that solves the issue.