ansible-collections / community.digitalocean

This Ansible collection contains modules for assisting in the automation of the DigitalOcean cloud.
https://galaxy.ansible.com/community/digitalocean/
GNU General Public License v3.0
140 stars 57 forks source link

CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier' #308

Closed DaniiC00kie closed 1 year ago

DaniiC00kie commented 1 year ago
SUMMARY

I'm quite new to ansible, I tried to use "community.general.modprobe" (automatically installing containerd runtime via ansible) To use this, the documentation of ansible states I have to install that package like this:

ansible-galaxy collection install community.general

However, running this command will crash with the error bellow.

ISSUE TYPE
COMPONENT NAME

ansible-galaxy: community.general

ANSIBLE VERSION
ansible [core 2.12.4]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.7 (main, May 29 2023, 13:51:48) [GCC 12.2.0]
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION
# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0
CONFIGURATION
nothing (I did not change anything in the ansible-config
OS / ENVIRONMENT

Ubuntu 22.10 \n \l Linux ansible-tst 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64 x86_64 x86_64 GNU/Linux VM within Proxmox (not container) Proxmox: 7.4-16

STEPS TO REPRODUCE

1.: created a hosts file. 2.: installed ansible 3.: created playbook file (see below, complete content right now) 4.:

inventory hosts file:
[tst-containerd]
10.0.0.23 ansible_user=ansible ansible_ssh_private_key=/opt/ansible/id_rsa
- hosts: tst-containerd
  become: true
  become_user: root
  tasks:
    - name: config for containerd
      shell: |
        echo overlay >> /etc/modules-load.d/k8s.conf
        echo br_netfilter >> /etc/modules-load.d/k8s.conf
    - name: modprobe overlay
        community.general.modprobe:
          name: "overlay"
          state: present

    - name: modprobe br_netfilter
        community.general.modprobe:
          name: "br_netfilter"
          state: present
EXPECTED RESULTS

Installation of the community.general package should succeed, playbook should work.

ACTUAL RESULTS
$ ansible-playbook -i inventory/tst-containerd install-containerd.yaml
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: Expecting value: line 1 column 1 (char 0)

Syntax Error while loading YAML.
  mapping values are not allowed in this context

The error appears to be in '/root/k3/install-k3s.yaml': line 10, column 35, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: modprobe overlay
        community.general.modprobe:
                                  ^ here

tring to install community.general:

$ ansible-galaxy collection install community.general -vvv
ansible-galaxy [core 2.12.4]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-galaxy
  python version = 3.10.7 (main, May 29 2023, 13:51:48) [GCC 12.2.0]
  jinja version = 3.0.3
  libyaml = True
No config file found; using defaults
Starting galaxy collection install process
Process install dependency map
ERROR! Unexpected Exception, this is probably a bug: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible-galaxy", line 128, in <module>
    exit_code = cli.run()
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 569, in run
    return context.CLIARGS['func']()
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 86, in method_wrapper
    return wrapped_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 1203, in execute_install
    self._execute_install_collection(
  File "/usr/lib/python3/dist-packages/ansible/cli/galaxy.py", line 1230, in _execute_install_collection
    install_collections(
  File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/__init__.py", line 548, in install_collections
    dependency_map = _resolve_depenency_map(
  File "/usr/lib/python3/dist-packages/ansible/galaxy/collection/__init__.py", line 1364, in _resolve_depenency_map
    return collection_dep_resolver.resolve(
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/usr/lib/python3/dist-packages/resolvelib/resolvers.py", line 147, in _add_to_criteria
    matches = self._p.find_matches(
TypeError: CollectionDependencyProvider.find_matches() got an unexpected keyword argument 'identifier'
mamercad commented 1 year ago

I believe you need to file this issue here.