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

slackpkg: wrong matching of package name in installation #450

Closed
majekw opened this issue Jun 2, 2020 · 3 comments
Closed

slackpkg: wrong matching of package name in installation #450

majekw opened this issue Jun 2, 2020 · 3 comments
Labels
bug This issue/PR relates to a bug has_pr module module

Comments

@majekw
Copy link
Contributor

majekw commented Jun 2, 2020

SUMMARY

Current implementation of searching packages could give wrong and unexpected results.
Slackware packages name convention is: name-version-arch-build.t?z, but name could also contain -. Matching name with exactly 3 occurrence of - is impossible in glob().
For example it's not possible to install openssl package when openssl-solibs is installed as check finds later matching desired pattern and module do nothing.

There was a try to fix this and also other issues with this module in ansible/ansible#22285 but this PR was abandoned and never finished.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

slackpkg

ANSIBLE VERSION
ansible 2.9.9
CONFIGURATION

OS / ENVIRONMENT

Slackware Linux 14.2

STEPS TO REPRODUCE

On system with openssl-solibs installed try to install also openssl package

  - name: install openssl package
    slackpkg:
      name: openssl
      state: present
EXPECTED RESULTS

Package openssl is installed if not present.

ACTUAL RESULTS

Package openssl is not installed because module 'thinks' that it's already present.

ok: [somehost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "name": [
                "openssl"
            ],
            "state": "present",
            "update_cache": false
        }
    },
    "msg": "package(s) already present"
}

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are inaccurate, 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 affects_2.10 bug This issue/PR relates to a bug module module labels Jun 2, 2020
@majekw majekw changed the title slackpkg: wrong matching of package name slackpkg: wrong matching of package name in installation Jun 3, 2020
majekw added a commit to majekw/community.general that referenced this issue Jun 3, 2020
Andersson007 added a commit that referenced this issue Jun 11, 2020
* slackpkg: fix name matching in package installation (#450)

* Escape re parameters and optimize matching as suggested in code review.

Co-authored-by: Felix Fontein <[email protected]>

* Update changelogs/fragments/450-slackpkg-package-matching.yml

Co-authored-by: Andrew Klychkov <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Andrew Klychkov <[email protected]>
@Andersson007
Copy link
Contributor

closed via #450

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
Projects
None yet
Development

No branches or pull requests

3 participants