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

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

Merged

Conversation

vbotka
Copy link
Contributor

@vbotka vbotka commented Jul 14, 2024

SUMMARY

Implement feature request #8632

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

community.general.pkgng

ADDITIONAL INFORMATION
  • Add option
+    use_globs:
+        description:
+            - Treat the package names as shell glob patterns.
+        required: false
+        type: bool
+        default: true
+        version_added: 9.2.0
  • Remove all hard coded options -g, e.g.
-    rc, out, err = run_pkgng('info', '-g', '-e', name)
+    rc, out, err = run_pkgng('info', '-e', name)
  • Apply the option -g conditionally
     def run_pkgng(action, *args, **kwargs):
         cmd = [pkgng_path, dir_arg, action]

+        if p["use_globs"] and action in ('info', 'install', 'upgrade',):
+            args = ('-g',) + args
+- name: Upgrade foo/bar
+  community.general.pkgng:
+    name: foo/bar
+    state: latest
+    use_globs: false

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request integration tests/integration module module plugins plugin (any type) tests tests labels Jul 14, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels Jul 14, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

changelogs/fragments/8632-pkgng-add-option-use_globs.yml Outdated Show resolved Hide resolved
plugins/modules/pkgng.py Outdated Show resolved Hide resolved
plugins/modules/pkgng.py Outdated Show resolved Hide resolved
vbotka and others added 4 commits July 21, 2024 22:23
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@vbotka
Copy link
Contributor Author

vbotka commented Jul 21, 2024

Thanks for the review!

Co-authored-by: Felix Fontein <felix@fontein.de>
@felixfontein felixfontein merged commit e3fb817 into ansible-collections:main Jul 23, 2024
147 checks passed
Copy link

patchback bot commented Jul 23, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/e3fb817a217a11827e72f1229fefefa73411480c/pr-8633

Backported as #8668

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jul 23, 2024
patchback bot pushed a commit that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e3fb817)
@felixfontein
Copy link
Collaborator

@vbotka thanks for your contribution!

felixfontein pushed a commit that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e3fb817)

Co-authored-by: Vladimir Botka <vbotka@gmail.com>
@vbotka vbotka deleted the feature-pkgng-option-use_globs branch July 24, 2024 12:52
@vbotka
Copy link
Contributor Author

vbotka commented Jul 24, 2024

@felixfontein thank you!

Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* rm aliases and add version_added

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

fixed pep8 errors

changed group_access_level description as "not required"
Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* rm aliases and add version_added

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

fixed pep8 errors

changed group_access_level description as "not required"

fix required
Acarnesecchi added a commit to Acarnesecchi/community.general that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 <felix@fontein.de>

* rm aliases and add version_added

---------

Co-authored-by: Felix Fontein <felix@fontein.de>

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 pull request 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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
TobiasZeuch181 pushed a commit to TobiasZeuch181/zypper_repository_add_list that referenced this pull request 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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
* 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 <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/pkgng.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch feature This issue/PR relates to a feature request integration tests/integration module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants