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

pacman: Can't install from local file #4285

Closed
1 task done
foxeng opened this issue Feb 25, 2022 · 7 comments · Fixed by #4286
Closed
1 task done

pacman: Can't install from local file #4285

foxeng opened this issue Feb 25, 2022 · 7 comments · Fixed by #4286
Labels
bug This issue/PR relates to a bug has_pr module module os packaging plugins plugin (any type)

Comments

@foxeng
Copy link

foxeng commented Feb 25, 2022

Summary

When trying to install a package from a local file, pacman fails with target not found. This happens because the --sync operations is used, whereas for local files, the --upgrade operation is necessary instead. Introduced in #3907.

Issue Type

Bug Report

Component Name

pacman

Ansible Version

$ ansible --version
ansible [core 2.12.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/fotis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/fotis/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /usr/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.5.0

Configuration

No response

OS / Environment

No response

Steps to Reproduce

# From the module examples
- name: Install package bar from file
  community.general.pacman:
    name: ~/bar-1.0-1-any.pkg.tar.xz
    state: present

Expected Results

I expected to install package bar contained in ~/bar-1.0-1-any.pkg.tar.xz, but it fails.

Actual Results

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

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

CC @jraby

@jraby
Copy link
Contributor

jraby commented Feb 25, 2022

I'll have a look.

@jraby
Copy link
Contributor

jraby commented Feb 25, 2022

@foxeng could you give this a spin? #4286

I do not have time to finish the PR right now, but I think it is in working shape.
It needs tests and I'm not super happy with how the code looks afterwards, but hey at least it works.

@jraby
Copy link
Contributor

jraby commented Feb 26, 2022

#4286 should fix this and it is now in a better shape than yesterday :-)

If you can give it a try and confirm it works for your usecase, it would be great.

Thanks and sorry for the breakage...

@foxeng
Copy link
Author

foxeng commented Feb 27, 2022

Sorry for the late response, the second iteration worked like a charm! (ftr, the first one still had trouble, seemed to treat all packages as local, didn't get to the bottom of it though). Thank you very much for the prompt fix!

Feel free to (auto)close the issue when the PR is merged.

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.

4 participants