1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add an explicit select option to portage module (#8236)

* Add an explicit `select` option to `portage` module

This is a fix for #6226

* Apply suggestions from code review

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

* Default `select` option to None, making it more retrocompatible

* Add changelog fragment for the PR

* Update changelogs/fragments/8236-portage-select-feature.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Thomas Langé 2024-04-21 14:54:45 +02:00 committed by GitHub
parent 9d66a1dc1e
commit be11d0d409
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- portage - adds the possibility to explicitely tell portage to write packages to world file (https://github.com/ansible-collections/community.general/issues/6226, https://github.com/ansible-collections/community.general/pull/8236).

View file

@ -121,6 +121,14 @@ options:
type: bool
default: false
select:
description:
- If set to V(true), explicitely add the package to the world file.
- Please note that this option is not used for idempotency, it is only used
when actually installing a package.
type: bool
version_added: 8.6.0
sync:
description:
- Sync package repositories first
@ -374,6 +382,7 @@ def emerge_packages(module, packages):
'loadavg': '--load-average',
'backtrack': '--backtrack',
'withbdeps': '--with-bdeps',
'select': '--select',
}
for flag, arg in emerge_flags.items():
@ -523,6 +532,7 @@ def main():
nodeps=dict(default=False, type='bool'),
onlydeps=dict(default=False, type='bool'),
depclean=dict(default=False, type='bool'),
select=dict(default=None, type='bool'),
quiet=dict(default=False, type='bool'),
verbose=dict(default=False, type='bool'),
sync=dict(default=None, choices=['yes', 'web', 'no']),
@ -543,6 +553,7 @@ def main():
['quiet', 'verbose'],
['quietbuild', 'verbose'],
['quietfail', 'verbose'],
['oneshot', 'select'],
],
supports_check_mode=True,
)