When installing a collection from ansible-galaxy, a python module is required # ansible-galaxy collection install community.general Starting galaxy collection install process ERROR! importlib_resources is not installed and is required Please add devel/py-importlib-resources as a dependency when installing Ansible, and perhaps also for the ansible-compat and ansible-core packages? # pkg info | grep ansible py39-ansible-8.2.0 Radically simple IT automation py39-ansible-compat-4.1.2 Ansible compatibility goodies py39-ansible-core-2.15.2 Radically simple IT automation py39-ansible-lint-6.17.1 Checks playbooks for sub-optimal practices and behaviour # uname FreeBSD 13.2-STABLE 74614fa93
Created attachment 245566 [details] sysutils/ansible: Support ansible-galaxy install from community Can you try this patch, please?
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2211c50a41e91d490ee24cacdd496dccccfbc3ad commit 2211c50a41e91d490ee24cacdd496dccccfbc3ad Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2023-10-11 14:04:26 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-10-11 14:14:51 +0000 sysutils/ansible: Support ansible-galaxy install from community Fix: Starting galaxy collection install process ERROR! importlib_resources is not installed and is required Please add devel/py-importlib-resources as a dependency when installing Ansible, and perhaps also for the ansible-compat and ansible-core packages? PR: 274408 sysutils/ansible/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
(In reply to commit-hook from comment #2) Maybe it's worth creating a separate port? For example: py39-ansible-collection-community.general-7.5.0 ...
Hmmm. Could you be missing something? cwsys$ ansible-galaxy collection install community.general Starting galaxy collection install process Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`. cwsys$ pkg info -I \*ansible\* py39-ansible-8.4.0_1 Radically simple IT automation py39-ansible-compat-4.1.2 Ansible compatibility goodies py39-ansible-core-2.15.5 Radically simple IT automation py39-ansible-kld-g20200803,1 Ansible module to load kernel modules or update /boot/loader.conf py39-ansible-lint-6.17.1 Checks playbooks for sub-optimal practices and behaviour py39-ansible-sysrc-g20200803_1,1 Ansible module to set sysvars in rc.conf cwsys$
(In reply to Cy Schubert from comment #4) Show your console output: ansible-galaxy collection verify community.general I'll try to roll back the virtual machine this afternoon and repeat the error output from the first message.
lippy$ ansible-galaxy collection verify community.general Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/community-general-7.4.0.tar.gz to /home/cy/.ansible/tmp/ansible-local-67944mdh786_/tmpd7yklwr4/community-general-7.4.0-auu99ohk Verifying 'community.general:7.4.0'. Installed collection found at '/usr/local/lib/python3.9/site-packages/ansible_collections/community/general' MANIFEST.json hash: e9a8761d9a3dcceabd7ad9588dc7179cb6b984d7b359aaaea7c871b6252d098a Collection community.general contains modified content in the following files: .azure-pipelines/scripts/aggregate-coverage.sh .azure-pipelines/scripts/combine-coverage.py [... a lot of filenames ] plugins/test/__pycache__/a_module.cpython-39.opt-1.pyc plugins/test/__pycache__/a_module.cpython-39.pyc slippy$ slippy$ pkg info -I \*ansible\* py39-ansible-8.4.0_1 Radically simple IT automation py39-ansible-compat-4.1.2 Ansible compatibility goodies py39-ansible-core-2.15.5 Radically simple IT automation py39-ansible-kld-g20200803,1 Ansible module to load kernel modules or update /boot/loader.conf py39-ansible-lint-6.17.1 Checks playbooks for sub-optimal practices and behaviour py39-ansible-sysrc-g20200803_1,1 Ansible module to set sysvars in rc.conf slippy$ 2456 files found for community.general. slippy$ pkg info -l sysutils/ansible | grep -c community/general 2456 slippy$ Remember devel/ansilble (py39-ansible-8.4.0_1) is the community contributions.
Also, the ansible-galaxy collection verify will not work if you have a ~/netrc file.
BTW, I took over maintainership of sysutils/py-ansible-core and sysutils/ansible earlier this week. One thing I am planning is to update package descriptions and WWWs. sysutils/py-ansible-core is ansible itself (https://github.com/ansible/ansible.git), while sysutils/ansible is an aggregation of ansible-collections repositories (https://github.com/ansible-collections). I think the name sysutils/ansible is incorrect and should be named sysutils/ansible-collections. I think this is something that I'll need to rectify at some point but not just now, the week I took over maintainership. If not rename the port/packages, clarify what it is in pkg-descr.I think this will avoid some confusion in the FreeBSD community which package contains ansible-collections.
(In reply to Vladyslav V. Prodan from comment #5) I confirm the problem: [10:39]ansible2:root-> /root# ansible-galaxy collection list ERROR! importlib_resources is not installed and is required # pkg install sysutils/ansible sysutils/py-ansible-core Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The most recent versions of packages are already installed # pkg info -I \*ansible\* py39-ansible-8.2.0 Radically simple IT automation py39-ansible-compat-4.1.2 Ansible compatibility goodies py39-ansible-core-2.15.2 Radically simple IT automation py39-ansible-lint-6.17.1 Checks playbooks for sub-optimal practices and behaviour # pkg remove sysutils/py-ansible-core # pkg install sysutils/ansible sysutils/py-ansible-core py39-ansible-compat py39-ansible-lint ... Proceed with this action? [y/N]: y [1/4] Installing py39-ansible-core-2.15.2... [1/4] Extracting py39-ansible-core-2.15.2: 100% [2/4] Installing py39-ansible-compat-4.1.2... [2/4] Extracting py39-ansible-compat-4.1.2: 100% [3/4] Installing py39-ansible-8.2.0... [3/4] Extracting py39-ansible-8.2.0: 100% [4/4] Installing py39-ansible-lint-6.17.1... [4/4] Extracting py39-ansible-lint-6.17.1: 100% [10:44]ansible2:root-> /root# ansible-galaxy collection list ERROR! importlib_resources is not installed and is required
Fixed.