Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Ansible-core >= 2.10 #45

Open
lowjoel opened this issue Jun 22, 2022 · 3 comments
Open

Support for Ansible-core >= 2.10 #45

lowjoel opened this issue Jun 22, 2022 · 3 comments

Comments

@lowjoel
Copy link

lowjoel commented Jun 22, 2022

Hello there, I've tried to use this role with Ansible-core 2.12.6:

ansible-playbook [core 2.12.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/joel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/joel/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0]
  jinja version = 3.0.3
  libyaml = True

And I get this failure:

task path: /home/joel/.ansible/roles/gekmihesg.openwrt/tasks/main.yml:16
redirecting (type: modules) ansible.builtin.opkg to community.general.opkg
fatal: [hostname]: FAILED! => {"reason": "couldn't resolve module/action 'opkg'. This often indicates a misspelling, missing collection, or incorrect module path.\n\nThe error appears to be in '/home/joel/.ansible/roles/gekmihesg.openwrt/tasks/packages.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: update opkg cache\n  ^ here\n"}

I tried changing the opkg module in both the role code and my own Ansible code but it seems that the gekmihesg.openwrt.opkg module can't be found either. I'm guessing somewhere in the refactor to collections the logic that this role uses changed? I'd love to help to submit a patch, but unfortunately I'm lost as to where to begin right now.

Any advice/direction appreciated!

@lowjoel
Copy link
Author

lowjoel commented Jun 22, 2022

(Meanwhile I'll use Ansible 2.10, which is known to work, but IIRC is now EOL)

@lowjoel
Copy link
Author

lowjoel commented Jun 22, 2022

Oh, it seems that running ansible-galaxy collections install community.general is now needed. That seems to fix it for both versions. Should this be documented somewhere, or should there be some dependency specified in the meta.yml?

@Hurricos
Copy link

Oh, it seems that running ansible-galaxy collections install community.general is now needed. That seems to fix it for both versions. Should this be documented somewhere, or should there be some dependency specified in the meta.yml?

Oddly enough, I can't reproduce this with ansible-core 2.12.7; things function for me without community.general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants