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

FreeBSD. Add option use_globs to the module pkgng. #8632

Closed
1 task done
vbotka opened this issue Jul 14, 2024 · 2 comments
Closed
1 task done

FreeBSD. Add option use_globs to the module pkgng. #8632

vbotka opened this issue Jul 14, 2024 · 2 comments
Labels
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)

Comments

@vbotka
Copy link
Contributor

vbotka commented Jul 14, 2024

Summary

The utility pkg command upgrade provides option -g, --glob

Treat the package names as shell glob patterns.

The package can be in the form

<pkg-origin|pkg-name|pkg-name-version>

The module community.general.pkgng shall upgrade a package if state=latest. This doesn't work when the package is in the form pkg-origin. The reason is the hard-coded option -g in community.general.pkgng

- community.general.pkgng:
    name: security/py-openssl
    state: latest

fails because -g "treats the package names ..." this means the form pkg-name

fatal: [ca]: FAILED! => changed=false 
  msg: failed to upgrade security/py-openssl
  stderr: |-
    pkg: No packages available to upgrade matching 'security/py-cryptography' have been found in the repositories
  stderr_lines: <omitted>
  stdout: |-
    Updating FreeBSD repository catalogue...
    FreeBSD repository is up to date.
    All repositories are up to date.
  stdout_lines: <omitted>

This can be reproduced from the command line on the remote host

shell> pkg upgrade -n -g security/py-openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to upgrade matching 'security/py-openssl' have been found in the repositories

The form pkg-name works fine. For example, in the case py39-openssl is installed

shell> pkg info security/py-openssl
py39-openssl-23.2.0,1
Name           : py39-openssl
Version        : 23.2.0,1
Installed on   : Wed Jun 12 13:04:52 2024 CEST
Origin         : security/py-openssl
Architecture   : FreeBSD:14:*

the below command finds the latest package py39-openssl installed

shell> pkg upgrade -n -g py39-openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.

You can ask pkg to upgrade to the latest package in the form pkg-origin (without the option -g)

shell> pkg upgrade -n security/py-openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py311-openssl: 23.2.0,1
	py311-setuptools: 63.1.0_1

Number of packages to be installed: 2

The process will require 12 MiB more space.
2 MiB to be downloaded.

Conclusion: Make the option '-g, --glob' optional.

Issue Type

Feature Idea

Component Name

community.general.pkgng

Additional Information

    - community.general.pkgng:
        name: security/py-openssl
        state: latest
        use_globs: false
      register: result
    - debug:
        var: result

gives

ok: [ca] => 
  result:
    changed: true
    failed: false
    msg: upgraded 1 package
    stderr: ''
    stderr_lines: []
    stdout: |-
      Updating FreeBSD repository catalogue...
      FreeBSD repository is up to date.
      All repositories are up to date.
      The following 2 package(s) will be affected (of 0 checked):
  
      New packages to be INSTALLED:
              py311-openssl: 23.2.0,1
              py311-setuptools: 63.1.0_1
  
      Number of packages to be installed: 2
  
      The process will require 12 MiB more space.
      2 MiB to be downloaded.
      [1/2] Fetching py311-setuptools-63.1.0_1.pkg: .......... done
      [2/2] Fetching py311-openssl-23.2.0,1.pkg: ....... done
      Checking integrity... done (0 conflicting)
      [1/2] Installing py311-setuptools-63.1.0_1...
      [1/2] Extracting py311-setuptools-63.1.0_1: .......... done
      [2/2] Installing py311-openssl-23.2.0,1...
      [2/2] Extracting py311-openssl-23.2.0,1: .......... done
    stdout_lines:
    - Updating FreeBSD repository catalogue...
    - FreeBSD repository is up to date.
    - All repositories are up to date.
    - 'The following 2 package(s) will be affected (of 0 checked):'
    - ''
    - 'New packages to be INSTALLED:'
    - "\tpy311-openssl: 23.2.0,1"
    - "\tpy311-setuptools: 63.1.0_1"
    - ''
    - 'Number of packages to be installed: 2'
    - ''
    - The process will require 12 MiB more space.
    - 2 MiB to be downloaded.
    - '[1/2] Fetching py311-setuptools-63.1.0_1.pkg: .......... done'
    - '[2/2] Fetching py311-openssl-23.2.0,1.pkg: ....... done'
    - Checking integrity... done (0 conflicting)
    - '[1/2] Installing py311-setuptools-63.1.0_1...'
    - '[1/2] Extracting py311-setuptools-63.1.0_1: .......... done'
    - '[2/2] Installing py311-openssl-23.2.0,1...'
    - '[2/2] Extracting py311-openssl-23.2.0,1: .......... done'

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 feature This issue/PR relates to a feature request module module plugins plugin (any type) labels Jul 14, 2024
vbotka added a commit to vbotka/community.general that referenced this issue Jul 14, 2024
felixfontein added a commit that referenced this issue Jul 23, 2024
* pkgng - add option use_globs (default=true) #8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

Co-authored-by: Felix Fontein <[email protected]>
patchback bot pushed a commit that referenced this issue Jul 23, 2024
* pkgng - add option use_globs (default=true) #8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit e3fb817)
felixfontein pushed a commit that referenced this issue Jul 23, 2024
…default=true) (#8668)

pkgng - add option use_globs (default=true) (#8633)

* pkgng - add option use_globs (default=true) #8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit e3fb817)

Co-authored-by: Vladimir Botka <[email protected]>
@vbotka vbotka closed this as completed Jul 24, 2024
Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this issue Jul 25, 2024
fixed group logic. Removed trailing spaces

Type options of become plugins (ansible-collections#8623)

Type options of become plugins.

Type options of lookup plugins (ansible-collections#8626)

Type options of lookup plugins.

Type options of inventory plugins (ansible-collections#8625)

Type options of inventory plugins.

Type options of connection plugins (ansible-collections#8627)

Type options of connection plugins.

Type options of callback plugins (ansible-collections#8628)

Type options of callback plugins.

Various docs improvements (ansible-collections#8664)

Various docs improvements.

Fix new Proxmox Volume handling (ansible-collections#8646)

* proxmox(fix): volume string builder

Half of the string was incorrectly discarded

* proxmox(fix): remove string conversion of values

 - Also converted `None` values into strings
 - Clashed with non-`str` values in documentation

* proxmox: add changelog fragment

* proxmox(fix): remove old & unused imports

* proxmox(fix): correctly turn maps into lists

* Update changelogs/fragments/8646-fix-bug-in-proxmox-volumes.yml

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

* Update plugins/modules/proxmox.py

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

---------

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

pkgng - add option use_globs (default=true) (ansible-collections#8633)

* pkgng - add option use_globs (default=true) ansible-collections#8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

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

Fix pipx tests (ansible-collections#8665)

* fix pipx tests

* enable pipx int tests

* replace ansible-lint with pylint in pipx test

* install jupyter in freebsd

* replace jupyter with mkdocs in pipx test

* adjust installed dependency for mkdocs

* fix pipx_info tests as well

Add TLS certs params to redis (ansible-collections#8654)

* add tls params to redis

* add PR number

* add example

* move doc to redis fragment

* Update changelogs/fragments/8654-add-redis-tls-params.yml

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

* rm aliases and add version_added

---------

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

fixed pep8 errors

changed group_access_level description as "not required"
Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this issue Jul 25, 2024
fixed group logic. Removed trailing spaces

Type options of become plugins (ansible-collections#8623)

Type options of become plugins.

Type options of lookup plugins (ansible-collections#8626)

Type options of lookup plugins.

Type options of inventory plugins (ansible-collections#8625)

Type options of inventory plugins.

Type options of connection plugins (ansible-collections#8627)

Type options of connection plugins.

Type options of callback plugins (ansible-collections#8628)

Type options of callback plugins.

Various docs improvements (ansible-collections#8664)

Various docs improvements.

Fix new Proxmox Volume handling (ansible-collections#8646)

* proxmox(fix): volume string builder

Half of the string was incorrectly discarded

* proxmox(fix): remove string conversion of values

 - Also converted `None` values into strings
 - Clashed with non-`str` values in documentation

* proxmox: add changelog fragment

* proxmox(fix): remove old & unused imports

* proxmox(fix): correctly turn maps into lists

* Update changelogs/fragments/8646-fix-bug-in-proxmox-volumes.yml

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

* Update plugins/modules/proxmox.py

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

---------

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

pkgng - add option use_globs (default=true) (ansible-collections#8633)

* pkgng - add option use_globs (default=true) ansible-collections#8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

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

Fix pipx tests (ansible-collections#8665)

* fix pipx tests

* enable pipx int tests

* replace ansible-lint with pylint in pipx test

* install jupyter in freebsd

* replace jupyter with mkdocs in pipx test

* adjust installed dependency for mkdocs

* fix pipx_info tests as well

Add TLS certs params to redis (ansible-collections#8654)

* add tls params to redis

* add PR number

* add example

* move doc to redis fragment

* Update changelogs/fragments/8654-add-redis-tls-params.yml

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

* rm aliases and add version_added

---------

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

fixed pep8 errors

changed group_access_level description as "not required"

fix required
Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this issue Jul 25, 2024
fixed group logic. Removed trailing spaces

Type options of become plugins (ansible-collections#8623)

Type options of become plugins.

Type options of lookup plugins (ansible-collections#8626)

Type options of lookup plugins.

Type options of inventory plugins (ansible-collections#8625)

Type options of inventory plugins.

Type options of connection plugins (ansible-collections#8627)

Type options of connection plugins.

Type options of callback plugins (ansible-collections#8628)

Type options of callback plugins.

Various docs improvements (ansible-collections#8664)

Various docs improvements.

Fix new Proxmox Volume handling (ansible-collections#8646)

* proxmox(fix): volume string builder

Half of the string was incorrectly discarded

* proxmox(fix): remove string conversion of values

 - Also converted `None` values into strings
 - Clashed with non-`str` values in documentation

* proxmox: add changelog fragment

* proxmox(fix): remove old & unused imports

* proxmox(fix): correctly turn maps into lists

* Update changelogs/fragments/8646-fix-bug-in-proxmox-volumes.yml

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

* Update plugins/modules/proxmox.py

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

---------

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

pkgng - add option use_globs (default=true) (ansible-collections#8633)

* pkgng - add option use_globs (default=true) ansible-collections#8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

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

Fix pipx tests (ansible-collections#8665)

* fix pipx tests

* enable pipx int tests

* replace ansible-lint with pylint in pipx test

* install jupyter in freebsd

* replace jupyter with mkdocs in pipx test

* adjust installed dependency for mkdocs

* fix pipx_info tests as well

Add TLS certs params to redis (ansible-collections#8654)

* add tls params to redis

* add PR number

* add example

* move doc to redis fragment

* Update changelogs/fragments/8654-add-redis-tls-params.yml

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

* rm aliases and add version_added

---------

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

fixed pep8 errors

changed group_access_level description as "not required"

fix required

fix
aioue pushed a commit to aioue/community.general that referenced this issue Oct 1, 2024
* pkgng - add option use_globs (default=true) ansible-collections#8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

Co-authored-by: Felix Fontein <[email protected]>
TobiasZeuch181 pushed a commit to TobiasZeuch181/zypper_repository_add_list that referenced this issue Oct 2, 2024
* pkgng - add option use_globs (default=true) ansible-collections#8632

* Fix lint.

* Update changelogs/fragments/8632-pkgng-add-option-use_globs.yml

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

* Update plugins/modules/pkgng.py

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

* Update plugins/modules/pkgng.py

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

* Update tests/integration/targets/pkgng/tasks/install_single_package.yml

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

* Update plugins/modules/pkgng.py

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

---------

Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants