Ansible-lint not using venv
My team has ran into issues using the newest version of this image released due to underlying changes to ansible-lint itself. This is due to the fact that in this MR the linter is now aware of it's own requirements and will error out if it does not find the dependencies specified in the requirements.yml
. Within the image build for this repo, it pulls the ansible image as a base and the ansible image build seems to make a venv to install ansible+required dependencies into which can be seen here. However, the ansible-lint image does not seem to source that venv, and thus installs ansible-lint to the global/site-packages in the image. I believe it is preferable to install it within the venv, by sourcing it first and then pip installing from the requirements. This will also smooth over the issue we are running into in regards to the linter not finding some of the collections we depend on as the ansible/ansible-core package installed within the venv comes with them out of the box.
TLDR; I believe it is desirable to source the venv from the parent image in order to install the linter within it. This can help keep the install environment consistent and not cause issues with pulling things from the site-packages that are expected to be in the venv and vice versa.