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

opkg update_cache not working after ansible update #6004

Closed
1 task done
garar opened this issue Feb 16, 2023 · 6 comments · Fixed by #6119
Closed
1 task done

opkg update_cache not working after ansible update #6004

garar opened this issue Feb 16, 2023 · 6 comments · Fixed by #6119
Labels
bug This issue/PR relates to a bug has_pr module module os packaging plugins plugin (any type)

Comments

@garar
Copy link

garar commented Feb 16, 2023

Summary

Hi!

It seems that some recent updates to opkg command broke update_cache.

When I set update_cache: true ansible returns an error. Switch to update_cache: false fixes the issue.

Installing community.general:==6.2.0 fixed the issue.

Issue Type

Bug Report

Component Name

community.general.opkg

Ansible Version

ansible --version
ansible [core 2.14.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/garar/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/garar/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 6.3.0  

Configuration

$ ansible-config dump --only-changed

OS / Environment

Ubuntu 22.04 and OpenWrt 21.02.3

Steps to Reproduce

---
- name: Base tasks for openwrt
  hosts: openwrt
  tasks:
    - name: Install vim
      opkg:
        name:
          - vim-fuller
        state: present
        update_cache: true

Expected Results

Ansible should update opkg cache and install vim-fullter.

Actual Results

Log too long, please see here: https://gist.github.com/garar/9f71392a682f8f16f2645c0dbee091cc

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

cc @skinp
click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module os packaging plugins plugin (any type) labels Feb 16, 2023
@felixfontein
Copy link
Collaborator

CC @russoz @joergho maybe this is related to #5718?

@joergho
Copy link
Contributor

joergho commented Feb 20, 2023

@russoz
I think in opkg.py:161 and opkg.py:179 it should be

rc, dummy, dummy = self.runner("update_cache").run()

instead of

dummy, rc, dummy = self.runner("update_cache").run()

@russoz
Copy link
Collaborator

russoz commented Mar 1, 2023

@joergho you are right on spot! Thanks! I have added a test case for update_cache=true, it failed with the current code and works with the new one.

@garar
Copy link
Author

garar commented Mar 2, 2023

Hi all!

Thank you for fixing it so fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module os packaging plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants