ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 341 forks source link

Could not find imported module support code for ansible_collections.community.vmware.plugins.modules.vcenter_folder #2126

Closed ericbos111 closed 3 months ago

ericbos111 commented 3 months ago
SUMMARY

TASK [provision-ipi : Make sure the specified VM folder exists] **** Monday 05 August 2024 07:51:05 +0000 (0:00:00.035) 0:01:10.394 ***** fatal: [localhost]: FAILED! => {"msg": "Could not find imported module support code for ansible_collections.community.vmware.plugins.modules.vcenter_folder. Looked for (['ansible.module_utils.compat.version.StrictVersion', 'ansible.module_utils.compat.version'])"}

ISSUE TYPE
COMPONENT NAME

ansible_collections.community.vmware.plugins.modules.vcenter_folder.

ANSIBLE VERSION
ansible 2.10.17
  config file = /opt/ansible/.ansible.cfg
  configured module search path = ['/opt/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.11.7 (main, Jul  4 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]
COLLECTION VERSION
# /opt/ansible/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 4.5.0 
CONFIGURATION
DEFAULT_STDOUT_CALLBACK(/opt/ansible/.ansible.cfg) = community.general.diy
INTERPRETER_PYTHON(env: ANSIBLE_PYTHON_INTERPRETER) = /usr/local/bin/python
OS / ENVIRONMENT
STEPS TO REPRODUCE
# Run OpenShift IPI installer if no OpenShift cluster does not exist yet
- block:
  - name: Trust certificates for vSphere
    include_tasks: vsphere-trust-certificates.yml

  - name: Retrieve vSphere user
    include_role: 
      name: vault-get-secret
    vars:
      secret_name: "vsphere-user"
      secret_group: "{{ environment_name }}" 

  - set_fact:
      _vsphere_user: "{{ secret_value }}"

  - name: Retrieve vSphere password
    include_role: 
      name: vault-get-secret
    vars:
      secret_name: "vsphere-password"
      secret_group: "{{ environment_name }}" 

  - set_fact:
      _vsphere_password: "{{ secret_value }}"

  - name: Make sure the specified VM folder exists
    community.vmware.vcenter_folder:
      hostname: "{{ _vsphere_config.vcenter }}"
      datacenter: "{{ _vsphere_config.datacenter }}"
      folder_name:  "{{ _vsphere_config.folder | basename }}"
      folder_type: vm
      username: "{{ _vsphere_user }}"
      password: "{{ _vsphere_password }}"
      state: present
EXPECTED RESULTS

A folder will be created

ACTUAL RESULTS
TASK [provision-ipi : Make sure the specified VM folder exists] ****************
task path: /cloud-pak-deployer/automation-roles/30-provision-infra/provision-ipi/tasks/main.yml:52
Monday 05 August 2024  08:54:30 +0000 (0:00:00.019)       0:01:03.350 ********* 
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ebos/cpd-status/tmp `"&& mkdir "` echo /home/ebos/cpd-status/tmp/ansible-tmp-1722848070.188001-2621-210757752749762 `" && echo ansible-tmp-1722848070.188001-2621-210757752749762="` echo /home/ebos/cpd-status/tmp/ansible-tmp-1722848070.188001-2621-210757752749762 `" ) && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/ebos/cpd-status/tmp/ansible-tmp-1722848070.188001-2621-210757752749762/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => 
  msg: Could not find imported module support code for ansible_collections.community.vmware.plugins.modules.vcenter_folder.  Looked for (['ansible.module_utils.compat.version.StrictVersion', 'ansible.module_utils.compat.version'])
mariolenz commented 3 months ago
ansible 2.10.17
  config file = /opt/ansible/.ansible.cfg
  configured module search path = ['/opt/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.11.7 (main, Jul  4 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)]
# /opt/ansible/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 4.5.0 

community.vmware 4.x doesn't support ansible (ansible-core since 2.11 but named ansible-base for just this one release) 2.10. Actually, I think we've dropped support for 2.10 in community.vmware 2.0.0.

Additionally, it looks like you're using Python 3.11. Not only is ansible-base 2.10 EOL, it also doesn't support Python > 3.9.

So I think it would be best to close this issue because you don't run a supported combination of this collection + ansible / ansible-base / ansible-core + Python.

Feel free to re-open it again if you think I'm wrong in closing it. But... well, see my comments above.

Apart from this, do you already know our forum? This issue doesn't really look like a problem with the collection (not using supported versions / combination of versions) but you might get help there. I think there are more active users of this collection on the forum than there are ones monitoring and answering issues here.

ericbos111 commented 3 months ago

I became a member of the forum but I don't seem to be allowed to post any questions yet