-
Notifications
You must be signed in to change notification settings - Fork 132
ImportError: cannot import name 'AnsibleCollectionLoader' from 'ansible.utils.collection_loader' #41
Comments
I have the same problem if using override-deps: ansible==<other_ansible_version> |
Ansible lint actions are currently broken for overrides of the Ansible version. Disable until fixed. ansible/ansible-lint-action#41
I am still using Ansible v2.9 and can report that I am affected by this bug, too. I'm just using the defaults in the I just went ahead and deleted the action until I have time to learn v2.10 and upgrade to it. |
I'm running into the same issue, so I've done a bit of testing.
Conclusions:
Idea: That said, though I'm very experienced with Docker and not bad with Python, I'm an absolute ansible neophyte. I just started using ansible yesterday. I can try to make this change (I might also sneak in a python version upgrade, which would improve performance), but it would probably be better if someone more versed in ansible does this. Upgrade from 2.9.x to 2.10.x error:
|
Facing same issue :/ |
The problem is 4 months old, can someone have a temporary solution? |
I ended up forking the repo and merging there the patch for it that's still pending at https://github.com/iranzo/ansible-lint-action/ and added also tagging... https://github.com/iranzo/ansible-lint-action/releases/tag/v4.1.1 is the one containing that change if you want to give it a try |
@iranzo Thank you so much! I will definitely try in a couple of days. |
…BLE ansible-lint as it is currently broken ansible/ansible-lint-action#41
Any update in this? |
I'm using solution from mr @iranzo and everything works for me. However, I can't find an explanation for why the problem has not been resolved yet and there is no answer from the developers ... |
Same problem here, with ansible 2.9.25 |
It looks like this project is dead. Maybe there are some alternatives? |
This issue came up when running playbooks requiring differing versions of ansible and ansible-core. When ansible-core is installed first and then later ansible 2.9 is installed without doing a full unistall of ansible-core, attempting to install ansible-galaxy dependencies fails. A work around is to run ansible in a virtual environment (venv or fresh docker image) for each playbook or to add logic to uninstall ansible and ansible-core and then reinstall the specific version needed for the playbook. sudo python3 -m pip uninstall ansible ansible-core -y
sudo python3 -m pip --proxy "$HTTPS_PROXY" install ansible==2.9.26 |
thestevenbell -- thanks! that was exactly the thing I was hitting. |
There is an issue with ansible-lint - it fails with "ImportError: cannot import name 'AnsibleCollectionLoader' from 'ansible.utils.collection_loader'" when Ansible is installed on the host and we're running lint in a venv. We're working around it by uninstalling Ansible in the `test-lint` make target. We're checking that we run in a toolbox container before doing the uninstall. ansible/ansible-lint-action#41 (comment) Co-Authored-By: Adrian Brown <[email protected]>
This is to work around an issue with ansible-lint: ansible/ansible-lint-action#41
* New: Customize availbility zone for conversion hosts It is now possible to customize conversion host availability zones via these new variables: os_migrate_src_conversion_availability_zone os_migrate_dst_conversion_availability_zone * Dev: Don't run lints with Ansible 2.9 This is to work around an issue with ansible-lint: ansible/ansible-lint-action#41 * Dev: Refactor argument ordering to satisfy pylint We shouldn't change the ordering of arguments of create_or_update when subclassing Resource, we should just add a new parameter at the end. * dev: allow vagrant on headless servers * dev: update vagrant to fedora35 horizon was broken on fedora35, dont need so it is disabled. * dev: documentation update for variables in e2e setup Co-authored-by: Jiri Stransky <[email protected]>
Bumped into this while trying to use |
For me it was solved by uninstalling ansible-base, and afterwards installing the target version. I did not have ansible-core installed. So: for anybody looking for somebody to copy paste in their terminal; this is what I would recommend:
Followed by whatever version you want to install. In my case:
|
Dear maintainers, please merge the patch proposed earlier in the thread or tell us why you can't merge it. Thanks! Ping @ssbarnea |
We have no plans to support more than latest version of ansible-lint and ansible-core with this action. The newer version of this action does not allow user to install a custom version of ansible or linter because we are using a pre-compiled container image with the tools. We have no container image building here. I will close this thread because it is too old and loaded with information that no longer applies. |
As the title suggests, we're running into an issue whereby
ansible-lint
is unable to execute because of an import error. I'm unsure if this is an issue in ourworkflow.yaml
,ansible-lint-action
, oransible-lint
itself.We noticed the issue 5 days ago but didn't look into it. Here is the output of the step in our workflow:
And here is the content of our
.github/workflows/ansible-lint.yml
:The text was updated successfully, but these errors were encountered: