community.general/changelogs/fragments
patchback[bot] cf1b02c6b9
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
[PR #10705/b1c75339 backport][stable-11] openbsd_pkg: add support for removing unused dependencies (#10758)
openbsd_pkg: add support for removing unused dependencies (#10705)

* openbsd_pkg: add support for removing unused dependencies

Add new state 'rm_unused_deps' that uses 'pkg_delete -a' to remove
packages that are no longer required by any other packages.

Features:
- Requires name='*' to avoid accidental usage
- Supports check mode, diff mode, clean and quick flags
- Follows existing module patterns for error handling
- Integrates with existing package list comparison for change detection

* Update the PR number in the frgment link

* Fix the changelog fragment name to include the PR #

* Force non-interactive mode like most of the other modes

* Fix PEP8 E302: add missing blank line before function definition

* Ensure that no matter what, if the package list unchanged then there was no change

Also removed some unused vars from the original code.

* Standardize names in the PR

* Swap over from a new state to implementing an autoremove option

Added code to handle the case where you git a name or list of names as
pkg_delete will correctly filter what it autoremove by the names

* Update the fragment to match the new code

* typo in EXAMPLES

* Fix up a yamllint complaint.

I do note the following:

```
$ ansible-lint tests/test_openbsd_pkg.yml

Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.
```

Although that could be due to local config

* While here add realistic examples of packages that might be autoinstalled

* Clean up docs.



* Autoremove is an option, work like the other package managers

* Update changelog for openbsd_pkg autoremove parameter

Clarified the behavior of the `autoremove` parameter to specify it removes autoinstalled packages. Removed flowery text that isn't needed.

* Cut the rest of the cruft out of the changelog fragment

Make it obvious how '*' can be used as a 'name:'
Be more pythonic in the package list comparison.

* Update changelogs/fragments/10705-openbsd-pkg-remove-unused.yml



---------


(cherry picked from commit b1c75339c0)

Co-authored-by: Allen Smith <lazlor@lotaris.org>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-08-28 22:18:07 +02:00
..
.keep Rename changelogs/fragments/.empty -> changelogs/fragments/.keep 2020-08-07 08:17:57 +02:00
10299-github_app_access_token-lookup.yml [PR #10664/65bc4706 backport][stable-11] GitHub app access token lookup: allow to use PyJWT + cryptography instead of jwt (#10720) 2025-08-23 19:45:03 +02:00
10413-pacemaker-resource-cleanup.yml [PR #10413/3b09e9d9 backport][stable-11] pacemaker_resource: add cleanup state (#10750) 2025-08-27 22:09:33 +02:00
10646-scaleway_container_cpu_limit.yml [PR #10646/09f11523 backport][stable-11] Add cpu limit argument to scaleway_container (#10718) 2025-08-23 19:44:45 +02:00
10647-scaleway-module-defaults.yml [PR #10647/29b35022 backport][stable-11] Add a scaleway group to be able to use module_defaults (#10715) 2025-08-23 19:44:19 +02:00
10652-oracle-deprecation.yml [PR #10652/9e86d239 backport][stable-11] oci/oracle: deprecation (#10717) 2025-08-23 19:44:37 +02:00
10661-support-gpg-auto-impor-keys-in-zypper.yml [PR #10661/177b385d backport][stable-11] Add support for gpg-auto-import-keys option to zypper (#10721) 2025-08-23 19:45:11 +02:00
10679-gitlab-access-token-add-planner-role.yml [PR #10679/1c0eb9dd backport][stable-11] gitlab_*_access_token: add planner access level (#10716) 2025-08-23 19:44:29 +02:00
10684-django-improvements.yml [PR #10684/ded43714 backport][stable-11] django module, module_utils: adjustments (#10747) 2025-08-27 22:09:53 +02:00
10700-django-check-databases.yml [PR #10700/9f4bb3a7 backport][stable-11] django_check: rename database param, add alias (#10713) 2025-08-23 19:44:00 +02:00
10705-openbsd-pkg-remove-unused.yml [PR #10705/b1c75339 backport][stable-11] openbsd_pkg: add support for removing unused dependencies (#10758) 2025-08-28 22:18:07 +02:00
10707-pacemaker-maintenance-mode-regex.yml [PR #10707/63321754 backport][stable-11] pacemaker: Add regex checking for maintenance-mode (#10749) 2025-08-27 22:09:23 +02:00
10711-pytohn-idioms-1.yml [PR #10711/62fa3e6f backport][stable-11] remove trailing comma in dict(parameters,) (#10724) 2025-08-23 19:43:36 +02:00
10712-python-idioms-2.yml [PR #10712/cb84fa74 backport][stable-11] remove extra brackets when params are a given by a comprehension (#10725) 2025-08-23 19:43:27 +02:00
10743-monit-handle-unknown-status.yml [PR #10743/469e557b backport][stable-11] monit: handle arbitrary error status (#10760) 2025-08-28 22:17:56 +02:00
random_string_seed.yml [PR #10710/b5a2c581 backport][stable-11] random_string: Specify seed while generating random string (#10748) 2025-08-27 22:09:41 +02:00