gmazoyer / ansible-role-netbox

Ansible Role: NetBox
GNU General Public License v3.0
37 stars 22 forks source link

Fix apt cache issue in certain cases #25

Closed shock0572 closed 1 year ago

shock0572 commented 1 year ago

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.