Compare commits

...

122 Commits

Author SHA1 Message Date
Felix Fontein
8919a545d3 Release 12.2.0. 2025-12-29 14:47:41 +01:00
patchback[bot]
59b6126320 [PR #11204/6ae47590 backport][stable-12] lxc_container: replace subprocess.Popen() with run_command() (#11339)
lxc_container: replace subprocess.Popen() with run_command() (#11204)

* lxc_container: replace subprocess.Popen() with run_command()

* Update plugins/modules/lxc_container.py



* add changelog frag

* retain Popen logic in module_utils

* Update plugins/module_utils/_lxc.py



---------


(cherry picked from commit 6ae47590cd)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-29 12:00:12 +01:00
patchback[bot]
3778ec8000 [PR #11328/18c362ee backport][stable-12] add devcontainer+pre-commit (#11338)
add devcontainer+pre-commit (#11328)

* add devcontainer support

* chore(devcontainer): install test requirements

* chore: add pre-commit

* fix format of pre-commit config file

* add licenses for the new files

* Apply suggestions from code review

* move requirements-dev.txt to inside .devcontainer

* specify files for ruff

* update CONTRIBUTING.md

* chore(devcontainer): use standard image, no docker build

* docs: format CONTRIBUTING.md (automatic by IDE)

* Update .devcontainer/devcontainer.json

* remove extraneous edits in CONTRIBUTING.md

(cherry picked from commit 18c362eef4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-29 11:35:35 +01:00
patchback[bot]
440ee9c3fe [PR #11311/4fe129a0 backport][stable-12] Adding support for the Scaleway SCW_PROFILE environment variable. (#11336)
Adding support for the Scaleway SCW_PROFILE environment variable. (#11311)

* Adding support for the Scaleway SCW_PROFILE environment variable.

* Adding changelog fragment.

* Adding documentation for the environment variable.

* Adding SCW_PROFILE as a proper environment variable via the DOCUMENTATION block.

* Updating changelog fragment.

(cherry picked from commit 4fe129a0ed)

Co-authored-by: Greg Harvey <greg.harvey@gmail.com>
2025-12-28 21:25:02 +01:00
patchback[bot]
39a49e4d98 [PR #11314/b3c066b9 backport][stable-12] Adding scw_profile parameter to Scaleway module utilities. (#11337)
Adding scw_profile parameter to Scaleway module utilities. (#11314)

* Adding scw_profile parameter to Scaleway module utilities.

* Setting param name to profile for consistency and adding scw_profile as an alias.

* Adding changelog fragment.

* Forgot to import 'os' library.

* Type in variable type for Scaleway profile.

* Also forgot to include the yaml library, code taking from plugins/inventory/scaleway.py.

* Adding default 'profile' value of empty string and changing check to a length check.

* Treated wrong variable, checking XDG_CONFIG_HOME is a string.

* Explicitly setting default of environment path vars to empty strings instead of None.

* Letting ruff reformat the dict for 'profile'.

* Changes from code review.

* Fixing ruff formatting issue with error message.

* Properly catching PyYAML import issues.

* Adding PyYAML requirement when 'profile' is used.

* Ruff wants an extra line after the PyYAML import code.

* Fixing PyYAML dependency code as per review.

* Removing extraneous var declaration.

* Moving SCW_CONFIG loading to a function.

* Fixing type errors with os.getenv calls.

* Cannot send None to os.path.exists() or open().

* Oops, inversed logic!

* Setting os.getenv() default to empty string so it is never None.



* None check no longer needed as scw_config_path is never None.



---------


(cherry picked from commit b3c066b99f)

Co-authored-by: Greg Harvey <greg.harvey@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-28 21:24:54 +01:00
patchback[bot]
51d8c4b5fd [PR #11332/280d269d backport][stable-12] fix: listen_ports_facts return no facts when using with podman (#11335)
fix: listen_ports_facts return no facts when using with podman (#11332)

* fix: listen_ports_facts return no facts when using with podman

* Update changelogs/fragments/listen-ports-facts-return-no-facts.yml



---------


(cherry picked from commit 280d269d78)

Co-authored-by: Daniel Gonçalves <dangoncalves@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-28 21:24:45 +01:00
patchback[bot]
f1fbdd4a6c [PR #11309/9f5114dc backport][stable-12] keycloak_userprofile: Add missing selector option (#11333)
keycloak_userprofile: Add missing selector option (#11309)

* Add selector option

* Add fragment

* Formatting

(cherry picked from commit 9f5114dc76)

Co-authored-by: maxblome <53860633+maxblome@users.noreply.github.com>
2025-12-28 10:00:10 +01:00
Felix Fontein
5f44c4ed50 Add reformat commit to .git-blame-ignore-revs. 2025-12-27 16:31:19 +01:00
patchback[bot]
e530d2906a [PR #11329/d549baa5 backport][stable-12] straight up: ruff format (#11330)
straight up: ruff format (#11329)

* straight up: ruff format

* Apply suggestions from code review

(cherry picked from commit d549baa5e1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-27 16:29:02 +01:00
patchback[bot]
18c53b8bd1 [PR #11325/04d0a4da backport][stable-12] lxc_container: rearrange docs notes (#11327)
lxc_container: rearrange docs notes (#11325)

* lxc_container: rearrange docs notes

* Update plugins/modules/lxc_container.py

* reformat docs

(cherry picked from commit 04d0a4daf3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-25 08:29:33 +01:00
patchback[bot]
bff9afc1f1 [PR #11323/ec6b7bf9 backport][stable-12] lxc_container: use tempfile.TemporaryDirectory (#11326)
lxc_container: use tempfile.TemporaryDirectory (#11323)

* lxc_container: use tempfile.TemporaryDirectory

* add changelog frag

* typo

(cherry picked from commit ec6b7bf91c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-25 08:29:23 +01:00
patchback[bot]
374ba70c37 [PR #11320/99b9680e backport][stable-12] Announce making all module utils, plugin utils, and doc fragments private (#11321)
Announce making all module utils, plugin utils, and doc fragments private (#11320)

Announce making all module utils, plugin utils, and doc fragments private.

(cherry picked from commit 99b9680ea2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-24 08:44:36 +01:00
Felix Fontein
9da26ea3eb Prepare 12.2.0. 2025-12-23 21:38:47 +01:00
patchback[bot]
c6689b6245 [PR #11316/3debc968 backport][stable-12] Fixing documentation for scaleway_private_network module. (#11319)
Fixing documentation for scaleway_private_network module. (#11316)

(cherry picked from commit 3debc968a4)

Co-authored-by: Greg Harvey <greg.harvey@gmail.com>
2025-12-23 14:20:00 +01:00
patchback[bot]
8860faaa1c [PR #11120/61b559c4 backport][stable-12] add sssd_info module (#11306)
add sssd_info module (#11120)

* add sssd_info module

* fix f-stings and remove support python2

* fix imports custom lib

* fix whitespace and add missing_required_lib

* fix str and add version

* try add mock test

* fix module and mock tests check

* fix required in main module

* fix spaces

* fix linters

* add final newline

* fix version of module

* fix description and error handling

* swap literal to dict

* fix str

* remove comment in methods

* remove _get in methods

* fix name method in test

* add botmeta

* fix description of server_type

* fix name of maintainer

* remove choices

* fix author

* fix type hint

* fix result

* fix spaces

* fix choices and empty returns

* fix mypy test result

* fix result

* run andebox yaml-doc

* remake simple try/exc for result

* fix tests

* add any type for testing mypy

* ruff formated

* fix docs

* remove unittest.main

* rename acc on git for official name

---------


(cherry picked from commit 61b559c4fd)

Co-authored-by: Aleksandr Gabidullin <101321307+a-gabidullin@users.noreply.github.com>
Co-authored-by: Александр Габидуллин <agabidullin@astralinux.ru>
2025-12-22 16:02:13 +01:00
patchback[bot]
824cb0e0a4 [PR #11304/02b18593 backport][stable-12] Remove unittest.main() calls (#11305)
Remove unittest.main() calls (#11304)

Remove unittest.main() calls.

(cherry picked from commit 02b185932c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-22 16:01:22 +01:00
patchback[bot]
78625d1cd2 [PR #11170/2c6746ff backport][stable-12] ip2location_info: New Module - ip2location.io for IP geolocation lookup (#11303)
ip2location_info: New Module - ip2location.io for IP geolocation lookup (#11170)

* Added ip2location.io for IP geolocation lookup.

* Removed tab in last line.

* Added "ip2location" as maintainer.

* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Update plugins/modules/ip2locationio_facts.py



* Added "typing" library.

* Updated import position.

* Reformatted.

* Added unit test.

* Updated documentation to add "ip" parameter.

* Renamed module from "ip2location_facts" to "ip2location_info".

* Updated version number.



* Update plugins/modules/ip2location_info.py



* Update plugins/modules/ip2location_info.py



* Updated return definition.

* Update BOTMETA.yml to latest module name.

* Update plugins/modules/ip2location_info.py



* Update plugins/modules/ip2location_info.py



* Removed extra parameter from "fetch_url".

* Fixed "test_ip2location_info.py" with formatter.

---------


(cherry picked from commit 2c6746ffa0)

Co-authored-by: IP2Location <support@ip2location.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-22 11:14:16 +01:00
patchback[bot]
a15ec28169 [PR #11285/a55884c9 backport][stable-12] Add support for missing validations in keycloak_userprofile (#11302)
Add support for missing validations in keycloak_userprofile (#11285)

* add missing validations-parameters as config options and add documentation for them; fixes https://github.com/ansible-collections/community.general/issues/9048

* fix parameter names

* extend unit tests

* support for camel casing for new validations and add changelog fragment

* Fix fragment format

* add 'version_added' documentation

* Update changelogs/fragments/11285-extended-keycloak-user-profile-validations.yml

mention fixed issue in fragment



* fix ruff formatting

---------


(cherry picked from commit a55884c921)

Co-authored-by: nwintering <33374766+nwintering@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-22 11:13:57 +01:00
patchback[bot]
12637fbd23 [PR #11295/a5aec7d6 backport][stable-12] Fix typo in auth_username in examples (#11300)
Fix typo in auth_username in examples (#11295)

(cherry picked from commit a5aec7d61a)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
2025-12-19 21:10:08 +01:00
patchback[bot]
21aa086ca6 [PR #11283/ef632145 backport][stable-12] Add more module_utils typing (#11289)
Add more module_utils typing (#11283)

Add more module_utils typing.

(cherry picked from commit ef632145e9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-17 21:24:55 +01:00
patchback[bot]
8590184232 [PR #11291/4632e3d5 backport][stable-12] aix_*: docs adjustments (#11292)
aix_*: docs adjustments (#11291)

(cherry picked from commit 4632e3d5ee)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-16 07:02:24 +01:00
patchback[bot]
19257bac40 [PR #11284/df349459 backport][stable-12] keycloak_authentication_required_actions: fix examples (#11288)
keycloak_authentication_required_actions: fix examples (#11284)

The correct parameter name is "required_actions" (plural).

(cherry picked from commit df34945991)

Co-authored-by: Samuli Seppänen <samuli.seppanen@puppeteers.net>
2025-12-15 19:25:06 +01:00
patchback[bot]
79120c0f96 [PR #11277/1b15e595 backport][stable-12] use FQCN for extending docs with files and url (#11281)
use FQCN for extending docs with files and url (#11277)

* use FQCN for extending docs with files and url

* remove typo

(cherry picked from commit 1b15e595e0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-14 12:31:44 +01:00
patchback[bot]
efe3462856 [PR #11276/a96a5c44 backport][stable-12] sysrc tests: skip FreeBSD 14.2 for ezjail tests (#11280)
sysrc tests: skip FreeBSD 14.2 for ezjail tests (#11276)

Looks like 14.2 no longer works.

(cherry picked from commit a96a5c44a5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-14 12:06:03 +01:00
patchback[bot]
0cff5dec9f [PR #11265/d4249071 backport][stable-12] apk: fix packages return value for apk-tools >= 3 (fix #11264) (#11272)
apk: fix packages return value for apk-tools >= 3 (fix #11264) (#11265)

* apk: fix packages return value for apk-tools >= 3 (fix #11264)

* Add changelog fragment

(cherry picked from commit d424907172)

Co-authored-by: s-hamann <10639154+s-hamann@users.noreply.github.com>
2025-12-10 13:40:05 +01:00
patchback[bot]
0280b1ca5d [PR #11255/ac37544c backport][stable-12] monit: investigating tests again - using copilot on this one (#11271)
monit: investigating tests again - using copilot on this one (#11255)

* add monit version to successful exit

* install the standard monit - if 5.34, then bail out

* add 3sec wait after service restart

- that restart happens exactly before the task receiving the SIGTERM, so maybe, just maybe, it just needs time to get ready for the party

* wait for monit initialisation after restart

* monit tests: check service-specific status in readiness wait

The wait task was checking 'monit status' (general), but the actual
failing command is 'monit status -B httpd_echo' (service-specific).
This causes a race where general status succeeds but service queries
fail. Update to check the exact command format that will be used.

* monit tests: remove 5.34.x version restriction

The version restriction was based on incorrect diagnosis. The actual
issue was the readiness check validating general status instead of
service-specific queries. Now that we check the correct command
format, the tests should work across all monit versions.

* monit tests: add stabilization delay after readiness check

After the readiness check succeeds, add a 1-second pause before
running actual tests. Monit 5.34.x and 5.35 appear to have a
concurrency issue where rapid successive 'monit status -B' calls
can cause hangs even though the first call succeeds.

* monit tests: add retry logic for state changes to handle monit daemon hangs

Monit daemon has an intermittent concurrency bug across versions 5.27-5.35
where 'monit status -B' commands can hang (receiving SIGTERM) even after
the daemon has successfully responded to previous queries. This appears
to be a monit daemon issue, not a timing problem.

Add retry logic with 2-second delays to the state change task to work
around these intermittent hangs. Skip retries if the failure is not
SIGTERM (rc=-15) to avoid masking real errors.

* monit tests: capture and display monit.log for debugging

Add tasks in the always block to capture and display the monit log file.
This will help diagnose the intermittent hanging issues by showing what
monit daemon was doing when 'monit status -B' commands hang.

* monit tests: enable verbose logging (-v flag)

Modify the monit systemd service to start with -v flag for verbose
logging. This should provide more detailed information in the monit
log about what's happening when status commands hang.

* monit: add 0.5s delay after state change command

After extensive testing and analysis with verbose logging enabled, identified
that monit's HTTP interface can become temporarily unresponsive immediately
after processing state change commands (stop, start, restart, etc.).

This manifests as intermittent SIGTERM (rc=-15) failures when the module
calls 'monit status -B <service>' to verify the state change. The issue
affects all monit versions tested (5.27-5.35) and is intermittent, suggesting
a race condition or brief lock in monit's HTTP request handling.

Verbose logging confirmed:
- State change commands complete successfully
- HTTP server reports as 'started'
- But subsequent status checks can hang without any log entry

Adding a 0.5 second sleep after sending state change commands gives the
monit daemon time to fully process the command and become responsive again
before the first status verification check.

This complements the existing readiness check after daemon restart and
the retry logic for SIGTERM failures in the tests.

* tests(monit): remove workarounds after module race condition fix

After 10+ successful CI runs with no SIGTERM failures, removing test-level
workarounds that are now redundant due to the 0.5s delay fix in the module:

- Remove 1-second stabilization pause after daemon restart
  The module's built-in 0.5s delay after state changes makes this unnecessary

- Remove retry logic for SIGTERM failures in state change tests
  The race condition is now prevented at the module level

- Remove verbose logging setup and log capture
  Verbose mode didn't log HTTP requests, so it didn't help diagnose the issue
  and adds unnecessary overhead

Kept the readiness check with retries after daemon restart - still needed
to validate daemon is responsive after service restart (different scenario
than the state change race condition).

* restore tasks/main.yml

* monit tests: reduce readiness check retries from 60 to 10

After successful CI runs, observed that monit daemon becomes responsive
within 1-2 seconds after restart. The readiness check typically passes
on the first attempt.

Reducing from 60 retries (30s timeout) to 10 retries (5s timeout) is
more appropriate and allows tests to fail faster if something is
genuinely broken.

* add changelog frag

* Update changelogs/fragments/11255-monit-integrationtests.yml



---------


(cherry picked from commit ac37544c53)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-10 13:39:54 +01:00
patchback[bot]
ab95360b97 [PR #11260/a977c6f7 backport][stable-12] fix(sanitize_cr): avoid crash when realmrep is empty (#11268)
fix(sanitize_cr): avoid crash when realmrep is empty (#11260)

* fix(docs): missing info on id when creating realms

* fix(sanitize_cr): avoid crash when realmrep is empty

* remove unrelated change

* remove unrelated change

* added changlog

* correct: changelogs

* Update changelogs



---------



(cherry picked from commit a977c6f7c1)

Co-authored-by: Guillaume Dorschner <44686652+GuillaumeDorschner@users.noreply.github.com>
Co-authored-by: Guillaume Dorschner <guillaume.dorschner@thalesgroup.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-08 23:06:16 +01:00
patchback[bot]
ae7656b8da [PR #11256/a9540f93 backport][stable-12] keycloak_user_rolemapping: fix: failling to assign role to user (#11263)
keycloak_user_rolemapping: fix: failling to assign role to user (#11256)

* docs: clarify keycloak documentation example section with uid

* fix: allow assign role to user

* Add changelog frag

* Update changelogs/fragments/11256-fix-keycloak-roles-mapping.yml



---------



(cherry picked from commit a9540f93d2)

Co-authored-by: Guillaume Dorschner <44686652+GuillaumeDorschner@users.noreply.github.com>
Co-authored-by: Guillaume Dorschner <guillaume.dorschner@thalesgroup.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-06 13:53:04 +01:00
patchback[bot]
216e9e28c3 [PR #11258/0ef3eac0 backport][stable-12] iptables_state: get rid of temporary files (#11262)
iptables_state: get rid of temporary files (#11258)

Get rid of temporary files.

(cherry picked from commit 0ef3eac0f4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-06 13:52:41 +01:00
patchback[bot]
7309650d26 [PR #11245/3d25aac9 backport][stable-12] monit: use enum (#11252)
monit: use enum (#11245)

* monit: use enum

* make mypy happy about the var type

* add changelog frag

* typo - this is getting frequent

(cherry picked from commit 3d25aac978)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-02 22:18:19 +01:00
patchback[bot]
ee2963d1ee [PR #11182/76589bd9 backport][stable-12] nmcli: allow VxLan multicast and bridge port (#11251)
nmcli: allow VxLan multicast and bridge port (#11182)

VxLan virtual devices can be added to bridge ports, like any other
devices. And when using multicast remote addresses,
NetworkManager need to know the parent device as well.


(cherry picked from commit 76589bd97a)

Co-authored-by: Tiziano Müller <tm@dev-zero.ch>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-02 21:41:33 +01:00
patchback[bot]
469ba26c8f [PR #11240/8d51c5f6 backport][stable-12] btrfs module utils: pass command as list to run_command() (#11248)
btrfs module utils: pass command as list to `run_command()` (#11240)

* btrfs module utils: pass command as list to run_command()

* add changelog frag

(cherry picked from commit 8d51c5f666)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-02 21:17:59 +01:00
patchback[bot]
5cb24c2599 [PR #11242/0a802ecd backport][stable-12] deps module util: use Enum to represent states (#11247)
deps module util: use Enum to represent states (#11242)

* deps module util: use Enum to represent states

* add changelog frag

(cherry picked from commit 0a802ecdcb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-02 21:17:43 +01:00
Felix Fontein
4621fce535 The next expected release will be 12.2.0. 2025-12-01 22:00:10 +01:00
Felix Fontein
f16dbd6b56 Release 12.1.0. 2025-12-01 21:22:38 +01:00
patchback[bot]
377a599372 [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243)
Add basic typing for module_utils (#11222)

* Add basic typing for module_utils.

* Apply some suggestions.



* Make pass again.

* Add more types as suggested.

* Normalize extra imports.

* Add more type hints.

* Improve typing.

* Add changelog fragment.

* Reduce changelog.

* Apply suggestions from code review.



* Fix typo.

* Cleanup.

* Improve types and make type checking happy.

* Let's see whether older Pythons barf on this.

* Revert "Let's see whether older Pythons barf on this."

This reverts commit 9973af3dbe.

* Add noqa.

---------


(cherry picked from commit c7f6a28d89)

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-01 21:16:37 +01:00
patchback[bot]
a2c7f9f89a [PR #11235/fb2f34ba backport][stable-12] Stop re-defining the argument spec in unit tests (#11239)
Stop re-defining the argument spec in unit tests (#11235)

* Stop re-defining the argument spec in unit tests.

* Shut up linter.

(cherry picked from commit fb2f34ba85)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-01 07:21:24 +01:00
patchback[bot]
3033dfa27c [PR #11231/16d51a82 backport][stable-12] remove % templating (#11237)
remove % templating (#11231)

* remove % templating

* add changelog frag

* suggestions from review

* remove unused import

(cherry picked from commit 16d51a8233)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-01 07:21:07 +01:00
patchback[bot]
721d2bd35d [PR #11198/6365b5a9 backport][stable-12] lxd_storage_pool_info, lxd_storage_volume_info: new modules (#11238)
lxd_storage_pool_info, lxd_storage_volume_info: new modules  (#11198)

* Fix mistaken rebase

* plugins/modules/lxd_storage_: include error codes, clean up notes

* plugins/modules/lxd_storage_: snap_url, ruff fix

* plugins/modules/lxd_storage_volume_info.py: remove checks on expected api returned bits

* plugins/modules/lxd_storage_volume_info.py: required: true

* tests/integration/targets/lxd_storage_volume_info/tasks/main.yaml: add Test fetching specific volume by name

* tests/unit/plugins/modules/test_lxd_storage_: add unit tests

* tests/integration/targets/lxd_storage_pool_info/tasks/main.yaml: add integratio tests

* tests/integration/targets/lxd_storage_: not required

* tests/integration/targets/lxd_storage_: not required perhaps, lxd_project has them

* tests/unit/plugins/modules/test_lxd_storage_volume_info.py: fix python3.8 tests

* tests/unit/plugins/modules/test_lxd_storage_pool_info.py: fix python3.8

* tests/integration/targets/lxd_storage_: correct paths for aliases

* tests/unit/plugins/modules/test_lxd_storage_volume_info.py: remove backticks

* tests/unit/plugins/modules/test_lxd_storage_volume_info.py: remove blank line

* tests/unit/plugins/modules/test_lxd_storage_: python3.8 changes

* tests/unit/plugins/modules/test_lxd_storage_: python3.8 changes

* tests/unit/plugins/lookup/test_github_app_access_token.py: restore

* tests/unit/plugins/connection/test_wsl.py: restore

* plugins/modules/lxd_storage_: use ANSIBLE_LXD_DEFAULT_SNAP_URL and put API version into const

* lxd_storage_volume_info: use recursion to gather all volume details

* tests/integration/targets/lxd_storage_volume_info/tasks/main.yaml: fix silet skipped failures

* tests/integration/targets/lxd_storage_pool_info/tasks/main.yaml: fix silet failures

* lxd_storage_pool_info: update to use recursion to gather all details in one shot

* Remove unnecessary change.

---------


(cherry picked from commit 6365b5a981)

Co-authored-by: Sean McAvoy <seanmcavoy@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-01 07:20:55 +01:00
Felix Fontein
42e2b5147f [stable-12] Remove no longer needed _mount module util (#11232) (#11236)
Remove no longer needed _mount module util (#11232)

Remove no longer needed _mount module util.

(cherry picked from commit d30428ac71)
2025-12-01 07:20:47 +01:00
patchback[bot]
3d42ad4c6c [PR #11172/ebcad7e6 backport][stable-12] zfs: mark change correctly when updating properties whose current value differs, even if they already have a non-default value (Fixes #11019) (#11234)
zfs: mark change correctly when updating properties whose current value differs, even if they already have a non-default value (Fixes #11019) (#11172)

* zfs - mark change correctly when updating properties whose current value differs, even if they already have a non-default value (https://github.com/ansible-collections/community.general/issues/11019).



* changelog: rename fragment to match PR number



* Update changelogs/fragments/11172-zfs-changed-extra-props.yml



---------



(cherry picked from commit ebcad7e6d1)

Signed-off-by: handisyde <github@handisyde.com>
Co-authored-by: Paul Mercier-Handisyde <33284285+handisyde@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-30 15:03:32 +01:00
patchback[bot]
fb00ba1b0a [PR #11229/f2783967 backport][stable-12] fix couple of f-string mishaps (#11230)
fix couple of f-string mishaps (#11229)

* fix couple of f-string mishaps

* add changelog frag

* fix insanity

(cherry picked from commit f27839673c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-30 08:38:34 +01:00
Felix Fontein
cdfc73b059 Prepare 12.1.0. 2025-11-30 08:37:19 +01:00
patchback[bot]
5b06814575 [PR #11199/22a4f8e2 backport][stable-12] Added support for Windows VM with Incus connection. (#11227)
Added support for Windows VM with Incus connection. (#11199)

* Added support for Windows VM with Incus connection.

* Update changelogs/fragments/11199-incus-windows.yml



* Attempt to fix the argument splitting.

* Only split on the first occurrence of the command argument

* Applying nox

---------


(cherry picked from commit 22a4f8e272)

Co-authored-by: Marc Olivier Bergeron <mbergeron28@proton.me>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 15:31:03 +01:00
patchback[bot]
69fc892002 [PR #11197/379db770 backport][stable-12] keycloak_realm: add webAuthnPolicyPasswordlessPasskeysEnabled param (#11228)
keycloak_realm: add webAuthnPolicyPasswordlessPasskeysEnabled param (#11197)

* keycloak_realm: add webAuthnPolicyPasswordlessPasskeysEnabled param

* Changelog Fragment - 11197

* Apply suggestions from code review



* Fix typo in changelog fragment filename

---------


(cherry picked from commit 379db770c5)

Co-authored-by: Christer Warén <cwchristerw@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 15:30:51 +01:00
patchback[bot]
8ae47d3a8d [PR #11223/d550baac backport][stable-12] fix ruff case UP031 (#11226)
fix ruff case UP031 (#11223)

* fix ruff case UP031

* refactor backslashout of f-string for the sake of old Pythons

* add changelog frag

* Update plugins/modules/imc_rest.py



* scaleway_user_data: fix bug and make it an f-string

* reformat

---------


(cherry picked from commit d550baacfa)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 14:16:53 +01:00
patchback[bot]
17d2a089a0 [PR #11224/1ab9be15 backport][stable-12] pushbullet: deprecation (#11225)
pushbullet: deprecation (#11224)

* pushbullet: deprecation

* add changelog frag

(cherry picked from commit 1ab9be152f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-27 22:08:36 +01:00
patchback[bot]
e4261abab0 [PR #11174/86d6ef8d backport][stable-12] Allow None value maximum_timeout for gitlab_runner (#11218)
Allow None value maximum_timeout for gitlab_runner (#11174)

* change maximum_timeout type to raw

* allow None value for maximum_timeout in update_runner

* add changelog

* update changelog fragment formatting

* convert maximum_timeout value of 0 to None

* fix sanity check errors

* add suggested doc changes

* Note version required for timeout disable

---------


(cherry picked from commit 86d6ef8d0e)

Co-authored-by: colin93 <33459498+colin93@users.noreply.github.com>
Co-authored-by: colin <cosulli3@jaguarlandrover.com>
2025-11-25 22:11:28 +01:00
patchback[bot]
cf94d4b01e [PR #11216/6b4100d7 backport][stable-12] CONTRIBUTING.md: fixes/improvements (#11221)
CONTRIBUTING.md: fixes/improvements (#11216)

* CONTRIBUTING.md: fixes/improvements

* Update CONTRIBUTING.md



---------


(cherry picked from commit 6b4100d70f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-25 22:10:45 +01:00
patchback[bot]
8930d03c7c [PR #11215/862fe79a backport][stable-12] fix ruff case SIM110 (#11217)
fix ruff case SIM110 (#11215)

* fix ruff case SIM110

* Update plugins/module_utils/xenserver.py



* add changelog frag

---------


(cherry picked from commit 862fe79a22)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-25 21:59:06 +01:00
patchback[bot]
e741e22ec4 [PR #11206/cbf13ab6 backport][stable-12] Fix crash in module_utils.datetime.fromtimestamp() (#11212)
Fix crash in module_utils.datetime.fromtimestamp() (#11206)

Fix crash in module_utils.datetime.fromtimestamp().

(cherry picked from commit cbf13ab6c9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-25 21:42:22 +01:00
patchback[bot]
1e9217197f [PR #11205/d364e354 backport][stable-12] Deprecate unused module utils (#11213)
Deprecate unused module utils (#11205)

Deprecate unused module utils.

(cherry picked from commit d364e35423)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-25 21:41:56 +01:00
patchback[bot]
8da2ff61d5 [PR #11179/ebb53416 backport][stable-12] mas: Fix parsing on mas 3.0.0+. (#11210)
mas: Fix parsing on mas 3.0.0+. (#11179)

* mas: Fix parsing on mas 3.0.0+.

`mas` changed the formatting of `mas list` with version 3, which breaks
the parsing this module uses to determine which apps are installed.  In
particular, app IDs may now have leading space, which causes us to split
the string too early.

* Changelog fragment.

* Better format examples and changlog fragment.

(cherry picked from commit ebb534166e)

Co-authored-by: Michael Galati <11300961+leetoburrito@users.noreply.github.com>
2025-11-25 06:43:06 +01:00
patchback[bot]
9c57bb4f60 [PR #11192/64dc009e backport][stable-12] solaris_zone: replace os.system() with run_command() (#11207)
solaris_zone: replace os.system() with run_command() (#11192)

* solaris_zone: replace os.system() with run_command()

* add changelog frag

(cherry picked from commit 64dc009ea7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-24 21:21:29 +01:00
patchback[bot]
f32bcd34ef [PR #11193/f2731e1d backport][stable-12] onepassword_info: replace subprocess.Popen() with run_command() (#11208)
onepassword_info: replace subprocess.Popen() with run_command() (#11193)

* onepassword_info: replace subprocess.Popen() with run_command()

* add changelog frag

* Update plugins/modules/onepassword_info.py



---------


(cherry picked from commit f2731e1dac)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-24 21:21:21 +01:00
patchback[bot]
cc7ba7938a [PR #11200/a8031562 backport][stable-12] Bump actions/checkout from 5 to 6 in the ci group (#11201)
Bump actions/checkout from 5 to 6 in the ci group (#11200)

Bumps the ci group with 1 update: [actions/checkout](https://github.com/actions/checkout).

Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ci
...



(cherry picked from commit a803156277)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 18:15:35 +01:00
patchback[bot]
c0684e8a72 [PR #11148/7321ba49 backport][stable-12] snmp_facts: improvements (#11196)
snmp_facts: improvements (#11148)

* snmp_facts: improvements

* require level if vesion=v3

(cherry picked from commit 7321ba4990)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-23 13:28:23 +01:00
patchback[bot]
f648dca84a [PR #11189/1c678f5c backport][stable-12] fix ruff case UP030 (#11195)
fix ruff case UP030 (#11189)

* fix ruff case UP030

* add changelog frag

* formatting

* suggestion from review

(cherry picked from commit 1c678f5c07)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-23 08:58:57 +01:00
patchback[bot]
084ecd96e1 [PR #11190/9a3e26ad backport][stable-12] fix ruff case SIM112 (#11194)
fix ruff case SIM112 (#11190)

(cherry picked from commit 9a3e26ad98)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-23 08:58:35 +01:00
patchback[bot]
9cdeb5a9b9 [PR #11167/19757b3a backport][stable-12] Add type hints to action and test plugins and to plugin utils; fix some bugs, and improve input validation (#11191)
Add type hints to action and test plugins and to plugin utils; fix some bugs, and improve input validation (#11167)

* Add type hints to action and test plugins and to plugin utils. Also fix some bugs and add proper input validation.

* Combine lines.



* Extend changelog fragment.

* Move task_vars initialization up.

---------


(cherry picked from commit 19757b3a4c)

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-23 08:36:34 +01:00
patchback[bot]
dbcd0dc497 [PR #11185/4517b86e backport][stable-12] snmp_facts: update docs with dependency constraint (#11187)
snmp_facts: update docs with dependency constraint (#11185)

(cherry picked from commit 4517b86ed4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-22 22:44:03 +01:00
patchback[bot]
0e73d6a593 [PR #11168/e57de70c backport][stable-12] Address UP014: use NamedTuple class syntax (#11183)
Address UP014: use NamedTuple class syntax (#11168)

* Address UP014: use NamedTuple class syntax.

* Convert type comments to type hints.

(cherry picked from commit e57de70c2a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-21 18:42:35 +01:00
patchback[bot]
c9df20808d [PR #11032/af99cc7d backport][stable-12] Add New Module file_remove (#11184)
Add New Module file_remove (#11032)

* Add New Module file_remove

* Add fixes from code review

* Change file_type documentation

* Remove python to_native from the module

* Remove redundant block/always cleanup

* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



* Add more nox fixes to latest review

* Update plugins/modules/file_remove.py

LGTM



* Update tests/integration/targets/file_remove/tasks/main.yml

Right, that's better.



* Fix EXAMPLES regex pattern

* Add warning when listed file was removed by other process during
playbook execution

* remove raise exception from find_matching_files;

* Update plugins/modules/file_remove.py



* Update plugins/modules/file_remove.py



---------


(cherry picked from commit af99cc7deb)

Co-authored-by: Shahar Golshani <sgolshan@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-21 18:33:37 +01:00
Felix Fontein
649b32759b [stable-12] docs: migrate RTD URLs to docs.ansible.com (#11109) (#11175)
docs: migrate RTD URLs to docs.ansible.com (#11109)

* docs: update readthedocs.io URLs to docs.ansible.com equivalents

🤖 Generated with Claude Code
https://claude.ai/code



* Adjust favicon URL.



---------




(cherry picked from commit d98df2d3a5)

Co-authored-by: John Barker <john@johnrbarker.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
2025-11-19 18:22:29 +01:00
patchback[bot]
9d7855b844 [PR #11149/79b16d9c backport][stable-12] fix return value exception (#11173)
fix return value `exception` (#11149)

* fix return value `exception`

* add changelog frag

* adjustments after review

* typo

* adjust changelog frag

* vmadm: send rc, stdout, and stderr to fail_json()

* rundeck: pass tracebacks

* Update changelogs/fragments/11149-rv-exception.yml



* Update changelogs/fragments/11149-rv-exception.yml



---------


(cherry picked from commit 79b16d9ca5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-18 17:57:16 +01:00
patchback[bot]
4480036401 [PR #11169/a986d81c backport][stable-12] dconf: doc typo (#11171)
dconf: doc typo (#11169)

(cherry picked from commit a986d81c3d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-17 07:09:50 +01:00
patchback[bot]
5ae8d2ccec [PR #11107/e20e32bb backport][stable-12] Extend failure message for merge_variables type detection (#11166)
Extend failure message for merge_variables type detection (#11107)

merge_variables: extend type detection failure message

Update the error message for the merge_variables lookup plugin in case an unsupported type is passed.

(cherry picked from commit e20e32bb87)

Co-authored-by: Roy Lenferink <lenferinkroy@gmail.com>
2025-11-17 06:47:04 +01:00
patchback[bot]
1f9d6787fb [PR #11046/98aca27a backport][stable-12] locale_gen: search for available locales in /usr/local as well (#11163)
locale_gen: search for available locales in /usr/local as well (#11046)

* locale_gen: search for available locales in /usr/local as well

* better var name

* add test for /usr/local

* Apply suggestions from code review



* skip /usr/local/ for Archlinux

* improve/update documentation

* add license file for the custom locale

* add changelog frag

* Update plugins/modules/locale_gen.py



* Update changelogs/fragments/11046-locale-gen-usrlocal.yml



---------


(cherry picked from commit 98aca27a8b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-17 06:46:42 +01:00
patchback[bot]
95175e056f [PR #11069/6c1676fc backport][stable-12] spotinst_aws_elastigroup: deprecation (#11103)
spotinst_aws_elastigroup: deprecation (#11069)

* spotinst_aws_elastigroup: deprecation

* add changelog frag

* add missing URL to chglog

* Update changelogs/fragments/11069-deprecate-spotinst.yml



* Update meta/runtime.yml



* Update plugins/modules/spotinst_aws_elastigroup.py



---------


(cherry picked from commit 6c1676fcbb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-17 06:46:27 +01:00
patchback[bot]
44960de208 [PR #11087/6e1cc3ea backport][stable-12] swupd: deprecation (#11099)
swupd: deprecation (#11087)

* swupd: deprecation

* add changelog frag

* Update changelogs/fragments/11087-deprecate-swupd.yml



* Update meta/runtime.yml



* Update plugins/modules/swupd.py



---------


(cherry picked from commit 6e1cc3eafd)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-17 06:45:55 +01:00
patchback[bot]
7c46b7edbc [PR #11088/7f47deed backport][stable-12] dconf: deprecate fallback mechanism (#11094)
dconf: deprecate fallback mechanism (#11088)

* dconf: deprecate fallback mechanism

* add changelog frag

(cherry picked from commit 7f47deed64)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-17 06:45:44 +01:00
patchback[bot]
2fa8179df2 [PR #11070/37297f38 backport][stable-12] layman: deprecation (#11096)
layman: deprecation (#11070)

* layman: deprecation

* add changelog frag

* Update changelogs/fragments/11070-deprecate-layman.yml



---------


(cherry picked from commit 37297f38ae)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-17 06:45:30 +01:00
patchback[bot]
8a7f360558 [PR #11143/23e81b8d backport][stable-12] replace redundant to_native()/to_text() occurrences, batch 8 (#11164)
replace redundant to_native()/to_text() occurrences, batch 8 (#11143)

* replace redundant to_native()/to_text() occurrences, batch 8

* add changelog frag

* Update plugins/modules/jira.py



---------


(cherry picked from commit 23e81b8d30)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-16 07:09:40 +01:00
patchback[bot]
15d4fff749 [PR #11144/5617d57c backport][stable-12] xcc_redfish_command: fix messages showing dict keys (#11162)
xcc_redfish_command: fix messages showing dict keys (#11144)

* xcc_redfish_command: fix messages showing dict keys

* add changelog frag

* Update plugins/modules/xcc_redfish_command.py



* Update plugins/modules/xcc_redfish_command.py



* Apply suggestions from code review

* Update plugins/modules/xcc_redfish_command.py

---------


(cherry picked from commit 5617d57c8c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-15 23:17:16 +01:00
patchback[bot]
6d582acb26 [PR #11159/6bf0780d backport][stable-12] xfconf: update state=absent doc (#11160)
xfconf: update state=absent doc (#11159)

(cherry picked from commit 6bf0780d23)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-15 21:11:12 +01:00
patchback[bot]
4044998ff5 [PR #11154/53c62e7a backport][stable-12] Fix snmp_facts return value docs (#11158)
Fix snmp_facts return value docs (#11154)

Fix snmp_facts return value docs.

(cherry picked from commit 53c62e7a43)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-14 18:47:11 +01:00
patchback[bot]
b35f138976 [PR #11155/f401c68d backport][stable-12] remove redundant line from ruff.toml (#11156)
remove redundant line from ruff.toml (#11155)

(cherry picked from commit f401c68df3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-14 07:36:10 +01:00
patchback[bot]
8fd40ed9e4 [PR #11150/32f0ad2f backport][stable-12] Fixed typo in decompress example documentation (#11153)
Fixed typo in decompress example documentation (#11150)

(cherry picked from commit 32f0ad2f97)

Co-authored-by: Thomas Löhr <tlhr@users.noreply.github.com>
2025-11-13 23:11:50 +01:00
patchback[bot]
02de34c46b [PR #11147/183aa6ed backport][stable-12] fix markup (#11151)
fix markup (#11147)

* fix markup for common return values

* Apply suggestion from review

(cherry picked from commit 183aa6ed6b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-13 19:42:08 +01:00
patchback[bot]
0813907a89 [PR #11145/255059f7 backport][stable-12] fix ruff case B015 (#11146)
fix ruff case B015 (#11145)

* fix ruff case B015

* add changelog frag

(cherry picked from commit 255059f7b3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-13 06:30:21 +01:00
patchback[bot]
04fb53e8a3 [PR #11112/f5c2c8b9 backport][stable-12] replace redundant to_native()/to_text() occurrences, batch 7 (#11142)
replace redundant to_native()/to_text() occurrences, batch 7 (#11112)

* replace redundant to_native()/to_text() occurrences, batch 7

* add changelog frag

* made changes per review

(cherry picked from commit f5c2c8b9a2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-13 06:09:17 +01:00
patchback[bot]
f1d9a2b134 [PR #11110/996d9a7f backport][stable-12] replace batch 6 of redundant to_native()/to_text() occurrences (#11141)
replace batch 6 of redundant to_native()/to_text() occurrences (#11110)

* replace batch 6 of redundant to_native()/to_text() occurrences

* add changelog frag

(cherry picked from commit 996d9a7f63)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:59:18 +01:00
patchback[bot]
619ea5b7b3 [PR #11106/f785e9c7 backport][stable-12] replace batch of redundant to_native()/to_text() occurrences (#11140)
replace batch of redundant to_native()/to_text() occurrences (#11106)

* replace batch of redundant to_native()/to_text() occurrences

* add changelog frag

* snap sanity

* rolling back snap for now

* more cases in redhat_subscription

(cherry picked from commit f785e9c780)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:59:09 +01:00
patchback[bot]
4b9ece4fbd [PR #11105/9b886739 backport][stable-12] replace batch of redundant to_native()/to_text() occurrences (#11139)
replace batch of redundant to_native()/to_text() occurrences (#11105)

* replace batch of redundant to_native()/to_text() occurrences

* add changelog frag

(cherry picked from commit 9b8867399e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:59:03 +01:00
patchback[bot]
31f0087da9 [PR #11104/4171b8a9 backport][stable-12] replace batch of redundant to_native()/to_text() occurrences (#11138)
replace batch of redundant to_native()/to_text() occurrences (#11104)

* replace batch of redundant to_native()/to_text() occurrences

* add changelog frag

(cherry picked from commit 4171b8a9ab)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:58:55 +01:00
patchback[bot]
50ae8fd7ae [PR #11102/e5ee3eb8 backport][stable-12] replace batch of redundant to_native() occurrences (#11137)
replace batch of redundant to_native() occurrences (#11102)

* replace batch of redundant to_native() occurrences

* add changelog frag

* Update plugins/modules/idrac_redfish_config.py



* reformat

* Apply suggestions from code review



* Update plugins/modules/dimensiondata_network.py



---------


(cherry picked from commit e5ee3eb88b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 21:58:44 +01:00
patchback[bot]
b72e38c909 [PR #11115/58bb1e7c backport][stable-12] fix ruff case B007 (#11131)
fix ruff case B007 (#11115)

* fix ruff case B007

* rollback inventory/iocage

* re-do the fix in inventory/iocage

* add cases in tests/unit/plugins

* rollback plugins/module_utils/memset.py

* rollback extraneous changes in plugins/modules/xcc_redfish_command.py

* add changelog frag

(cherry picked from commit 58bb1e7c04)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:58:36 +01:00
patchback[bot]
42997e2d28 [PR #11135/ec091060 backport][stable-12] ruff: remove ignore entry B904 (raise without from inside except) (#11136)
ruff: remove ignore entry B904 (raise without from inside except) (#11135)

Remove ignore entry.

(cherry picked from commit ec091060d7)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 21:38:43 +01:00
patchback[bot]
6df72406c5 [PR #11122/2dfb46a4 backport][stable-12] remove ignore lines for Python 2 (#11134)
remove ignore lines for Python 2 (#11122)

* remove ignore lines for Python 2

* use yield from

* add changelog frag

* Update changelogs/fragments/11122-yield-from-ignore.yml



---------


(cherry picked from commit 2dfb46a4a6)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 21:36:26 +01:00
patchback[bot]
93d23cfef6 [PR #11119/41923e43 backport][stable-12] fix ruff case SIM103 (#11132)
fix ruff case SIM103 (#11119)

* fix ruff case SIM103

* add changelog frag

(cherry picked from commit 41923e43bd)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:32:10 +01:00
patchback[bot]
ac6c6df2c7 [PR #11121/c45fba54 backport][stable-12] fix ruff case E721 (#11133)
fix ruff case E721 (#11121)

* fix ruff case E721

* add changelog frag

(cherry picked from commit c45fba549f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-12 21:31:22 +01:00
patchback[bot]
1d28e48d85 [PR #11097/40aea793 backport][stable-12] Use raise from in modules (#11130)
Use raise from in modules (#11097)

* Use raise from.

* Add changelog fragment.

* Add comment.

(cherry picked from commit 40aea793ee)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 21:31:11 +01:00
patchback[bot]
cc93dab0fd [PR #11095/2b4333a0 backport][stable-12] Use raise from in plugins (#11129)
Use raise from in plugins (#11095)

* Use raise from.

* Add changelog fragment.

(cherry picked from commit 2b4333a033)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 21:00:39 +01:00
patchback[bot]
cddb570e0e [PR #11123/1a82e93c backport][stable-12] Re-enable Copr integration tests (#11126)
Re-enable Copr integration tests (#11123)

Fixes: https://github.com/ansible-collections/community.general/issues/10987
(cherry picked from commit 1a82e93c6d)

Co-authored-by: Maxwell G <maxwell@gtmx.me>
2025-11-12 19:19:56 +01:00
patchback[bot]
c573891160 [PR #11045/6f11d750 backport][stable-12] Use Cobbler API version format to check version (#11117)
Use Cobbler API version format to check version (#11045)

* Use Cobbler API version format to check version

Cobbler use the formula below to return the version:

float(format(int(elems[0]) + 0.1 * int(elems[1]) + 0.001 * int(elems[2]), '.3f'))

Which means that 3.3.7 is changed to 3.307 which is > 3.4.

* Compare Cobbler version as a float

* Remove LooseVersion import

(cherry picked from commit 6f11d75047)

Co-authored-by: Bruno Travouillon <devel@travouillon.fr>
2025-11-12 06:54:04 +01:00
patchback[bot]
6481c4edfa [PR #11111/62492fe7 backport][stable-12] Add ignore.txt entries for bad-return-value-key (#11113)
Add ignore.txt entries for bad-return-value-key (#11111)

Add ignore.txt entries.

(cherry picked from commit 62492fe742)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-12 06:39:27 +01:00
patchback[bot]
768f16e9c4 [PR #11093/3b700f09 backport][stable-12] yum_versionlock: remove to_native() around command output (#11101)
yum_versionlock: remove to_native() around command output (#11093)

* yum_versionlock: remove redundant use of to_native() around command output

* reformat

* add changelog frag

(cherry picked from commit 3b700f0998)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-11 07:23:19 +01:00
patchback[bot]
d487734fea [PR #11098/634be713 backport][stable-12] replace batch of redundant to_native() occurrences (#11100)
replace batch of redundant to_native() occurrences (#11098)

* replace batch of redundant to_native() occurrences

* add changelog frag

(cherry picked from commit 634be713bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-11 07:23:07 +01:00
patchback[bot]
5be39ee0c3 [PR #11089/c26a4e61 backport][stable-12] consul_kv: adjust RV in docs (#11092)
consul_kv: adjust RV in docs (#11089)

(cherry picked from commit c26a4e613b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-11 06:09:19 +01:00
patchback[bot]
9db4aad986 [PR #11078/dcb580c4 backport][stable-12] discard Python 2 ssl handling (#11086)
discard Python 2 ssl handling (#11078)

* discard Python 2 ssl handling

* add changelog frag

* Apply suggestion



---------


(cherry picked from commit dcb580c41d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-10 21:50:40 +01:00
Felix Fontein
b593c673b1 The next release will be 12.0.2 or 12.1.0. 2025-11-10 21:50:32 +01:00
Felix Fontein
9c143467f8 Release 12.0.1. 2025-11-10 21:01:43 +01:00
patchback[bot]
d13cc08efa [PR #11081/e8bdf466 backport][stable-12] Migrate 1 RTD URLs to docs.ansible.com (#11082)
Migrate 1 RTD URLs to docs.ansible.com (#11081)

Migrate RTD URLs to docs.ansible.com

Updated 1 ansible.readthedocs.io URLs to docs.ansible.com equivalents
as part of the Read the Docs migration.

🤖 Generated with Claude Code
https://claude.ai/code


(cherry picked from commit e8bdf46627)

Co-authored-by: John Barker <john@johnrbarker.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-10 20:35:22 +01:00
patchback[bot]
1559a378b1 [PR #11076/8b1d725f backport][stable-12] irc: use True instead of 1 (#11084)
irc: use True instead of 1 (#11076)

* irc: use True instead of 1

* add changelog frag

(cherry picked from commit 8b1d725fb2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-10 20:34:57 +01:00
patchback[bot]
1951f70c00 [PR #11072/b5157b68 backport][stable-12] opendj_backendprop: use check_rc (#11077)
opendj_backendprop: use check_rc (#11072)

* opendj_backendprop: use check_rc

* add changelog frag

(cherry picked from commit b5157b68ba)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-10 20:34:42 +01:00
patchback[bot]
a78d0d2263 [PR #11031/3cbe44e2 backport][stable-12] Update TSS lookup plugin documentation and add Delinea Platform authentication examples (#11074)
Update TSS lookup plugin documentation and add Delinea Platform authentication examples (#11031)

* - Update documentation from Thycotic to Delinea branding
- Add comprehensive Platform authentication examples
- Enhance existing examples with clearer task names
- Improve RETURN section documentation
- Fix AccessTokenAuthorizer initialization with base_url parameter
- Add support for both Secret Server and Platform authentication methods

* Fixed lintitng issue and added changelog fragment file.

* Removed documentation changes from changelog file.

(cherry picked from commit 3cbe44e269)

Co-authored-by: delinea-sagar <131447653+delinea-sagar@users.noreply.github.com>
2025-11-10 06:47:46 +01:00
patchback[bot]
692f5f603c [PR #11071/60828e82 backport][stable-12] smartos imgadm man page reference (#11075)
smartos imgadm man page reference (#11071)

(cherry picked from commit 60828e82a4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-10 06:47:37 +01:00
Felix Fontein
ded373a0e7 Prepare 12.0.1. 2025-11-09 21:34:14 +01:00
patchback[bot]
aeded21682 [PR #11052/0175d75a backport][stable-12] dnsimple_info: minor improvements (#11068)
dnsimple_info: minor improvements (#11052)

* dnsimple_info: minor improvements

* add changelog frag

* typo

* Update plugins/modules/dnsimple_info.py



---------


(cherry picked from commit 0175d75a7c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-09 17:19:40 +00:00
patchback[bot]
bb926e462f [PR #11066/5ea1dee3 backport][stable-12] oneview: remove superfluous parts from unit test (#11067)
oneview: remove superfluous parts from unit test (#11066)

Remove superfluous parts from unit test.

(cherry picked from commit 5ea1dee3ea)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-09 10:10:11 +01:00
patchback[bot]
8cd80d94a0 [PR #11049/396f467b backport][stable-12] Improve Python code: address unused variables (#11058)
Improve Python code: address unused variables (#11049)

* Address F841 (unused variable).

* Reformat.

* Add changelog fragment.

* More cleanup.

* Remove trailing whitespace.

* Readd removed code as a comment with TODO.

(cherry picked from commit 396f467bbb)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-09 09:59:42 +01:00
patchback[bot]
1eca76969a [PR #11055/a9a4f890 backport][stable-12] remove required=false from docs (#11065)
remove required=false from docs (#11055)

(cherry picked from commit a9a4f89033)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-09 09:59:07 +01:00
patchback[bot]
b732bd5b9e [PR #11054/49c7253f backport][stable-12] zfs_facts: use check_rc (#11059)
zfs_facts: use check_rc (#11054)

* zfs_facts: use check_rc

* add changelog frag

(cherry picked from commit 49c7253f24)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-09 09:58:24 +01:00
patchback[bot]
473e1f92e2 [PR #11053/ac4f657d backport][stable-12] opendj_backendprop: docs improvements (#11060)
opendj_backendprop: docs improvements (#11053)

(cherry picked from commit ac4f657d43)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-09 09:58:15 +01:00
patchback[bot]
e304709d8e [PR #11057/0d8521c7 backport][stable-12] supervisorctl: investigate integration tests (#11062)
supervisorctl: investigate integration tests (#11057)

* supervisorctl: investigate integration tests

* wait for supervisord to complete stop

* adjust in module

(cherry picked from commit 0d8521c718)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-09 09:58:07 +01:00
patchback[bot]
caebf65948 [PR #11048/ebf45260 backport][stable-12] remove conditional code for old snakes (#11050)
remove conditional code for old snakes (#11048)

* remove conditional code for old snakes

* remove conditional code for old snakes

* reformat

* add changelog frag

(cherry picked from commit ebf45260ce)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-08 20:55:09 +01:00
patchback[bot]
16f1d07509 [PR #11043/3478863e backport][stable-12] Address issues reported by ruff check (#11047)
Address issues reported by ruff check (#11043)

* Resolve E713 and E714 (not in/is tests).

* Address UP018 (unnecessary str call).

* UP045 requires Python 3.10+.

* Address UP007 (X | Y for type annotations).

* Address UP035 (import Callable from collections.abc).

* Address UP006 (t.Dict -> dict).

* Address UP009 (UTF-8 encoding comment).

* Address UP034 (extraneous parantheses).

* Address SIM910 (dict.get() with None default).

* Address F401 (unused import).

* Address UP020 (use builtin open).

* Address B009 and B010 (getattr/setattr with constant name).

* Address SIM300 (Yoda conditions).

* UP029 isn't in use anyway.

* Address FLY002 (static join).

* Address B034 (re.sub positional args).

* Address B020 (loop variable overrides input).

* Address B017 (assert raise Exception).

* Address SIM211 (if expression with false/true).

* Address SIM113 (enumerate for loop).

* Address UP036 (sys.version_info checks).

* Remove unnecessary UP039.

* Address SIM201 (not ==).

* Address SIM212 (if expr with twisted arms).

* Add changelog fragment.

* Reformat.

(cherry picked from commit 3478863ef0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-08 09:49:52 +01:00
patchback[bot]
11b802372b [PR #11033/f5943201 backport][stable-12] filesystem: xfs resize: minimal required increment (#11041)
filesystem: xfs resize: minimal required increment (#11033)

Internally XFS uses allocation groups. Allocation groups have a maximum
size of 1 TiB - 1 block. For devices >= 4 TiB XFS uses max size
allocation groups. If a filesystem is extended and the last allocation
group is already at max size, a new allocation group is added. An
allocation group seems to require at least 64 4 KiB blocks.

For devices with integer TiB size (>4), this creates a filesystem that
has initially has 1 unused block per TiB size. The `resize` option
detects this unused space, and tries to resize the filesystem.  The
xfs_growfs call is successful (exit 0), but does not increase the file
system size. This is detected as repeated change in the task.

Test case:
```
- hosts: localhost
  tasks:
    - ansible.builtin.command:
        cmd: truncate -s 4T /media/xfs.img
        creates: /media/xfs.img
      notify: loopdev xfs

    - ansible.builtin.meta: flush_handlers

    - name: pickup xfs.img resize
      ansible.builtin.command:
        cmd: losetup -c /dev/loop0
      changed_when: false

    - community.general.filesystem:
        dev: "/dev/loop0"
        fstype: "xfs"

    - ansible.posix.mount:
        src: "/dev/loop0"
        fstype: "xfs"
        path: "/media/xfs"
        state: "mounted"

    # always shows a diff even for newly created filesystems
    - community.general.filesystem:
        dev: "/dev/loop0"
        fstype: "xfs"
        resizefs: true

  handlers:
    - name: loopdev xfs
      ansible.builtin.command:
        cmd: losetup /dev/loop0 /media/xfs.img
```

NB: If the last allocation group is not yet at max size, the filesystem
can be resized. Detecting this requires considering the XFS topology.
Other filesystems (at least ext4) also seem to require a minimum
increment after the initial device size, but seem to use the entire
device after initial creation.

Fun observation: creating a 64(+) TiB filesystem leaves a 64(+) block
gap at the end, that is allocated in a subsequent xfs_growfs call.


(cherry picked from commit f5943201b9)

Co-authored-by: jnaab <25617714+jnaab@users.noreply.github.com>
Co-authored-by: Johannes Naab <johannes.naab@hetzner-cloud.de>
2025-11-07 21:45:06 +01:00
patchback[bot]
d5b657d872 [PR #11037/c984b896 backport][stable-12] docs style adjustments (#11038)
docs style adjustments (#11037)

docs adjustments

(cherry picked from commit c984b89667)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-07 06:48:36 +01:00
patchback[bot]
855a8504d5 [PR #11029/3c42ec73 backport][stable-12] remove extraneous whitespaces (#11035)
remove extraneous whitespaces (#11029)

* remove extraneous whitespaces

* ruff format

* add changelog frag

(cherry picked from commit 3c42ec730d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-11-05 22:42:14 +01:00
patchback[bot]
c8ad571e27 [PR #11030/b471a4a9 backport][stable-12] Fix typing failure in CI (#11034)
Fix typing failure in CI (#11030)

* Fix typing failure in CI.

* Add changelog fragment.

(cherry picked from commit b471a4a90d)

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-05 22:26:39 +01:00
Felix Fontein
a22c77ab75 The next release will likely be 12.0.1. 2025-11-03 19:46:05 +01:00
686 changed files with 9228 additions and 4920 deletions

View File

@@ -11,8 +11,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl
It is up to pipeline authors to avoid name collisions when deviating from the recommended format.
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from __future__ import annotations
import os
import re
@@ -24,12 +23,12 @@ def main():
"""Main program entry point."""
source_directory = sys.argv[1]
if '/ansible_collections/' in os.getcwd():
if "/ansible_collections/" in os.getcwd():
output_path = "tests/output"
else:
output_path = "test/results"
destination_directory = os.path.join(output_path, 'coverage')
destination_directory = os.path.join(output_path, "coverage")
if not os.path.exists(destination_directory):
os.makedirs(destination_directory)
@@ -38,27 +37,27 @@ def main():
count = 0
for name in os.listdir(source_directory):
match = re.search('^Coverage (?P<attempt>[0-9]+) (?P<label>.+)$', name)
label = match.group('label')
attempt = int(match.group('attempt'))
match = re.search("^Coverage (?P<attempt>[0-9]+) (?P<label>.+)$", name)
label = match.group("label")
attempt = int(match.group("attempt"))
jobs[label] = max(attempt, jobs.get(label, 0))
for label, attempt in jobs.items():
name = 'Coverage {attempt} {label}'.format(label=label, attempt=attempt)
name = "Coverage {attempt} {label}".format(label=label, attempt=attempt)
source = os.path.join(source_directory, name)
source_files = os.listdir(source)
for source_file in source_files:
source_path = os.path.join(source, source_file)
destination_path = os.path.join(destination_directory, source_file + '.' + label)
destination_path = os.path.join(destination_directory, source_file + "." + label)
print('"%s" -> "%s"' % (source_path, destination_path))
shutil.copyfile(source_path, destination_path)
count += 1
print('Coverage file count: %d' % count)
print('##vso[task.setVariable variable=coverageFileCount]%d' % count)
print('##vso[task.setVariable variable=outputPath]%s' % output_path)
print("Coverage file count: %d" % count)
print("##vso[task.setVariable variable=coverageFileCount]%d" % count)
print("##vso[task.setVariable variable=outputPath]%s" % output_path)
if __name__ == '__main__':
if __name__ == "__main__":
main()

View File

@@ -34,8 +34,8 @@ class Args:
def parse_args() -> Args:
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--dry-run', action='store_true')
parser.add_argument('path', type=pathlib.Path)
parser.add_argument("-n", "--dry-run", action="store_true")
parser.add_argument("path", type=pathlib.Path)
args = parser.parse_args()
@@ -48,12 +48,14 @@ def parse_args() -> Args:
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
processed = []
for file in directory.joinpath('reports').glob('coverage*.xml'):
name = file.stem.replace('coverage=', '')
for file in directory.joinpath("reports").glob("coverage*.xml"):
name = file.stem.replace("coverage=", "")
# Get flags from name
flags = name.replace('-powershell', '').split('=') # Drop '-powershell' suffix
flags = [flag if not flag.startswith('stub') else flag.split('-')[0] for flag in flags] # Remove "-01" from stub files
flags = name.replace("-powershell", "").split("=") # Drop '-powershell' suffix
flags = [
flag if not flag.startswith("stub") else flag.split("-")[0] for flag in flags
] # Remove "-01" from stub files
processed.append(CoverageFile(name, file, flags))
@@ -64,14 +66,16 @@ def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], d
for file in files:
cmd = [
str(codecov_bin),
'--name', file.name,
'--file', str(file.path),
"--name",
file.name,
"--file",
str(file.path),
]
for flag in file.flags:
cmd.extend(['--flags', flag])
cmd.extend(["--flags", flag])
if dry_run:
print(f'DRY-RUN: Would run command: {cmd}')
print(f"DRY-RUN: Would run command: {cmd}")
continue
subprocess.run(cmd, check=True)
@@ -79,11 +83,11 @@ def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], d
def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = False) -> None:
if dry_run:
print(f'DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}')
print(f"DRY-RUN: Would download {url} to {dest} and set mode to {flags:o}")
return
with urllib.request.urlopen(url) as resp:
with dest.open('w+b') as f:
with dest.open("w+b") as f:
# Read data in chunks rather than all at once
shutil.copyfileobj(resp, f, 64 * 1024)
@@ -92,14 +96,14 @@ def download_file(url: str, dest: pathlib.Path, flags: int, dry_run: bool = Fals
def main():
args = parse_args()
url = 'https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov'
with tempfile.TemporaryDirectory(prefix='codecov-') as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / 'codecov'
url = "https://ansible-ci-files.s3.amazonaws.com/codecov/linux/codecov"
with tempfile.TemporaryDirectory(prefix="codecov-") as tmpdir:
codecov_bin = pathlib.Path(tmpdir) / "codecov"
download_file(url, codecov_bin, 0o755, args.dry_run)
files = process_files(args.path)
upload_files(codecov_bin, files, args.dry_run)
if __name__ == '__main__':
if __name__ == "__main__":
main()

View File

@@ -5,8 +5,7 @@
"""Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from __future__ import annotations
import sys
import time
@@ -16,14 +15,14 @@ def main():
"""Main program entry point."""
start = time.time()
sys.stdin.reconfigure(errors='surrogateescape')
sys.stdout.reconfigure(errors='surrogateescape')
sys.stdin.reconfigure(errors="surrogateescape")
sys.stdout.reconfigure(errors="surrogateescape")
for line in sys.stdin:
seconds = time.time() - start
sys.stdout.write('%02d:%02d %s' % (seconds // 60, seconds % 60, line))
sys.stdout.write("%02d:%02d %s" % (seconds // 60, seconds % 60, line))
sys.stdout.flush()
if __name__ == '__main__':
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,34 @@
{
"name": "community.general devcontainer",
"image": "mcr.microsoft.com/devcontainers/python:3.14-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true
},
"extensions": [
"charliermarsh.ruff",
"ms-python.python",
"ms-python.vscode-pylance",
"redhat.ansible",
"redhat.vscode-yaml",
"trond-snekvik.simple-rst",
]
}
},
"remoteUser": "vscode",
"postCreateCommand": ".devcontainer/setup.sh",
"workspaceFolder": "/workspace/ansible_collections/community/general",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/ansible_collections/community/general,type=bind"
}

View File

@@ -0,0 +1,3 @@
GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https: //www.gnu.org/licenses/gpl-3.0.txt)
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>

View File

@@ -0,0 +1,10 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>
nox
ruff
antsibull-nox
pre-commit
ansible-core
andebox

16
.devcontainer/setup.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
sudo chown -R vscode:vscode /workspace/
pip install -U pip
pip install -r .devcontainer/requirements-dev.txt
pip install -r tests/unit/requirements.txt
export ANSIBLE_COLLECTIONS_PATH=/workspace:${ANSIBLE_COLLECTIONS_PATH}
ansible-galaxy collection install -v -r tests/unit/requirements.yml
ansible-galaxy collection install -v -r tests/integration/requirements.yml
pre-commit install

View File

@@ -10,3 +10,4 @@ eaa5e07b2866e05b6c7b5628ca92e9cb1142d008
# Code reformatting
340ff8586d4f1cb6a0f3c934eb42589bcc29c0ea
e530d2906a1f61df89861286ac57c951a247f32c

16
.github/BOTMETA.yml vendored
View File

@@ -368,6 +368,8 @@ files:
$module_utils/jenkins.py:
labels: jenkins
maintainers: russoz
$module_utils/_lxc.py:
maintainers: russoz
$module_utils/manageiq.py:
labels: manageiq
maintainers: $team_manageiq
@@ -592,6 +594,8 @@ files:
$modules/filesystem.py:
labels: filesystem
maintainers: pilou- abulimov quidame
$modules/file_remove.py:
maintainers: shahargolshani
$modules/flatpak.py:
maintainers: $team_flatpak
$modules/flatpak_remote.py:
@@ -743,6 +747,8 @@ files:
maintainers: obourdon hryamzik
$modules/ip_netns.py:
maintainers: bregman-arie
$modules/ip2location_info.py:
maintainers: ip2location
$modules/ipa_:
maintainers: $team_ipa
ignore: fxfitz
@@ -929,6 +935,10 @@ files:
maintainers: conloos
$modules/lxd_project.py:
maintainers: we10710aa
$modules/lxd_storage_pool_info.py:
maintainers: smcavoy
$modules/lxd_storage_volume_info.py:
maintainers: smcavoy
$modules/macports.py:
ignore: ryansb
keywords: brew cask darwin homebrew macosx macports osx
@@ -1494,7 +1504,9 @@ files:
maintainers: vbotka
$tests/fqdn_valid.py:
maintainers: vbotka
#########################
$modules/sssd_info.py:
maintainers: a-gabidullin
#########################
docs/docsite/rst/filter_guide.rst: {}
docs/docsite/rst/filter_guide_abstract_informations.rst: {}
docs/docsite/rst/filter_guide_abstract_informations_counting_elements_in_sequence.rst:
@@ -1563,7 +1575,7 @@ files:
maintainers: russoz
docs/docsite/rst/test_guide.rst:
maintainers: felixfontein
#########################
#########################
tests/:
labels: tests
tests/integration:

View File

@@ -146,7 +146,7 @@ body:
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@@ -7,7 +7,7 @@
blank_issues_enabled: false # default: true
contact_links:
- name: Security bug report
url: https://docs.ansible.com/ansible-core/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
url: https://docs.ansible.com/projects/ansible-core/devel/community/reporting_bugs_and_features.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
about: |
Please learn how to report security vulnerabilities here.
@@ -16,12 +16,12 @@ contact_links:
a prompt response.
For more information, see
https://docs.ansible.com/ansible/latest/community/reporting_bugs_and_features.html
https://docs.ansible.com/projects/ansible/latest/community/reporting_bugs_and_features.html
- name: Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
url: https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_template_chooser_ansible_collections
about: Be nice to other members of the community.
- name: Talks to the community
url: https://docs.ansible.com/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
url: https://docs.ansible.com/projects/ansible/latest/community/communication.html?utm_medium=github&utm_source=issue_template_chooser#mailing-list-information
about: Please ask and answer usage questions here
- name: Working groups
url: https://github.com/ansible/community/wiki

View File

@@ -122,7 +122,7 @@ body:
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@@ -66,7 +66,7 @@ body:
attributes:
label: Code of Conduct
description: |
Read the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
Read the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html?utm_medium=github&utm_source=issue_form--ansible-collections) first.
options:
- label: I agree to follow the Ansible Code of Conduct
required: true

View File

@@ -4,7 +4,7 @@
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
<!--- Please do not forget to include a changelog fragment:
https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
https://docs.ansible.com/projects/ansible/devel/community/collection_development_process.html#creating-changelog-fragments
No need to include one for docs-only or test-only PR, and for new plugin/module PRs.
Read about more details in CONTRIBUTING.md.
-->

View File

@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false

View File

@@ -25,7 +25,7 @@ jobs:
name: "Validate generated Ansible output"
steps:
- name: Check out collection
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run nox

View File

@@ -21,7 +21,7 @@ jobs:
name: "Run extra sanity tests"
steps:
- name: Check out collection
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run nox

13
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,13 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Alexei Znamensky <russoz@gmail.com>
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.10
hooks:
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,588 @@ Community General Release Notes
This changelog describes changes after version 11.0.0.
v12.2.0
=======
Release Summary
---------------
Feature and bugfix release.
Minor Changes
-------------
- btrfs module utils - make execution of external commands safer by passing arguments as list (https://github.com/ansible-collections/community.general/pull/11240).
- deps module utils - change the internal representaion of dependency state (https://github.com/ansible-collections/community.general/pull/11242).
- keycloak_userprofile - add support for ``selector`` option (https://github.com/ansible-collections/community.general/pull/11309).
- keycloak_userprofile - add support for additional user profile attribute-validations available in Keycloak (https://github.com/ansible-collections/community.general/issues/9048, https://github.com/ansible-collections/community.general/pull/11285).
- lxc_container - refactor function ``create_script``, using ``subprocess.Popen()``, to a new module_utils ``_lxc`` (https://github.com/ansible-collections/community.general/pull/11204).
- lxc_container - use ``tempfile.TemporaryDirectory()`` instead of ``mkdtemp()`` (https://github.com/ansible-collections/community.general/pull/11323).
- monit - add ``monit_version`` return value also when the module has succeeded (https://github.com/ansible-collections/community.general/pull/11255).
- monit - use ``Enum`` to represent the possible states (https://github.com/ansible-collections/community.general/pull/11245).
- nmcli module - add ``vxlan_parent`` option required for multicast ``vxlan_remote`` addresses; add ``vxlan`` to list of bridgeable devices (https://github.com/ansible-collections/community.general/pull/11182).
- scaleway inventory plugin - added support for ``SCW_PROFILE`` environment variable for the ``scw_profile`` option (https://github.com/ansible-collections/community.general/issues/11310, https://github.com/ansible-collections/community.general/pull/11311).
- scaleway module utils - added ``scw_profile`` parameter with ``SCW_PROFILE`` environment variable support (https://github.com/ansible-collections/community.general/issues/11313, https://github.com/ansible-collections/community.general/pull/11314).
Deprecated Features
-------------------
- All module utils, plugin utils, and doc fragments will be made **private** in community.general 13.0.0. This means that they will no longer be part of the public API of the collection, and can have breaking changes even in bugfix releases. If you depend on importing code from the module or plugin utils, or use one of the doc fragments, please `comment in the issue to discuss this <https://github.com/ansible-collections/community.general/issues/11312>`__. Note that this does not affect any use of community.general in task files, roles, or playbooks (https://github.com/ansible-collections/community.general/issues/11312, https://github.com/ansible-collections/community.general/pull/11320).
Bugfixes
--------
- apk - fix ``packages`` return value for apk-tools >= 3 (Alpine 3.23) (https://github.com/ansible-collections/community.general/issues/11264).
- iptables_state - refactor code to avoid writing unnecessary temporary files (https://github.com/ansible-collections/community.general/pull/11258).
- keycloak_realm - fixed crash in ``sanitize_cr()`` when ``realmrep`` was ``None`` (https://github.com/ansible-collections/community.general/pull/11260).
- keycloak_user_rolemapping module - fixed crash when assigning roles to users without an existing role (https://github.com/ansible-collections/community.general/issues/10960, https://github.com/ansible-collections/community.general/pull/11256).
- listen_ports_facts - fix handling of empty PID lists when ``command=ss`` (https://github.com/ansible-collections/community.general/pull/11332).
- monit - add delay of 0.5 seconds after state change and check for status (https://github.com/ansible-collections/community.general/pull/11255).
- monit - internal state was not reflecting when operation is "pending" in ``monit`` (https://github.com/ansible-collections/community.general/pull/11245).
New Modules
-----------
- community.general.ip2location_info - Retrieve IP geolocation information of a host's IP address.
- community.general.sssd_info - Check SSSD domain status using D-Bus.
v12.1.0
=======
Release Summary
---------------
Regular bugfix and feature release.
Minor Changes
-------------
- The last code included in the collection that was licensed under the PSF 2.0 license was removed form the collection. This means that now all code is either GPLv3+ licensed, MIT licensed, or BSD-2-clause licensed (https://github.com/ansible-collections/community.general/pull/11232).
- _mount module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- _stormssh module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- a_module test plugin - add proper parameter checking and type hints (https://github.com/ansible-collections/community.general/pull/11167).
- aerospike_migrations - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- aix_filesystem - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- ali_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ansible_type plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- ansible_type test plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- apk - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- apt_rpm - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- apt_rpm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- atomic_container - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- atomic_container modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- atomic_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- atomic_image - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- atomic_image modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- awall - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- beadm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- bigpanda - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- binary_file lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- bitbucket module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- bitbucket_access_key modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_key_pair modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_known_host modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_variable modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- chef_databag lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- chroot connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- circonus_annotation - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- cloudflare_dns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- cmd_runner module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- cobbler inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- cobbler_sync - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
- cobbler_sync - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- cobbler_system - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
- cobbler_system - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- collection_version lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- composer - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- consul_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- counter filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- credstash lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- cronvar - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- crypttab - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- csv module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- csv module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- cyberarkpassword lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- database module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- database module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- datadog_event - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- datadog_monitor - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- dconf - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- dependent lookup plugin - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- dependent lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- deps module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- dig lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- dimensiondata_network - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- dimensiondata_network modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- dnf_config_manager - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- dnstxt lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- dsv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- elastic callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- etcd3 lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- exceptions module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- flatpak - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- flatpak_remote - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- fqdn_valid test plugin - add proper parameter checking, and add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- from_csv filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- from_ini filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- gandi_livedns_api module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- github_app_access_token lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- gitlab_group_access_token - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- gitlab_group_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- gitlab_project_access_token - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- gitlab_project_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- gitlab_runner - allow maximum timeout to be disabled by passing ``0`` to ``maximum_timeout`` (https://github.com/ansible-collections/community.general/pull/11174).
- gitlab_runners inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- haproxy - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hashids filter - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- hashids filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- hg - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- hg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- hpilo_info - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hpilo_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- htpasswd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- hwc_ecs_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hwc_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- hwc_utils module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- hwc_vpc_port - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ibm_sa_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- icinga2 inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- icinga2_host - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- identity.keycloak.keycloak module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- imc_rest modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- incus connection plugin - add support for Windows virtual machines (https://github.com/ansible-collections/community.general/pull/11199).
- influxdb_query - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- influxdb_user - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- influxdb_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- influxdb_write - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- iocage inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ipa module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- ipa module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- ipa_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_dnsrecord - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_dnszone - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_hbacrule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_hostgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_otpconfig - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_otptoken - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ipa_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_service - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_subca - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ipa_sudocmd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_sudocmdgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_sudorule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_vault - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- iptables_state action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- iso_customize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- jail connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- jc filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- jenkins_job - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- jenkins_job_info - remove conditional code handling SSL for unsupported versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jenkins_plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- jenkins_plugin modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- jenkins_script - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jira - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- json_query filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- keycloak module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- keycloak module_utils - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- keycloak_authentication - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_client_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_component - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_realm - add ``webAuthnPolicyPasswordlessPasskeysEnabled`` parameter (https://github.com/ansible-collections/community.general/pull/11197).
- keycloak_realm_key - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_realm_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_user_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_userprofile - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keys_filter plugin_utils plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- keys_filter.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- known_hosts module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- layman - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- ldap module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- ldap_attrs - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_entry - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_inc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- linode inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- listen_ports_facts - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- listen_ports_facts - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- lmdb_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- locale_gen - extend the search for available locales to include ``/usr/local/share/i18n/SUPPORTED`` in Debian and Ubuntu systems (https://github.com/ansible-collections/community.general/issues/10964, https://github.com/ansible-collections/community.general/pull/11046).
- logentries - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- lxc connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- lxd connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- lxd inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- lxd module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- lxd module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- lxd_container - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- macports - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- mail - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- maven_artifact - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- merge_variables - extend type detection failure message to allow users for easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).
- merge_variables lookup plugin - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- modprobe - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- net_tools.pritunl.api module utils - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- nmap inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- nmcli - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- nmcli - fix comparison of type (https://github.com/ansible-collections/community.general/pull/11121).
- nmcli modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- nomad_job_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nomad_token - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nosh - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ocapi_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- oci_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- oci_utils module utils - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- oneandone_firewall_policy - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_load_balancer - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_monitoring_policy - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_private_network - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_server - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11231).
- oneandone_server modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
- onepassword lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- onepassword_info - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11193).
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- oneview module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- online inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- opennebula inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- opentelemetry callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- osx_defaults - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- packet_device - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11231).
- packet_device modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
- packet_ip_subnet - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- packet_project - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- packet_sshkey - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- pamd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- parted - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- passwordstore lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- pear - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- pids - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pids - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- portage - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- pritunl_org - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_org_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_user_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pushbullet modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- read_csv - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- redfish_utils module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- redfish_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- redhat_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- redhat_subscription - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- redis cache plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- redis lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- revbitspss lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- rhevm - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- riak - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- rundeck module utils - improve handling the return value ``exception``. It now contains the full stack trace of the exception, while the message is included in ``msg`` (https://github.com/ansible-collections/community.general/pull/11149).
- scaleway inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- scaleway_user_data modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- selinux_permissive - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_check - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_silence - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- sensu_silence modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- shelvefile lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- shutdown action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- shutdown action plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- slack - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- slackpkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- snap - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- snmp_facts - simplify and improve code using standard Ansible validations (https://github.com/ansible-collections/community.general/pull/11148).
- solaris_zone - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11192).
- solaris_zone - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- spectrum_model_attrs - convert ``%`` templating to f-string (https://github.com/ansible-collections/community.general/pull/11229).
- statusio_maintenance - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- sudoers - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- svc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- svr4pkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- swupd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- to_ini filter plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- tss lookup plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- univention_umc module utils - update code to Python 3 (https://github.com/ansible-collections/community.general/pull/11122).
- unsafe.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- urpmi - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- utm_aaa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_aaa_group_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_ca_host_key_cert - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_ca_host_key_cert_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_dns_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_network_interface_address - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_network_interface_address_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_auth_profile - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_exception - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_frontend - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_frontend_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_location - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_location_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- utm_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- vertica_configuration - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_configuration - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_role - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_schema - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_schema - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_schema - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- vertica_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_user - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_user - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- virtualbox inventory plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- vmadm - in case of failure, the module no longer returns the stderr output as ``exception``, but instead as ``stderr``. Other information (``stdout``, ``rc``) is now also returned (https://github.com/ansible-collections/community.general/pull/11149).
- vmadm - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- wakeonlan - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- wsl connection plugin - adjust variable name for integration tests (https://github.com/ansible-collections/community.general/pull/11190).
- wsl connection plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- wsl connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- xbps - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- xbps - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- xcc_redfish_command - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- xenserver module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- xenserver module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- xenserver_guest modules - replace ``%`` templating with f-strings or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- xml - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- xml - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- yum_versionlock - remove redundant conversion to unicode in command output (https://github.com/ansible-collections/community.general/pull/11093).
- zfs - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- zone connection plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
Deprecated Features
-------------------
- cloud module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- database module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- dconf - deprecate fallback mechanism when ``gi.repository`` is not available; fallback will be removed in community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11088).
- known_hosts module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- layman - ClearLinux was made EOL in July 2025.; the module will be removed from community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11087).
- layman - Gentoo deprecated ``layman`` in mid-2023; the module will be removed from community.general 14.0.0 (https://github.com/ansible-collections/community.general/pull/11070).
- pushbullet - module relies on Python package supporting Python 3.2 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11224).
- saslprep module utils - this module utils is not used by community.general and will thus be removed from community.general 13.0.0. If you are using it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- spotinst_aws_elastigroup - module relies on Python package supporting Python 2.7 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11069).
Bugfixes
--------
- _filelock module utils - add type hints. Fix bug if ``set_lock()`` is called with ``lock_timeout=None`` (https://github.com/ansible-collections/community.general/pull/11222).
- aix_filesystem - remove compatibility code for ancient Python versions (https://github.com/ansible-collections/community.general/pull/11232).
- ansible_type plugin utils - avoid potential concatenation of non-strings when ``alias`` has non-string values (https://github.com/ansible-collections/community.general/pull/11167).
- ansible_type test plugin - fix parameter checking (https://github.com/ansible-collections/community.general/pull/11167).
- cobbler_system - compare the version as a float which is the type returned by the Cobbler API (https://github.com/ansible-collections/community.general/issues/11044).
- datetime module utils - fix bug in ``fromtimestamp()`` that caused the function to crash. This function is not used in community.general (https://github.com/ansible-collections/community.general/pull/11206).
- gitlab module utils - add type hints. Pass API version to python-gitlab as string and not as integer (https://github.com/ansible-collections/community.general/pull/11222).
- homebrew_service - slightly refactor code (https://github.com/ansible-collections/community.general/pull/11168).
- ipinfoio_facts - fix handling of HTTP errors consulting the service (https://github.com/ansible-collections/community.general/pull/11145).
- keys_filter.py plugin utils - fixed requirements check so that other sequences than lists and strings are checked, and corrected broken formatting during error reporting (https://github.com/ansible-collections/community.general/pull/11167).
- mas - parse CLI output correctly when listing installed apps with mas 3.0.0+ (https://github.com/ansible-collections/community.general/pull/11179).
- pam_limits - remove ``%`` templating no longer used in f-string (https://github.com/ansible-collections/community.general/pull/11229).
- xcc_redfish_command - fix templating of dictionary keys as list (https://github.com/ansible-collections/community.general/pull/11144).
- zfs - mark change correctly when updating properties whose current value differs, even if they already have a non-default value (https://github.com/ansible-collections/community.general/issues/11019, https://github.com/ansible-collections/community.general/pull/11172).
New Modules
-----------
- community.general.file_remove - Remove files matching a pattern from a directory.
- community.general.lxd_storage_pool_info - Retrieve information about LXD storage pools.
- community.general.lxd_storage_volume_info - Retrieve information about LXD storage volumes.
v12.0.1
=======
Release Summary
---------------
Bugfix release for inclusion in Ansible 13.0.0rc1.
Minor Changes
-------------
- datetime module utils - remove code for unsupported Python version (https://github.com/ansible-collections/community.general/pull/11048).
- dnsimple_info - use Ansible construct to validate parameters (https://github.com/ansible-collections/community.general/pull/11052).
- infinity - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- ipa_otptoken - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- irc - use proper boolean value in loops (https://github.com/ansible-collections/community.general/pull/11076).
- jenkins_node - remove code for unsupported Python version (https://github.com/ansible-collections/community.general/pull/11048).
- opendj_backendprop - use Ansible construct to perform check for external commands (https://github.com/ansible-collections/community.general/pull/11072).
- rhevm - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- slack - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- tss lookup plugin - fixed ``AccessTokenAuthorizer`` initialization to include ``base_url`` parameter for proper token authentication (https://github.com/ansible-collections/community.general/pull/11031).
- zfs_facts - use Ansible construct to check result of external command (https://github.com/ansible-collections/community.general/pull/11054).
Bugfixes
--------
- _filelock module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- aerospike_migrations - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- aix_lvol - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ali_instance - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- ali_instance - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ali_instance_info - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- apt_rpm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- apt_rpm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- btrfs module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- btrfs module utils - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- btrfs_subvolume - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- btrfs_subvolume - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- chef_databag lookup plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- consul - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- consul_kv lookup plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- cronvar - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- discord - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- dnf_versionlock - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- dnsmadeeasy - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- dpkg_divert - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- elastic callback plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- filesystem - avoid false positive change detection on XFS resize due to unusable slack space (https://github.com/ansible-collections/community.general/pull/11033).
- gitlab module utils - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_branch - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_group_members - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_issue - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_merge_request - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_project - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_project_members - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_protected_branch - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_user - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- haproxy - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- homebrew - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- homebrew_services - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- hpilo_boot - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- infinity - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ini_file - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- interfaces_file - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ipa_group - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ipa_otptoken - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- ipa_vault - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ipmi_boot - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_build - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_build_info - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_credential - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- jenkins_plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- jenkins_plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- json_patch filter plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- kea_command - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_authz_permission - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_clientscope_type - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_component - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- keycloak_realm_key - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- keycloak_user_execute_actions_email - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_user_federation - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_userprofile - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- launchd - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- linode inventory plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- listen_ports_facts - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- listen_ports_facts - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- logentries callback plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- lxc_container - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- lxd_container - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- manageiq_alert_profiles - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- manageiq_provider - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- manageiq_tenant - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- matrix - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- maven_artifact - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- memset_memstore_info - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- memset_server_info - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- memset_zone - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- module_helper module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- monit - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- netcup_dns - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nmcli - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nomad_job - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nosh - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- npm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- odbc - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_host - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_image - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_service - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_template - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_vm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_vm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_vnet - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- oneandone module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- onepassword_info - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- online inventory plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- opendj_backendprop - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- opennebula module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- opentelemetry callback plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ovh_monthly_billing - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- pamd - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- pkgin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- portinstall - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- pulp_repo - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- redfish_utils module utils - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- redhat_subscription - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- redhat_subscription - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- redis_data_incr - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- rhevm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- scaleway module utils - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- scaleway_sshkey - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- sensu_check - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- simpleinit_msb - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- sorcery - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- spectrum_model_attrs - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- spotinst_aws_elastigroup - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- svc - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- syslog_json callback plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- terraform - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- timestamp callback plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- timezone - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- to_* time filter plugins - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- to_prettytable filter plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- vmadm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- wsl connection plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- wsl connection plugin - rename variable to fix type checking (https://github.com/ansible-collections/community.general/pull/11030).
- xen_orchestra inventory plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- xenserver module utils - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- xenserver_guest - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- xenserver_guest - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- xfs_quota - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- xml - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- zypper_repository - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
v12.0.0
=======

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
# Contributing
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
We follow [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html) in all our contributions and interactions within this repository.
If you are a committer, also refer to the [collection's committer guidelines](https://github.com/ansible-collections/community.general/blob/main/commit-rights.md).
@@ -20,33 +20,38 @@ so you can cooperate to create a better solution together.
* If you are interested in starting with an easy issue, look for [issues with an `easyfix` label](https://github.com/ansible-collections/community.general/labels/easyfix).
* Often issues that are waiting for contributors to pick up have [the `waiting_on_contributor` label](https://github.com/ansible-collections/community.general/labels/waiting_on_contributor).
## Open pull requests
## Review pull requests
Look through currently [open pull requests](https://github.com/ansible-collections/community.general/pulls).
You can help by reviewing them. Reviews help move pull requests to merge state. Some good pull requests cannot be merged only due to a lack of reviews. And it is always worth saying that good reviews are often more valuable than pull requests themselves.
Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native english speaker), or testing bugfixes and new features!
Note that reviewing does not only mean code review, but also offering comments on new interfaces added to existing plugins/modules, interfaces of new plugins/modules, improving language (not everyone is a native English speaker), or testing bugfixes and new features!
Also, consider taking up a valuable, reviewed, but abandoned pull request which you could politely ask the original authors to complete yourself.
## Open pull requests
Please read our ['Contributing to collections'](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections_contributing.html#contributing-to-a-collection-community-general) guide.
* Try committing your changes with an informative but short commit message.
* Do not squash your commits and force-push to your branch if not needed. Reviews of your pull request are much easier with individual commits to comprehend the pull request history. All commits of your pull request branch will be squashed into one commit by GitHub upon merge.
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the repository checkout.
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).
* Do not add merge commits to your PR. The bot will complain and you will have to rebase ([instructions for rebasing](https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_rebasing.html)) to remove them before your PR can be merged. To avoid that git automatically does merges during pulls, you can configure it to do rebases instead by running `git config pull.rebase true` inside the repository checkout.
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/projects/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).
* You must not include a fragment for new modules or new plugins. Also you shouldn't include one for docs-only changes. (If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
* Please always include a link to the pull request itself, and if the PR is about an issue, also a link to the issue. Also make sure the fragment ends with a period, and begins with a lower-case letter after `-`. (Again, if you don't do this, we'll add suggestions to fix it, so don't worry too much :) )
* Note that we format the code with `ruff format`. If your change does not match the formatters expectations, CI will fail and your PR will not get merged. See below for how to format code with antsibull-nox.
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
You can also read the Ansible community's [Quick-start development guide](https://docs.ansible.com/projects/ansible/devel/community/create_pr_quick_start.html).
## Test pull requests
If you want to test a PR locally, refer to [our testing guide](https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst) for instructions on how do it quickly.
If you want to test a PR locally, refer to [our testing guide](https://docs.ansible.com/projects/ansible/devel/community/collection_contributors/collection_test_pr_locally.html) for instructions on how do it quickly.
If you find any inconsistencies or places in this document which can be improved, feel free to raise an issue or pull request to fix it.
## Format code; and run sanity or unit tests locally (with antsibull-nox)
The easiest way to format the code, and to run sanity and unit tests locally is to use [antsibull-nox](https://ansible.readthedocs.io/projects/antsibull-nox/).
The easiest way to format the code, and to run sanity and unit tests locally is to use [antsibull-nox](https://docs.ansible.com/projects/antsibull-nox/).
(If you have [nox](https://nox.thea.codes/en/stable/) installed, it will automatically install antsibull-nox in a virtual environment for you.)
### Format code
@@ -101,7 +106,7 @@ If you replace `-Re` with `-e`, then the virtual environments will be re-created
Instead of using antsibull-nox, you can also run sanity and unit tests with ansible-test directly.
This also allows you to run integration tests.
You have to check out the repository into a specific path structure to be able to run `ansible-test`. The path to the git checkout must end with `.../ansible_collections/community/general`. Please see [our testing guide](https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst) for instructions on how to check out the repository into a correct path structure. The short version of these instructions is:
You have to check out the repository into a specific path structure to be able to run `ansible-test`. The path to the git checkout must end with `.../ansible_collections/community/general`. Please see [our testing guide](https://docs.ansible.com/projects/ansible/devel/community/collection_contributors/collection_test_pr_locally.html) for instructions on how to check out the repository into a correct path structure. The short version of these instructions is:
```.bash
mkdir -p ~/dev/ansible_collections/community
@@ -128,6 +133,7 @@ ansible-test sanity --docker -v plugins/modules/system/pids.py tests/integration
Note that for running unit tests, you need to install required collections in the same folder structure that `community.general` is checked out in.
Right now, you need to install [`community.internal_test_tools`](https://github.com/ansible-collections/community.internal_test_tools).
If you want to use the latest version from GitHub, you can run:
```
git clone https://github.com/ansible-collections/community.internal_test_tools.git ~/dev/ansible_collections/community/internal_test_tools
```
@@ -150,6 +156,7 @@ ansible-test units --docker -v --python 3.8 tests/unit/plugins/modules/net_tools
Note that for running integration tests, you need to install required collections in the same folder structure that `community.general` is checked out in.
Right now, depending on the test, you need to install [`ansible.posix`](https://github.com/ansible-collections/ansible.posix), [`community.crypto`](https://github.com/ansible-collections/community.crypto), and [`community.docker`](https://github.com/ansible-collections/community.docker):
If you want to use the latest versions from GitHub, you can run:
```
mkdir -p ~/dev/ansible_collections/ansible
git clone https://github.com/ansible-collections/ansible.posix.git ~/dev/ansible_collections/ansible/posix
@@ -162,11 +169,13 @@ The following commands show how to run integration tests:
#### In Docker
Integration tests on Docker have the following parameters:
- `image_name` (required): The name of the Docker image. To get the list of supported Docker images, run
`ansible-test integration --help` and look for _target docker images_.
- `test_name` (optional): The name of the integration test.
For modules, this equals the short name of the module; for example, `pacman` in case of `community.general.pacman`.
For plugins, the plugin type is added before the plugin's short name, for example `callback_yaml` for the `community.general.yaml` callback.
```.bash
# Test all plugins/modules on fedora40
ansible-test integration -v --docker fedora40
@@ -187,6 +196,31 @@ ansible-test integration -v lookup_flattened
If you are unsure about the integration test target name for a module or plugin, you can take a look in `tests/integration/targets/`. Tests for plugins have the plugin type prepended.
## Devcontainer
Since community.general 12.2.0, the project repository supports [devcontainers](https://containers.dev/). In short, it is a standard mechanism to
create a container that is then used during the development cycle. Many tools are pre-installed in the container and will be already available
to you as a developer. A number of different IDEs support that configuration, the most prominent ones being VSCode and PyCharm.
See the files under [.devcontainer](.devcontainer) for details on what is deployed inside that container.
Beware of:
- By default, the devcontainer installs the latest version of `ansible-core`.
When testing your changes locally, keep in mind that the collection must support older versions of
`ansible-core` and, depending on what is being tested, results may vary.
- Integration tests executed directly inside the devcontainer without isolation (see above) may fail if
they expected to be run in full fledged VMs. On the other hand, the devcontainer setup allows running
containers inside the container (the `docker-in-docker` feature).
- The devcontainer is built with a directory structure such that
`.../ansible_collections/community/general` contains the project repository, so `ansible-test` and
other standard tools should work without any additional setup
- By default, the devcontainer installs `pre-commit` and configures it to perform `ruff check` and
`ruff format` on the Python files, prior to commiting. That configuration is going to be used by
`git` even outside the devcontainer. To prevent errors, you have to either install `pre-commit` in
your computer, outside the devcontainer, or run `pre-commit uninstall` from within the devcontainer
before quitting it.
## Creating new modules or plugins
Creating new modules and plugins requires a bit more work than other Pull Requests.
@@ -196,14 +230,14 @@ Creating new modules and plugins requires a bit more work than other Pull Reques
2. Please do not add more than one plugin/module in one PR, especially if it is the first plugin/module you are contributing.
That makes it easier for reviewers, and increases the chance that your PR will get merged. If you plan to contribute a group
of plugins/modules (say, more than a module and a corresponding ``_info`` module), please mention that in the first PR. In
of plugins/modules (say, more than a module and a corresponding `_info` module), please mention that in the first PR. In
such cases, you also have to think whether it is better to publish the group of plugins/modules in a new collection.
3. When creating a new module or plugin, please make sure that you follow various guidelines:
- Follow [development conventions](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html);
- Follow [documentation standards](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html) and
the [Ansible style guide](https://docs.ansible.com/ansible/devel/dev_guide/style_guide/index.html#style-guide);
- Follow [development conventions](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_modules_best_practices.html);
- Follow [documentation standards](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_modules_documenting.html) and
the [Ansible style guide](https://docs.ansible.com/projects/ansible/devel/dev_guide/style_guide/index.html#style-guide);
- Make sure your modules and plugins are [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0-standalone.html) licensed
(new module_utils can also be [BSD-2-clause](https://opensource.org/licenses/BSD-2-Clause) licensed);
- Make sure that new plugins and modules have tests (unit tests, integration tests, or both); it is preferable to have some tests

View File

@@ -1,48 +0,0 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
# Community General Collection
[![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/devel/collections/community/general/)
[![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/projects/ansible/devel/collections/community/general/)
[![Build Status](https://dev.azure.com/ansible/community.general/_apis/build/status/CI?branchName=stable-12)](https://dev.azure.com/ansible/community.general/_build?definitionId=31)
[![EOL CI](https://github.com/ansible-collections/community.general/actions/workflows/ansible-test.yml/badge.svg?branch=stable-12)](https://github.com/ansible-collections/community.general/actions)
[![Nox CI](https://github.com/ansible-collections/community.general/actions/workflows/nox.yml/badge.svg?branch=stable-12)](https://github.com/ansible-collections/community.general/actions)
@@ -15,15 +15,15 @@ SPDX-License-Identifier: GPL-3.0-or-later
This repository contains the `community.general` Ansible Collection. The collection is a part of the Ansible package and includes many modules and plugins supported by Ansible community which are not part of more specialized community collections.
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
You can find [documentation for this collection on the Ansible docs site](https://docs.ansible.com/projects/ansible/latest/collections/community/general/).
Please note that this collection does **not** support Windows targets. Only connection plugins included in this collection might support Windows targets, and will explicitly mention that in their documentation if they do so.
## Code of Conduct
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
We follow [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
## Communication
@@ -33,9 +33,9 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https:
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/projects/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/projects/ansible/devel/community/communication.html).
## Tested with Ansible
@@ -47,7 +47,7 @@ Some modules and plugins require external libraries. Please check the requiremen
## Included content
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/ansible/latest/collections/community/general/).
Please check the included content on the [Ansible Galaxy page for this collection](https://galaxy.ansible.com/ui/repo/published/community/general/) or the [documentation on the Ansible docs site](https://docs.ansible.com/projects/ansible/latest/collections/community/general/).
## Using this collection
@@ -76,7 +76,7 @@ You can also install a specific version of the collection, for example, if you n
ansible-galaxy collection install community.general:==X.Y.Z
```
See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.
See [Ansible Using collections](https://docs.ansible.com/projects/ansible/latest/user_guide/collections_using.html) for more details.
## Contributing to this collection
@@ -90,13 +90,13 @@ You don't know how to start? Refer to our [contribution guide](https://github.co
The current maintainers are listed in the [commit-rights.md](https://github.com/ansible-collections/community.general/blob/stable-12/commit-rights.md#people) file. If you have questions or need help, feel free to mention them in the proposals.
You can find more information in the [developer guide for collections](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html).
You can find more information in the [developer guide for collections](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections), and in the [Ansible Community Guide](https://docs.ansible.com/projects/ansible/latest/community/index.html).
Also for some notes specific to this collection see [our CONTRIBUTING documentation](https://github.com/ansible-collections/community.general/blob/stable-12/CONTRIBUTING.md).
### Running tests
See [here](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#testing-collections).
See [here](https://docs.ansible.com/projects/ansible/devel/dev_guide/developing_collections.html#testing-collections).
## Collection maintenance
@@ -110,7 +110,7 @@ It is necessary for maintainers of this collection to be subscribed to:
* The collection itself (the `Watch` button → `All Activity` in the upper right corner of the repository's homepage).
* The "Changes Impacting Collection Contributors and Maintainers" [issue](https://github.com/ansible-collections/overview/issues/45).
They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn).
They also should be subscribed to Ansible's [The Bullhorn newsletter](https://docs.ansible.com/projects/ansible/devel/community/communication.html#the-bullhorn).
## Publishing New Version
@@ -129,9 +129,9 @@ See [this issue](https://github.com/ansible-collections/community.general/issues
## More information
- [Ansible Collection overview](https://github.com/ansible-collections/overview)
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
- [Ansible User guide](https://docs.ansible.com/projects/ansible/latest/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/projects/ansible/latest/dev_guide/index.html)
- [Ansible Community code of conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html)
## Licensing
@@ -139,6 +139,6 @@ This collection is primarily licensed and distributed as a whole under the GNU G
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.general/blob/stable-12/COPYING) for the full text.
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/BSD-2-Clause.txt), the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/MIT.txt), and the [PSF 2.0 license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/PSF-2.0.txt).
Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/BSD-2-Clause.txt) and the [MIT license](https://github.com/ansible-collections/community.general/blob/stable-12/LICENSES/MIT.txt).
All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/).

View File

@@ -804,3 +804,826 @@ releases:
name: binary_file
namespace: null
release_date: '2025-11-03'
12.0.1:
changes:
bugfixes:
- _filelock module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- aerospike_migrations - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- aix_lvol - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ali_instance - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- ali_instance - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ali_instance_info - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- apt_rpm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- apt_rpm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- btrfs module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- btrfs module utils - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- btrfs_subvolume - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- btrfs_subvolume - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- chef_databag lookup plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- consul - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- consul_kv lookup plugin - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- cronvar - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- discord - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- dnf_versionlock - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- dnsmadeeasy - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- dpkg_divert - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- elastic callback plugin - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- filesystem - avoid false positive change detection on XFS resize due to
unusable slack space (https://github.com/ansible-collections/community.general/pull/11033).
- gitlab module utils - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_branch - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_group_members - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_issue - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_merge_request - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_project - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- gitlab_project_members - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_protected_branch - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- gitlab_user - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- haproxy - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- homebrew - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- homebrew_services - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- hpilo_boot - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- infinity - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ini_file - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- interfaces_file - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- ipa_group - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ipa_otptoken - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- ipa_vault - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- ipmi_boot - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_build - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_build_info - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- jenkins_credential - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- jenkins_plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- jenkins_plugin - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- json_patch filter plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- kea_command - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_authz_permission - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_clientscope_type - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_component - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- keycloak_realm_key - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- keycloak_user_execute_actions_email - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_user_federation - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- keycloak_userprofile - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- launchd - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- linode inventory plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- listen_ports_facts - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- listen_ports_facts - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- logentries callback plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- lxc_container - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- lxd_container - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- manageiq_alert_profiles - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- manageiq_provider - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- manageiq_tenant - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- matrix - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- maven_artifact - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- memset_memstore_info - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- memset_server_info - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- memset_zone - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- module_helper module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- monit - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- netcup_dns - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nmcli - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nomad_job - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- nosh - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- npm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- odbc - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_host - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_image - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_service - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_template - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_vm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- one_vm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- one_vnet - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- oneandone module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- onepassword_info - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- online inventory plugin - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- opendj_backendprop - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- opennebula module utils - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- opentelemetry callback plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- ovh_monthly_billing - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- pamd - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- pkgin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- portinstall - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- pulp_repo - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- redfish_utils module utils - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- redhat_subscription - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- redhat_subscription - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- redis_data_incr - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- rhevm - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- scaleway module utils - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- scaleway_sshkey - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- sensu_check - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- simpleinit_msb - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- sorcery - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- spectrum_model_attrs - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- spotinst_aws_elastigroup - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- svc - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- syslog_json callback plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- terraform - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- timestamp callback plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- timezone - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- to_* time filter plugins - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- to_prettytable filter plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- vmadm - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- wsl connection plugin - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- wsl connection plugin - rename variable to fix type checking (https://github.com/ansible-collections/community.general/pull/11030).
- xen_orchestra inventory plugin - improve Python code by removing unnecessary
variables (https://github.com/ansible-collections/community.general/pull/11049).
- xenserver module utils - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- xenserver_guest - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
- xenserver_guest - improve Python code by removing unnecessary variables
(https://github.com/ansible-collections/community.general/pull/11049).
- xfs_quota - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- xml - improve Python code by removing unnecessary variables (https://github.com/ansible-collections/community.general/pull/11049).
- zypper_repository - improve Python code (https://github.com/ansible-collections/community.general/pull/11043).
minor_changes:
- datetime module utils - remove code for unsupported Python version (https://github.com/ansible-collections/community.general/pull/11048).
- dnsimple_info - use Ansible construct to validate parameters (https://github.com/ansible-collections/community.general/pull/11052).
- infinity - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- ipa_otptoken - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- irc - use proper boolean value in loops (https://github.com/ansible-collections/community.general/pull/11076).
- jenkins_node - remove code for unsupported Python version (https://github.com/ansible-collections/community.general/pull/11048).
- opendj_backendprop - use Ansible construct to perform check for external
commands (https://github.com/ansible-collections/community.general/pull/11072).
- rhevm - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- slack - consolidate double and triple whitespaces (https://github.com/ansible-collections/community.general/pull/11029).
- tss lookup plugin - fixed ``AccessTokenAuthorizer`` initialization to include
``base_url`` parameter for proper token authentication (https://github.com/ansible-collections/community.general/pull/11031).
- zfs_facts - use Ansible construct to check result of external command (https://github.com/ansible-collections/community.general/pull/11054).
release_summary: Bugfix release for inclusion in Ansible 13.0.0rc1.
fragments:
- 11029-extra-whitespace.yml
- 11030-wsl-typing.yml
- 11031-tss-lookup-delinea-rebranding.yml
- 11043-ruff-check.yml
- 11048-py3-cond.yml
- 11049-ruff-check.yml
- 11052-dnsimple-info-improves.yml
- 11054-zfs-facts-checkrc.yml
- 11072-opendj-checkrc.yml
- 11076-irc-true.yml
- 12.0.1.yml
- filesystem-xfs-resize-slack.yml
release_date: '2025-11-10'
12.1.0:
changes:
bugfixes:
- _filelock module utils - add type hints. Fix bug if ``set_lock()`` is called
with ``lock_timeout=None`` (https://github.com/ansible-collections/community.general/pull/11222).
- aix_filesystem - remove compatibility code for ancient Python versions (https://github.com/ansible-collections/community.general/pull/11232).
- ansible_type plugin utils - avoid potential concatenation of non-strings
when ``alias`` has non-string values (https://github.com/ansible-collections/community.general/pull/11167).
- ansible_type test plugin - fix parameter checking (https://github.com/ansible-collections/community.general/pull/11167).
- cobbler_system - compare the version as a float which is the type returned
by the Cobbler API (https://github.com/ansible-collections/community.general/issues/11044).
- datetime module utils - fix bug in ``fromtimestamp()`` that caused the function
to crash. This function is not used in community.general (https://github.com/ansible-collections/community.general/pull/11206).
- gitlab module utils - add type hints. Pass API version to python-gitlab
as string and not as integer (https://github.com/ansible-collections/community.general/pull/11222).
- homebrew_service - slightly refactor code (https://github.com/ansible-collections/community.general/pull/11168).
- ipinfoio_facts - fix handling of HTTP errors consulting the service (https://github.com/ansible-collections/community.general/pull/11145).
- keys_filter.py plugin utils - fixed requirements check so that other sequences
than lists and strings are checked, and corrected broken formatting during
error reporting (https://github.com/ansible-collections/community.general/pull/11167).
- mas - parse CLI output correctly when listing installed apps with mas 3.0.0+
(https://github.com/ansible-collections/community.general/pull/11179).
- pam_limits - remove ``%`` templating no longer used in f-string (https://github.com/ansible-collections/community.general/pull/11229).
- xcc_redfish_command - fix templating of dictionary keys as list (https://github.com/ansible-collections/community.general/pull/11144).
- zfs - mark change correctly when updating properties whose current value
differs, even if they already have a non-default value (https://github.com/ansible-collections/community.general/issues/11019,
https://github.com/ansible-collections/community.general/pull/11172).
deprecated_features:
- cloud module utils - this module utils is not used by community.general
and will thus be removed from community.general 13.0.0. If you are using
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- database module utils - this module utils is not used by community.general
and will thus be removed from community.general 13.0.0. If you are using
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- dconf - deprecate fallback mechanism when ``gi.repository`` is not available;
fallback will be removed in community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11088).
- known_hosts module utils - this module utils is not used by community.general
and will thus be removed from community.general 13.0.0. If you are using
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- layman - ClearLinux was made EOL in July 2025.; the module will be removed
from community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11087).
- layman - Gentoo deprecated ``layman`` in mid-2023; the module will be removed
from community.general 14.0.0 (https://github.com/ansible-collections/community.general/pull/11070).
- pushbullet - module relies on Python package supporting Python 3.2 only;
the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11224).
- saslprep module utils - this module utils is not used by community.general
and will thus be removed from community.general 13.0.0. If you are using
it from another collection, please copy it over (https://github.com/ansible-collections/community.general/pull/11205).
- spotinst_aws_elastigroup - module relies on Python package supporting Python
2.7 only; the module will be removed from community.general 13.0.0 (https://github.com/ansible-collections/community.general/pull/11069).
minor_changes:
- The last code included in the collection that was licensed under the PSF
2.0 license was removed form the collection. This means that now all code
is either GPLv3+ licensed, MIT licensed, or BSD-2-clause licensed (https://github.com/ansible-collections/community.general/pull/11232).
- _mount module utils - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- _stormssh module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- a_module test plugin - add proper parameter checking and type hints (https://github.com/ansible-collections/community.general/pull/11167).
- aerospike_migrations - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- aix_filesystem - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- ali_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ansible_type plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- ansible_type test plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- apk - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- apt_rpm - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- apt_rpm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- atomic_container - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- atomic_container modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- atomic_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- atomic_image - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- atomic_image modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- awall - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- beadm - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- bigpanda - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- binary_file lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- bitbucket module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- bitbucket_access_key modules - replace ``%`` templating with f-strings or
``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_key_pair modules - replace ``%`` templating with f-strings
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_known_host modules - replace ``%`` templating with f-strings
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- bitbucket_pipeline_variable modules - replace ``%`` templating with f-strings
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- chef_databag lookup plugin - use ``raise ... from ...`` when passing on
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- chroot connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- circonus_annotation - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- cloudflare_dns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- cmd_runner module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- cobbler inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- cobbler_sync - remove conditional code handling SSL for unsupported versions
of Python (https://github.com/ansible-collections/community.general/pull/11078).
- cobbler_sync - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- cobbler_system - remove conditional code handling SSL for unsupported versions
of Python (https://github.com/ansible-collections/community.general/pull/11078).
- cobbler_system - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- collection_version lookup plugin - use ``raise ... from ...`` when passing
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- composer - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- consul_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- counter filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- credstash lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- cronvar - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- crypttab - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- csv module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- csv module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- cyberarkpassword lookup plugin - use ``raise ... from ...`` when passing
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- database module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- database module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- datadog_event - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- datadog_monitor - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- dconf - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- dependent lookup plugin - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- dependent lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- deps module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- dig lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- dimensiondata_network - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- dimensiondata_network modules - replace ``%`` templating with f-strings
or ``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- dnf_config_manager - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- dnstxt lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- dsv lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- elastic callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- etcd3 lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- exceptions module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- filesize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- flatpak - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- flatpak_remote - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- fqdn_valid test plugin - add proper parameter checking, and add type hints
(https://github.com/ansible-collections/community.general/pull/11167).
- from_csv filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- from_ini filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- gandi_livedns_api module utils - remove redundant conversions to unicode
(https://github.com/ansible-collections/community.general/pull/11112).
- github_app_access_token lookup plugin - use ``raise ... from ...`` when
passing on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- gitlab_group_access_token - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- gitlab_group_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- gitlab_project_access_token - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- gitlab_project_members - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- gitlab_runner - allow maximum timeout to be disabled by passing ``0`` to
``maximum_timeout`` (https://github.com/ansible-collections/community.general/pull/11174).
- gitlab_runners inventory plugin - use ``raise ... from ...`` when passing
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- haproxy - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hashids filter - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- hashids filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- hg - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- hg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- hpilo_info - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hpilo_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- htpasswd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- hwc_ecs_instance - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- hwc_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- hwc_utils module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- hwc_vpc_port - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ibm_sa_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- icinga2 inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- icinga2_host - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- identity.keycloak.keycloak module utils - use ``raise ... from ...`` when
passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- idrac_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ilo_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ilo_redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- imc_rest modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- incus connection plugin - add support for Windows virtual machines (https://github.com/ansible-collections/community.general/pull/11199).
- influxdb_query - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- influxdb_user - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- influxdb_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- influxdb_write - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- iocage inventory plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105).
- ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ipa module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- ipa module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- ipa_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_dnsrecord - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_dnszone - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_hbacrule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_hostgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_otpconfig - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_otptoken - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_pwpolicy - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ipa_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_service - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_subca - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ipa_sudocmd - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_sudocmdgroup - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_sudorule - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- ipa_vault - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- iptables_state action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- iso_customize - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- jail connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- jc filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- jenkins_job - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- jenkins_job_info - remove conditional code handling SSL for unsupported
versions of Python (https://github.com/ansible-collections/community.general/pull/11078).
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- jenkins_plugin - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jenkins_plugin - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- jenkins_plugin modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- jenkins_script - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- jira - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- jira - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- json_query filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- keycloak module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- keycloak module_utils - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- keycloak_authentication - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_client_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_component - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_realm - add ``webAuthnPolicyPasswordlessPasskeysEnabled`` parameter
(https://github.com/ansible-collections/community.general/pull/11197).
- keycloak_realm_key - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_realm_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_user_rolemapping - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keycloak_userprofile - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- keys_filter plugin_utils plugin - use ``raise ... from ...`` when passing
on exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- keys_filter.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- known_hosts module utils - improve code by using native Python construct
(https://github.com/ansible-collections/community.general/pull/11215).
- layman - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- ldap module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- ldap_attrs - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_entry - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_inc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11104).
- ldap_search - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- linode inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- listen_ports_facts - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- listen_ports_facts - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- lmdb_kv lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- locale_gen - extend the search for available locales to include ``/usr/local/share/i18n/SUPPORTED``
in Debian and Ubuntu systems (https://github.com/ansible-collections/community.general/issues/10964,
https://github.com/ansible-collections/community.general/pull/11046).
- logentries - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- lxc connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- lxd connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- lxd inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- lxd module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- lxd module utils - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- lxd_container - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- macports - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- mail - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- maven_artifact - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- merge_variables - extend type detection failure message to allow users for
easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).
- merge_variables lookup plugin - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- modprobe - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- net_tools.pritunl.api module utils - use ``raise ... from ...`` when passing
on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- nmap inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- nmcli - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- nmcli - fix comparison of type (https://github.com/ansible-collections/community.general/pull/11121).
- nmcli modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nomad_job - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- nomad_job_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nomad_token - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- nosh - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- ocapi_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- ocapi_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- oci_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- oci_utils module utils - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- oneandone_firewall_policy - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_load_balancer - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_monitoring_policy - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_private_network - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- oneandone_server - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11231).
- oneandone_server modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
- onepassword lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- onepassword_info - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11193).
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- onepassword_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- oneview module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- online inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- opennebula inventory plugin - use ``raise ... from ...`` when passing on
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- opentelemetry callback plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- osx_defaults - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- packet_device - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11231).
- packet_device modules - mark ``%`` templating as ``noqa`` (https://github.com/ansible-collections/community.general/pull/11223).
- packet_ip_subnet - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11097).
- packet_project - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- packet_sshkey - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- packet_volume - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- pamd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- parted - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- passwordstore lookup plugin - use ``raise ... from ...`` when passing on
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- pear - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- pids - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pids - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- portage - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- pritunl_org - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_org_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pritunl_user_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- pushbullet modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- read_csv - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- redfish_config - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- redfish_utils module utils - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- redfish_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- redhat_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- redhat_subscription - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- redis cache plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- redis lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- revbitspss lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- rhevm - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- riak - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- rundeck module utils - improve handling the return value ``exception``.
It now contains the full stack trace of the exception, while the message
is included in ``msg`` (https://github.com/ansible-collections/community.general/pull/11149).
- scaleway inventory plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- scaleway_user_data modules - replace ``%`` templating with f-strings or
``format()`` (https://github.com/ansible-collections/community.general/pull/11223).
- selinux_permissive - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_check - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_silence - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- sensu_silence modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- sensu_subscription - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- shelvefile lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- shutdown action plugin - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- shutdown action plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- slack - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- slackpkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- snap - improve templating of strings (https://github.com/ansible-collections/community.general/pull/11189).
- snmp_facts - simplify and improve code using standard Ansible validations
(https://github.com/ansible-collections/community.general/pull/11148).
- solaris_zone - execute external commands using Ansible construct (https://github.com/ansible-collections/community.general/pull/11192).
- solaris_zone - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- spectrum_model_attrs - convert ``%`` templating to f-string (https://github.com/ansible-collections/community.general/pull/11229).
- statusio_maintenance - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- sudoers - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- svc - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- svr4pkg - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- swupd - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- to_ini filter plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- tss lookup plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- univention_umc module utils - update code to Python 3 (https://github.com/ansible-collections/community.general/pull/11122).
- unsafe.py plugin utils - add type hints (https://github.com/ansible-collections/community.general/pull/11167).
- urpmi - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- utm_aaa_group - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_aaa_group_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_ca_host_key_cert - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_ca_host_key_cert_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_dns_host - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_network_interface_address - remove redundant conversions to unicode
(https://github.com/ansible-collections/community.general/pull/11098).
- utm_network_interface_address_info - remove redundant conversions to unicode
(https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_auth_profile - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_exception - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_frontend - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_frontend_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_location - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_proxy_location_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- utm_utils module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- utm_utils module utils - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11112).
- vertica_configuration - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_configuration - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_role - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_role - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_schema - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_schema - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_schema - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- vertica_user - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- vertica_user - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- vertica_user - use ``raise ... from ...`` when passing on exceptions (https://github.com/ansible-collections/community.general/pull/11097).
- virtualbox inventory plugin - use ``raise ... from ...`` when passing on
exceptions (https://github.com/ansible-collections/community.general/pull/11095).
- vmadm - in case of failure, the module no longer returns the stderr output
as ``exception``, but instead as ``stderr``. Other information (``stdout``,
``rc``) is now also returned (https://github.com/ansible-collections/community.general/pull/11149).
- vmadm - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11102).
- wakeonlan - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11098).
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- wdc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- wdc_redfish_info - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- wsl connection plugin - adjust variable name for integration tests (https://github.com/ansible-collections/community.general/pull/11190).
- wsl connection plugin - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- wsl connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
- xbps - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- xbps - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- xcc_redfish_command - fix cases of unused variables in loops (https://github.com/ansible-collections/community.general/pull/11115).
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11110).
- xcc_redfish_command - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/1114).
- xenserver module utils - improve code by using native Python construct (https://github.com/ansible-collections/community.general/pull/11215).
- xenserver module utils - simplify return of boolean values in functions
(https://github.com/ansible-collections/community.general/pull/11119).
- xenserver_guest modules - replace ``%`` templating with f-strings or ``format()``
(https://github.com/ansible-collections/community.general/pull/11223).
- xml - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11106).
- xml - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- yum_versionlock - remove redundant conversion to unicode in command output
(https://github.com/ansible-collections/community.general/pull/11093).
- zfs - simplify return of boolean values in functions (https://github.com/ansible-collections/community.general/pull/11119).
- zone connection plugin - use ``raise ... from ...`` when passing on exceptions
(https://github.com/ansible-collections/community.general/pull/11095).
release_summary: Regular bugfix and feature release.
fragments:
- 11045-check-cobbler-version.yml
- 11046-locale-gen-usrlocal.yml
- 11069-deprecate-spotinst.yml
- 11070-deprecate-layman.yml
- 11078-py2-ssl.yml
- 11087-deprecate-swupd.yml
- 11088-deprecate-dconf-fallback.yml
- 11093-yum-versionlock-to-native.yml
- 11095-raise-from.yml
- 11097-raise-from.yml
- 11098-tonative-1.yml
- 11102-tonative-2.yml
- 11104-tonative-3.yml
- 11105-tonative-4.yml
- 11106-tonative-5.yml
- 11107-extend-merge-variables-failure-message.yml
- 11110-tonative-6.yml
- 11112-tonative-7.yml
- 11115-ruff-cases-1.yml
- 11119-ruff-cases-2.yml
- 11121-ruff-cases-3.yml
- 11122-yield-from-ignore.yml
- 11143-tonative-8.yml
- 11144-xcc-redfish-command-listkeys.yml
- 11145-ruff-cases-4.yml
- 11148-snmp-facts-improve.yml
- 11149-rv-exception.yml
- 11167-typing.yml
- 11168-homebrew_service.yml
- 11172-zfs-changed-extra-props.yml
- 11174-gitlab-runner-timeout.yml
- 11179-mas-list-parsing.yml
- 11189-ruff-cases-6.yml
- 11190-ruff-cases-7.yml
- 11192-solaris-zone-os-system.yml
- 11193-onepassword-info-popen.yml
- 11197-keycloak-realm-webauthnpolicypasswordlesspasskeysenabled.yml
- 11199-incus-windows.yml
- 11205-module_utils.yml
- 11206-datetime.yml
- 11215-ruff-cases-8.yml
- 11222-typing.yml
- 11223-ruff-cases-9.yml
- 11224-deprecate-pushbullet.yml
- 11229-fstr-mishaps.yml
- 11231-perc-format.yml
- 11232-mount.yml
- 12.1.0.yml
modules:
- description: Remove files matching a pattern from a directory.
name: file_remove
namespace: ''
- description: Retrieve information about LXD storage pools.
name: lxd_storage_pool_info
namespace: ''
- description: Retrieve information about LXD storage volumes.
name: lxd_storage_volume_info
namespace: ''
release_date: '2025-12-01'
12.2.0:
changes:
bugfixes:
- apk - fix ``packages`` return value for apk-tools >= 3 (Alpine 3.23) (https://github.com/ansible-collections/community.general/issues/11264).
- iptables_state - refactor code to avoid writing unnecessary temporary files
(https://github.com/ansible-collections/community.general/pull/11258).
- keycloak_realm - fixed crash in ``sanitize_cr()`` when ``realmrep`` was
``None`` (https://github.com/ansible-collections/community.general/pull/11260).
- keycloak_user_rolemapping module - fixed crash when assigning roles to users
without an existing role (https://github.com/ansible-collections/community.general/issues/10960,
https://github.com/ansible-collections/community.general/pull/11256).
- listen_ports_facts - fix handling of empty PID lists when ``command=ss``
(https://github.com/ansible-collections/community.general/pull/11332).
- monit - add delay of 0.5 seconds after state change and check for status
(https://github.com/ansible-collections/community.general/pull/11255).
- monit - internal state was not reflecting when operation is "pending" in
``monit`` (https://github.com/ansible-collections/community.general/pull/11245).
deprecated_features:
- All module utils, plugin utils, and doc fragments will be made **private**
in community.general 13.0.0. This means that they will no longer be part
of the public API of the collection, and can have breaking changes even
in bugfix releases. If you depend on importing code from the module or plugin
utils, or use one of the doc fragments, please `comment in the issue to
discuss this <https://github.com/ansible-collections/community.general/issues/11312>`__.
Note that this does not affect any use of community.general in task files,
roles, or playbooks (https://github.com/ansible-collections/community.general/issues/11312,
https://github.com/ansible-collections/community.general/pull/11320).
minor_changes:
- btrfs module utils - make execution of external commands safer by passing
arguments as list (https://github.com/ansible-collections/community.general/pull/11240).
- deps module utils - change the internal representaion of dependency state
(https://github.com/ansible-collections/community.general/pull/11242).
- keycloak_userprofile - add support for ``selector`` option (https://github.com/ansible-collections/community.general/pull/11309).
- keycloak_userprofile - add support for additional user profile attribute-validations
available in Keycloak (https://github.com/ansible-collections/community.general/issues/9048,
https://github.com/ansible-collections/community.general/pull/11285).
- lxc_container - refactor function ``create_script``, using ``subprocess.Popen()``,
to a new module_utils ``_lxc`` (https://github.com/ansible-collections/community.general/pull/11204).
- lxc_container - use ``tempfile.TemporaryDirectory()`` instead of ``mkdtemp()``
(https://github.com/ansible-collections/community.general/pull/11323).
- monit - add ``monit_version`` return value also when the module has succeeded
(https://github.com/ansible-collections/community.general/pull/11255).
- monit - use ``Enum`` to represent the possible states (https://github.com/ansible-collections/community.general/pull/11245).
- nmcli module - add ``vxlan_parent`` option required for multicast ``vxlan_remote``
addresses; add ``vxlan`` to list of bridgeable devices (https://github.com/ansible-collections/community.general/pull/11182).
- scaleway inventory plugin - added support for ``SCW_PROFILE`` environment
variable for the ``scw_profile`` option (https://github.com/ansible-collections/community.general/issues/11310,
https://github.com/ansible-collections/community.general/pull/11311).
- scaleway module utils - added ``scw_profile`` parameter with ``SCW_PROFILE``
environment variable support (https://github.com/ansible-collections/community.general/issues/11313,
https://github.com/ansible-collections/community.general/pull/11314).
release_summary: Feature and bugfix release.
fragments:
- 11182-vxlan-parent-bridging.yml
- 11204-lxc-container-popen.yml
- 11240-btrfs-run-command.yml
- 11242-deps-enum.yml
- 11245-monit-enum.yml
- 11255-monit-integrationtests.yml
- 11256-fix-keycloak-roles-mapping.yml
- 11258-iptables_state.yml
- 11260-keycloak-realm-crash-when-no-realms.yml
- 11265-fix-apk-3.yml
- 11285-extended-keycloak-user-profile-validations.yml
- 11309-keycloak-userprofile-selector-option.yml
- 11311-scaleway-scw-profile-var.yml
- 11314-scaleway-scw-profile-var-modules.yml
- 11323-lxc-container-tempdir.yml
- 12.2.0.yml
- listen-ports-facts-return-no-facts.yml
- private.yml
modules:
- description: Retrieve IP geolocation information of a host's IP address.
name: ip2location_info
namespace: ''
- description: Check SSSD domain status using D-Bus.
name: sssd_info
namespace: ''
release_date: '2025-12-29'

View File

@@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
Committers Guidelines for community.general
===========================================
This document is based on the [Ansible committer guidelines](https://github.com/ansible/ansible/blob/b57444af14062ec96e0af75fdfc2098c74fe2d9a/docs/docsite/rst/community/committer_guidelines.rst) ([latest version](https://docs.ansible.com/ansible/devel/community/committer_guidelines.html)).
This document is based on the [Ansible committer guidelines](https://github.com/ansible/ansible/blob/b57444af14062ec96e0af75fdfc2098c74fe2d9a/docs/docsite/rst/community/committer_guidelines.rst) ([latest version](https://docs.ansible.com/projects/ansible/devel/community/committer_guidelines.html)).
These are the guidelines for people with commit privileges on the Ansible Community General Collection GitHub repository. Please read the guidelines before you commit.
@@ -45,7 +45,7 @@ Individuals with direct commit access to this collection repository are entruste
- Do not commit directly.
- Do not merge your own PRs. Someone else should have a chance to review and approve the PR merge. You have a small amount of leeway here for very minor changes.
- Do not forget about non-standard / alternate environments. Consider the alternatives. Yes, people have bad/unusual/strange environments (like binaries from multiple init systems installed), but they are the ones who need us the most.
- Do not drag your community team members down. Discuss the technical merits of any pull requests you review. Avoid negativity and personal comments. For more guidance on being a good community member, read the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
- Do not drag your community team members down. Discuss the technical merits of any pull requests you review. Avoid negativity and personal comments. For more guidance on being a good community member, read the [Ansible Community Code of Conduct](https://docs.ansible.com/projects/ansible/latest/community/code_of_conduct.html).
- Do not forget about the maintenance burden. High-maintenance features may not be worth adding.
- Do not break playbooks. Always keep backwards compatibility in mind.
- Do not forget to keep it simple. Complexity breeds all kinds of problems.

View File

@@ -10,7 +10,7 @@ from ruamel.yaml import YAML
def main() -> None:
yaml = YAML(typ='rt')
yaml = YAML(typ="rt")
yaml.indent(mapping=2, sequence=4, offset=2)
# Load
@@ -19,7 +19,7 @@ def main() -> None:
# Dump
sio = StringIO()
yaml.dump(data, sio)
print(sio.getvalue().rstrip('\n'))
print(sio.getvalue().rstrip("\n"))
if __name__ == "__main__":

View File

@@ -21,7 +21,7 @@ That is where ``ModuleHelper`` comes to assistance: a lot of that boilerplate co
Quickstart
""""""""""
See the `example from Ansible documentation <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
See the `example from Ansible documentation <https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
written with ``ModuleHelper``.
But bear in mind that it does not showcase all of MH's features:
@@ -550,9 +550,9 @@ The other option is to use the parameter ``value``, in which case the method wil
References
^^^^^^^^^^
- `Ansible Developer Guide <https://docs.ansible.com/ansible/latest/dev_guide/index.html>`_
- `Creating a module <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
- `Returning ansible facts <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#ansible-facts>`_
- `Ansible Developer Guide <https://docs.ansible.com/projects/ansible/latest/dev_guide/index.html>`_
- `Creating a module <https://docs.ansible.com/projects/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module>`_
- `Returning ansible facts <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#ansible-facts>`_
- :ref:`ansible_collections.community.general.docsite.guide_vardict`

View File

@@ -5,7 +5,7 @@
namespace: community
name: general
version: 12.0.0
version: 12.2.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
@@ -16,6 +16,6 @@ license_file: COPYING
tags:
- community
repository: https://github.com/ansible-collections/community.general
documentation: https://docs.ansible.com/ansible/latest/collections/community/general/
documentation: https://docs.ansible.com/projects/ansible/latest/collections/community/general/
homepage: https://github.com/ansible-collections/community.general
issues: https://github.com/ansible-collections/community.general/issues

View File

@@ -398,6 +398,10 @@ plugin_routing:
redirect: community.kubevirt.kubevirt_template
kubevirt_vm:
redirect: community.kubevirt.kubevirt_vm
layman:
deprecation:
removal_version: 14.0.0
warning_text: Gentoo deprecated C(layman) in mid-2023.
ldap_attr:
tombstone:
removal_version: 3.0.0
@@ -833,6 +837,10 @@ plugin_routing:
tombstone:
removal_version: 3.0.0
warning_text: Use purestorage.flashblade.purefb_info instead.
pushbullet:
deprecation:
removal_version: 13.0.0
warning_text: Module relies on Python package pushbullet.py which is not maintained and supports only up to Python 3.2.
python_requirements_facts:
tombstone:
removal_version: 3.0.0
@@ -1029,12 +1037,20 @@ plugin_routing:
tombstone:
removal_version: 3.0.0
warning_text: Use community.general.smartos_image_info instead.
spotinst_aws_elastigroup:
deprecation:
removal_version: 13.0.0
warning_text: Module relies on unsupported Python package. Use the module spot.cloud_modules.aws_elastigroup instead.
stackdriver:
tombstone:
removal_version: 9.0.0
warning_text: This module relied on HTTPS APIs that do not exist anymore,
and any new development in the direction of providing an alternative should
happen in the context of the google.cloud collection.
swupd:
deprecation:
removal_version: 15.0.0
warning_text: ClearLinux was made EOL in July 2025. If you think the module is still useful for another distribution, please create an issue in the community.general repository.
typetalk:
deprecation:
removal_version: 13.0.0
@@ -1134,6 +1150,14 @@ plugin_routing:
warning_text: This doc fragment was used by rax modules, that relied on the deprecated
package pyrax.
module_utils:
cloud:
deprecation:
removal_version: 13.0.0
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
database:
deprecation:
removal_version: 13.0.0
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
dimensiondata:
deprecation:
removal_version: 13.0.0
@@ -1150,6 +1174,10 @@ plugin_routing:
redirect: community.google.gcp
hetzner:
redirect: community.hrobot.robot
known_hosts:
deprecation:
removal_version: 13.0.0
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
kubevirt:
redirect: community.kubevirt.kubevirt
net_tools.nios.api:
@@ -1181,6 +1209,10 @@ plugin_routing:
redirect: dellemc.openmanage.dellemc_idrac
remote_management.dellemc.ome:
redirect: dellemc.openmanage.ome
saslprep:
deprecation:
removal_version: 13.0.0
warning_text: This code is not used by community.general. If you want to use it in another collection, please copy it over.
inventory:
docker_machine:
redirect: community.docker.docker_machine

View File

@@ -5,6 +5,7 @@
from __future__ import annotations
import time
import typing as t
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleActionFail, AnsibleConnectionFailure
@@ -20,7 +21,7 @@ class ActionModule(ActionBase):
DEFAULT_SUDOABLE = True
@staticmethod
def msg_error__async_and_poll_not_zero(task_poll, task_async, max_timeout):
def msg_error__async_and_poll_not_zero(task_poll, task_async, max_timeout) -> str:
return (
"This module doesn't support async>0 and poll>0 when its 'state' param "
"is set to 'restored'. To enable its rollback feature (that needs the "
@@ -30,7 +31,7 @@ class ActionModule(ActionBase):
)
@staticmethod
def msg_warning__no_async_is_no_rollback(task_poll, task_async, max_timeout):
def msg_warning__no_async_is_no_rollback(task_poll, task_async, max_timeout) -> str:
return (
"Attempts to restore iptables state without rollback in case of mistake "
"may lead the ansible controller to loose access to the hosts and never "
@@ -41,7 +42,7 @@ class ActionModule(ActionBase):
)
@staticmethod
def msg_warning__async_greater_than_timeout(task_poll, task_async, max_timeout):
def msg_warning__async_greater_than_timeout(task_poll, task_async, max_timeout) -> str:
return (
"You attempt to restore iptables state with rollback in case of mistake, "
"but with settings that will lead this rollback to happen AFTER that the "
@@ -50,7 +51,9 @@ class ActionModule(ActionBase):
f"'ansible_timeout' (={max_timeout}) (recommended)."
)
def _async_result(self, async_status_args, task_vars, timeout):
def _async_result(
self, async_status_args: dict[str, t.Any], task_vars: dict[str, t.Any], timeout: int
) -> dict[str, t.Any]:
"""
Retrieve results of the asynchronous task, and display them in place of
the async wrapper results (those with the ansible_job_id key).
@@ -81,10 +84,13 @@ class ActionModule(ActionBase):
return async_result
def run(self, tmp=None, task_vars=None):
def run(self, tmp: str | None = None, task_vars: dict[str, t.Any] | None = None) -> dict[str, t.Any]:
self._supports_check_mode = True
self._supports_async = True
if task_vars is None:
task_vars = {}
result = super().run(tmp, task_vars)
del tmp # tmp no longer has any effect

View File

@@ -7,19 +7,25 @@
from __future__ import annotations
import typing as t
from ansible.errors import AnsibleError, AnsibleConnectionFailure
from ansible.module_utils.common.text.converters import to_native, to_text
from ansible.module_utils.common.collections import is_string
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
if t.TYPE_CHECKING:
class Distribution(t.TypedDict):
name: str
version: str
family: str
display = Display()
def fmt(mapping, key):
return to_native(mapping[key]).strip()
class TimedOutException(Exception):
pass
@@ -60,25 +66,23 @@ class ActionModule(ActionBase):
def delay(self):
return self._check_delay("delay", self.DEFAULT_PRE_SHUTDOWN_DELAY)
def _check_delay(self, key, default):
def _check_delay(self, key: str, default: int) -> int:
"""Ensure that the value is positive or zero"""
value = int(self._task.args.get(key, default))
if value < 0:
value = 0
return value
def _get_value_from_facts(self, variable_name, distribution, default_value):
@staticmethod
def _get_value_from_facts(data: dict[str, str], distribution: Distribution, default_value: str) -> str:
"""Get dist+version specific args first, then distribution, then family, lastly use default"""
attr = getattr(self, variable_name)
value = attr.get(
return data.get(
distribution["name"] + distribution["version"],
attr.get(distribution["name"], attr.get(distribution["family"], getattr(self, default_value))),
data.get(distribution["name"], data.get(distribution["family"], default_value)),
)
return value
def get_distribution(self, task_vars):
def get_distribution(self, task_vars: dict[str, t.Any]) -> Distribution:
# FIXME: only execute the module if we don't already have the facts we need
distribution = {}
display.debug(f"{self._task.action}: running setup module to get distribution")
module_output = self._execute_module(
task_vars=task_vars, module_name="ansible.legacy.setup", module_args={"gather_subset": "min"}
@@ -86,20 +90,20 @@ class ActionModule(ActionBase):
try:
if module_output.get("failed", False):
raise AnsibleError(
f"Failed to determine system distribution. {fmt(module_output, 'module_stdout')}, {fmt(module_output, 'module_stderr')}"
f"Failed to determine system distribution. {to_native(module_output['module_stdout'])}, {to_native(module_output['module_stderr'])}"
)
distribution["name"] = module_output["ansible_facts"]["ansible_distribution"].lower()
distribution["version"] = to_text(
module_output["ansible_facts"]["ansible_distribution_version"].split(".")[0]
)
distribution["family"] = to_text(module_output["ansible_facts"]["ansible_os_family"].lower())
distribution: Distribution = {
"name": module_output["ansible_facts"]["ansible_distribution"].lower(),
"version": to_text(module_output["ansible_facts"]["ansible_distribution_version"].split(".")[0]),
"family": to_text(module_output["ansible_facts"]["ansible_os_family"].lower()),
}
display.debug(f"{self._task.action}: distribution: {distribution}")
return distribution
except KeyError as ke:
raise AnsibleError(f'Failed to get distribution information. Missing "{ke.args[0]}" in output.')
raise AnsibleError(f'Failed to get distribution information. Missing "{ke.args[0]}" in output.') from ke
def get_shutdown_command(self, task_vars, distribution):
def find_command(command, find_search_paths):
def get_shutdown_command(self, task_vars: dict[str, t.Any], distribution: Distribution) -> str:
def find_command(command: str, find_search_paths: list[str]) -> list[str]:
display.debug(
f'{self._task.action}: running find module looking in {find_search_paths} to get path for "{command}"'
)
@@ -111,7 +115,7 @@ class ActionModule(ActionBase):
)
return [x["path"] for x in find_result["files"]]
shutdown_bin = self._get_value_from_facts("SHUTDOWN_COMMANDS", distribution, "DEFAULT_SHUTDOWN_COMMAND")
shutdown_bin = self._get_value_from_facts(self.SHUTDOWN_COMMANDS, distribution, self.DEFAULT_SHUTDOWN_COMMAND)
default_search_paths = ["/sbin", "/usr/sbin", "/usr/local/sbin"]
search_paths = self._task.args.get("search_paths", default_search_paths)
@@ -124,10 +128,10 @@ class ActionModule(ActionBase):
incorrect_type = any(not is_string(x) for x in search_paths)
if not isinstance(search_paths, list) or incorrect_type:
raise TypeError
except TypeError:
except TypeError as e:
# Error if we didn't get a list
err_msg = f"'search_paths' must be a string or flat list of strings, got {search_paths}"
raise AnsibleError(err_msg)
raise AnsibleError(err_msg) from e
full_path = find_command(shutdown_bin, search_paths) # find the path to the shutdown command
if not full_path: # if we could not find the shutdown command
@@ -146,7 +150,7 @@ class ActionModule(ActionBase):
return f"{full_path[0]} poweroff" # done, since we cannot use args with systemd shutdown
# systemd case taken care of, here we add args to the command
args = self._get_value_from_facts("SHUTDOWN_COMMAND_ARGS", distribution, "DEFAULT_SHUTDOWN_COMMAND_ARGS")
args = self._get_value_from_facts(self.SHUTDOWN_COMMAND_ARGS, distribution, self.DEFAULT_SHUTDOWN_COMMAND_ARGS)
# Convert seconds to minutes. If less that 60, set it to 0.
delay_sec = self.delay
shutdown_message = self._task.args.get("msg", self.DEFAULT_SHUTDOWN_MESSAGE)
@@ -154,8 +158,8 @@ class ActionModule(ActionBase):
af = args.format(delay_sec=delay_sec, delay_min=delay_sec // 60, message=shutdown_message)
return f"{full_path[0]} {af}"
def perform_shutdown(self, task_vars, distribution):
result = {}
def perform_shutdown(self, task_vars, distribution) -> dict[str, t.Any]:
result: dict[str, t.Any] = {}
shutdown_result = {}
shutdown_command_exec = self.get_shutdown_command(task_vars, distribution)
@@ -176,7 +180,7 @@ class ActionModule(ActionBase):
result["failed"] = True
result["shutdown"] = False
result["msg"] = (
f"Shutdown command failed. Error was {fmt(shutdown_result, 'stdout')}, {fmt(shutdown_result, 'stderr')}"
f"Shutdown command failed. Error was {to_native(shutdown_result['stdout'])}, {to_native(shutdown_result['stderr'])}"
)
return result
@@ -184,7 +188,7 @@ class ActionModule(ActionBase):
result["shutdown_command"] = shutdown_command_exec
return result
def run(self, tmp=None, task_vars=None):
def run(self, tmp: str | None = None, task_vars: dict[str, t.Any] | None = None) -> dict[str, t.Any]:
self._supports_check_mode = True
self._supports_async = True

View File

@@ -147,8 +147,10 @@ class CacheModule(BaseCacheModule):
"""
try:
from redis.sentinel import Sentinel
except ImportError:
raise AnsibleError("The 'redis' python module (version 2.9.0 or newer) is required to use redis sentinel.")
except ImportError as e:
raise AnsibleError(
"The 'redis' python module (version 2.9.0 or newer) is required to use redis sentinel."
) from e
if ";" not in uri:
raise AnsibleError("_uri does not have sentinel syntax.")
@@ -170,7 +172,7 @@ class CacheModule(BaseCacheModule):
try:
return scon.master_for(self._sentinel_service_name, socket_timeout=0.2)
except Exception as exc:
raise AnsibleError(f"Could not connect to redis sentinel: {exc}")
raise AnsibleError(f"Could not connect to redis sentinel: {exc}") from exc
def _make_key(self, key):
return self._prefix + key

View File

@@ -37,7 +37,7 @@ notes:
seealso:
- name: default default Ansible screen output
description: The official documentation on the B(default) callback plugin.
link: https://docs.ansible.com/ansible/latest/plugins/callback/default.html
link: https://docs.ansible.com/projects/ansible/latest/plugins/callback/default.html
requirements:
- set as stdout_callback in configuration
options:

View File

@@ -145,7 +145,7 @@ class ElasticSource:
self.host = socket.gethostname()
try:
self.ip_address = socket.gethostbyname(socket.gethostname())
except Exception as e:
except Exception:
self.ip_address = None
self.user = getpass.getuser()
@@ -201,7 +201,7 @@ class ElasticSource:
tasks = []
parent_start_time = None
for task_uuid, task in tasks_data.items():
for task in tasks_data.values():
if parent_start_time is None:
parent_start_time = task.start
tasks.append(task)
@@ -224,7 +224,7 @@ class ElasticSource:
label(ansible_host_ip=self.ip_address)
for task_data in tasks:
for host_uuid, host_data in task_data.host_data.items():
for host_data in task_data.host_data.values():
self.create_span_data(apm_cli, task_data, host_data)
apm_cli.end_transaction(name=__name__, result=status, duration=end_time - parent_start_time)

View File

@@ -254,7 +254,7 @@ class CallbackModule(CallbackBase):
try:
self.token = self.get_option("token")
except KeyError as e:
except KeyError:
self._display.warning(
"Logentries token was not provided, this is required for this callback to operate, disabling"
)

View File

@@ -210,7 +210,7 @@ class OpenTelemetrySource:
self.host = socket.gethostname()
try:
self.ip_address = socket.gethostbyname(socket.gethostname())
except Exception as e:
except Exception:
self.ip_address = None
self.user = getpass.getuser()
@@ -272,7 +272,7 @@ class OpenTelemetrySource:
tasks = []
parent_start_time = None
for task_uuid, task in tasks_data.items():
for task in tasks_data.values():
if parent_start_time is None:
parent_start_time = task.start
tasks.append(task)
@@ -309,7 +309,7 @@ class OpenTelemetrySource:
parent.set_attribute("ansible.host.ip", self.ip_address)
parent.set_attribute("ansible.host.user", self.user)
for task in tasks:
for host_uuid, host_data in task.host_data.items():
for host_data in task.host_data.values():
with tracer.start_as_current_span(task.name, start_time=task.start, end_on_exit=False) as span:
self.update_span_data(task, host_data, span, disable_logs, disable_attributes_in_logs)

View File

@@ -129,7 +129,7 @@ class CallbackModule(CallbackBase):
def v2_runner_on_async_failed(self, result):
res = result._result
host = result._host.get_name()
jid = result._result.get("ansible_job_id")
# jid = result._result.get("ansible_job_id")
self.logger.error(
"%s ansible-command: task execution FAILED; host: %s; message: %s",
self.hostname,

View File

@@ -119,5 +119,5 @@ class CallbackModule(Default):
tzinfo = ZoneInfo(self.get_option("timezone"))
# Inject options into the display object
setattr(self._display, "timestamp_tzinfo", tzinfo)
setattr(self._display, "timestamp_format_string", self.get_option("format_string"))
self._display.timestamp_tzinfo = tzinfo
self._display.timestamp_format_string = self.get_option("format_string")

View File

@@ -129,7 +129,7 @@ class Connection(ConnectionBase):
try:
self.chroot_cmd = get_bin_path(self.get_option("chroot_exe"))
except ValueError as e:
raise AnsibleError(str(e))
raise AnsibleError(str(e)) from e
super()._connect()
if not self._connected:
@@ -191,17 +191,17 @@ class Connection(ConnectionBase):
count = ""
try:
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
except OSError:
raise AnsibleError("chroot connection requires dd command in the chroot")
except OSError as e:
raise AnsibleError("chroot connection requires dd command in the chroot") from e
try:
stdout, stderr = p.communicate()
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
if p.returncode != 0:
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
except IOError:
raise AnsibleError(f"file or module does not exist at: {in_path}")
except IOError as e:
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
def fetch_file(self, in_path, out_path):
"""fetch a file from chroot to local"""
@@ -211,8 +211,8 @@ class Connection(ConnectionBase):
in_path = shlex_quote(self._prefix_login_path(in_path))
try:
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
except OSError:
raise AnsibleError("chroot connection requires dd command in the chroot")
except OSError as e:
raise AnsibleError("chroot connection requires dd command in the chroot") from e
with open(to_bytes(out_path, errors="surrogate_or_strict"), "wb+") as out_file:
try:
@@ -220,9 +220,9 @@ class Connection(ConnectionBase):
while chunk:
out_file.write(chunk)
chunk = p.stdout.read(BUFSIZE)
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
stdout, stderr = p.communicate()
if p.returncode != 0:
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")

View File

@@ -13,6 +13,9 @@ short_description: Run tasks in Incus instances using the Incus CLI
description:
- Run commands or put/fetch files to an existing Incus instance using Incus CLI.
version_added: "8.2.0"
notes:
- When using this collection for Windows virtual machines, set C(ansible_shell_type) to C(powershell) or C(cmd) as a variable to the host in
the inventory.
options:
remote_addr:
description:
@@ -75,6 +78,7 @@ options:
"""
import os
import re
from subprocess import call, Popen, PIPE
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
@@ -97,6 +101,23 @@ class Connection(ConnectionBase):
if not self._incus_cmd:
raise AnsibleError("incus command not found in PATH")
if getattr(self._shell, "_IS_WINDOWS", False):
# Initializing regular expression patterns to match on a PowerShell or cmd command line.
self.powershell_regex_pattern = re.compile(
r"^(?P<executable>(\"?([a-z]:)?[a-z0-9 ()\\.]+)?powershell(\.exe)?\"?|(([a-z]:)?[a-z0-9()\\.]+)?powershell(\.exe)?)\s+.*(?P<command>-c(ommand)?)\s+", # noqa: E501
re.IGNORECASE,
)
self.cmd_regex_pattern = re.compile(
r"^(?P<executable>(\"?([a-z]:)?[a-z0-9 ()\\.]+)?cmd(\.exe)?\"?|(([a-z]:)?[a-z0-9()\\.]+)?cmd(\.exe)?)\s+.*(?P<command>/c)\s+",
re.IGNORECASE,
)
# Basic setup for a Windows host.
self.has_native_async = True
self.always_pipeline_modules = True
self.module_implementation_preferences = (".ps1", ".exe", "")
self.allow_executable = False
def _connect(self):
"""connect to Incus (nothing to do here)"""
super()._connect()
@@ -115,19 +136,49 @@ class Connection(ConnectionBase):
"--project",
self.get_option("project"),
"exec",
*(["-T"] if getattr(self._shell, "_IS_WINDOWS", False) else []),
f"{self.get_option('remote')}:{self._instance()}",
"--",
]
if self.get_option("remote_user") != "root":
self._display.vvv(
f"INFO: Running as non-root user: {self.get_option('remote_user')}, \
trying to run 'incus exec' with become method: {self.get_option('incus_become_method')}",
host=self._instance(),
)
exec_cmd.extend([self.get_option("incus_become_method"), self.get_option("remote_user"), "-c"])
if getattr(self._shell, "_IS_WINDOWS", False):
if (
(regex_match := self.powershell_regex_pattern.match(cmd))
and (regex_pattern := self.powershell_regex_pattern)
) or ((regex_match := self.cmd_regex_pattern.match(cmd)) and (regex_pattern := self.cmd_regex_pattern)):
self._display.vvvvvv(
f'Found keyword: "{regex_match.group("command")}" based on regex: {regex_pattern.pattern}',
host=self._instance(),
)
exec_cmd.extend([self.get_option("executable"), "-c", cmd])
# Split the command on the argument -c(ommand) for PowerShell or /c for cmd.
before_command_argument, after_command_argument = cmd.split(regex_match.group("command"), 1)
exec_cmd.extend(
[
# To avoid splitting on a space contained in the path, set the executable as the first argument.
regex_match.group("executable").strip('"'),
# Remove the executable path and split the rest by space.
*(before_command_argument[len(regex_match.group("executable")) :].lstrip().split(" ")),
# Set the command argument depending on cmd or powershell.
regex_match.group("command"),
# Add the rest of the command at the end.
after_command_argument,
]
)
else:
# For anything else using -EncodedCommand or else, just split on space.
exec_cmd.extend(cmd.split(" "))
else:
if self.get_option("remote_user") != "root":
self._display.vvv(
f"INFO: Running as non-root user: {self.get_option('remote_user')}, \
trying to run 'incus exec' with become method: {self.get_option('incus_become_method')}",
host=self._instance(),
)
exec_cmd.extend([self.get_option("incus_become_method"), self.get_option("remote_user"), "-c"])
exec_cmd.extend([self.get_option("executable"), "-c", cmd])
return exec_cmd
@@ -200,7 +251,7 @@ class Connection(ConnectionBase):
if not os.path.isfile(to_bytes(in_path, errors="surrogate_or_strict")):
raise AnsibleFileNotFound(f"input path is not a file: {in_path}")
if self.get_option("remote_user") != "root":
if not getattr(self._shell, "_IS_WINDOWS", False) and self.get_option("remote_user") != "root":
uid, gid = self._get_remote_uid_gid()
local_cmd = [
self._incus_cmd,

View File

@@ -79,8 +79,8 @@ class Connection(ConnectionBase):
def _search_executable(executable):
try:
return get_bin_path(executable)
except ValueError:
raise AnsibleError(f"{executable} command not found in PATH")
except ValueError as e:
raise AnsibleError(f"{executable} command not found in PATH") from e
def list_jails(self):
p = subprocess.Popen(
@@ -161,19 +161,19 @@ class Connection(ConnectionBase):
count = ""
try:
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
except OSError:
raise AnsibleError("jail connection requires dd command in the jail")
except OSError as e:
raise AnsibleError("jail connection requires dd command in the jail") from e
try:
stdout, stderr = p.communicate()
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
if p.returncode != 0:
raise AnsibleError(
f"failed to transfer file {in_path} to {out_path}:\n{to_native(stdout)}\n{to_native(stderr)}"
)
except IOError:
raise AnsibleError(f"file or module does not exist at: {in_path}")
except IOError as e:
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
def fetch_file(self, in_path, out_path):
"""fetch a file from jail to local"""
@@ -183,8 +183,8 @@ class Connection(ConnectionBase):
in_path = shlex_quote(self._prefix_login_path(in_path))
try:
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
except OSError:
raise AnsibleError("jail connection requires dd command in the jail")
except OSError as e:
raise AnsibleError("jail connection requires dd command in the jail") from e
with open(to_bytes(out_path, errors="surrogate_or_strict"), "wb+") as out_file:
try:
@@ -192,9 +192,9 @@ class Connection(ConnectionBase):
while chunk:
out_file.write(chunk)
chunk = p.stdout.read(BUFSIZE)
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
stdout, stderr = p.communicate()
if p.returncode != 0:
raise AnsibleError(

View File

@@ -173,9 +173,9 @@ class Connection(ConnectionBase):
raise errors.AnsibleFileNotFound(msg)
try:
src_file = open(in_path, "rb")
except IOError:
except IOError as e:
traceback.print_exc()
raise errors.AnsibleError(f"failed to open input file to {in_path}")
raise errors.AnsibleError(f"failed to open input file to {in_path}") from e
try:
def write_file(args):
@@ -184,10 +184,10 @@ class Connection(ConnectionBase):
try:
self.container.attach_wait(write_file, None)
except IOError:
except IOError as e:
traceback.print_exc()
msg = f"failed to transfer file to {out_path}"
raise errors.AnsibleError(msg)
raise errors.AnsibleError(msg) from e
finally:
src_file.close()
@@ -200,10 +200,10 @@ class Connection(ConnectionBase):
try:
dst_file = open(out_path, "wb")
except IOError:
except IOError as e:
traceback.print_exc()
msg = f"failed to open output file {out_path}"
raise errors.AnsibleError(msg)
raise errors.AnsibleError(msg) from e
try:
def write_file(args):
@@ -217,10 +217,10 @@ class Connection(ConnectionBase):
try:
self.container.attach_wait(write_file, None)
except IOError:
except IOError as e:
traceback.print_exc()
msg = f"failed to transfer file from {in_path} to {out_path}"
raise errors.AnsibleError(msg)
raise errors.AnsibleError(msg) from e
finally:
dst_file.close()

View File

@@ -93,8 +93,8 @@ class Connection(ConnectionBase):
try:
self._lxc_cmd = get_bin_path("lxc")
except ValueError:
raise AnsibleError("lxc command not found in PATH")
except ValueError as e:
raise AnsibleError("lxc command not found in PATH") from e
def _host(self):
"""translate remote_addr to lxd (short) hostname"""

View File

@@ -416,7 +416,7 @@ class Connection(ConnectionBase):
sock_kwarg = {}
if proxy_command:
replacers: t.Dict[str, str] = {
replacers: dict[str, str] = {
"%h": self.get_option("remote_addr"),
"%p": str(port),
"%r": self.get_option("remote_user"),
@@ -457,7 +457,7 @@ class Connection(ConnectionBase):
paramiko_preferred_pubkeys = getattr(paramiko.Transport, "_preferred_pubkeys", ())
paramiko_preferred_hostkeys = getattr(paramiko.Transport, "_preferred_keys", ())
use_rsa_sha2_algorithms = self.get_option("use_rsa_sha2_algorithms")
disabled_algorithms: t.Dict[str, t.Iterable[str]] = {}
disabled_algorithms: dict[str, t.Iterable[str]] = {}
if not use_rsa_sha2_algorithms:
if paramiko_preferred_pubkeys:
disabled_algorithms["pubkeys"] = tuple(a for a in paramiko_preferred_pubkeys if "rsa-sha2" in a)
@@ -478,11 +478,11 @@ class Connection(ConnectionBase):
except IOError:
pass # file was not found, but not required to function
except paramiko.hostkeys.InvalidHostKey as e:
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}")
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}") from e
try:
ssh.load_system_host_keys()
except paramiko.hostkeys.InvalidHostKey as e:
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}")
raise AnsibleConnectionFailure(f"Invalid host key: {to_text(e.line)}") from e
ssh_connect_kwargs = self._parse_proxy_command(port)
ssh.set_missing_host_key_policy(MyAddPolicy(self))
@@ -518,29 +518,31 @@ class Connection(ConnectionBase):
**ssh_connect_kwargs,
)
except paramiko.ssh_exception.BadHostKeyException as e:
raise AnsibleConnectionFailure(f"host key mismatch for {to_text(e.hostname)}")
raise AnsibleConnectionFailure(f"host key mismatch for {to_text(e.hostname)}") from e
except paramiko.ssh_exception.AuthenticationException as e:
msg = f"Failed to authenticate: {e}"
raise AnsibleAuthenticationFailure(msg)
raise AnsibleAuthenticationFailure(msg) from e
except Exception as e:
msg = to_text(e)
if "PID check failed" in msg:
raise AnsibleError("paramiko version issue, please upgrade paramiko on the machine running ansible")
raise AnsibleError(
"paramiko version issue, please upgrade paramiko on the machine running ansible"
) from e
elif "Private key file is encrypted" in msg:
msg = (
f"ssh {self.get_option('remote_user')}@{self.get_options('remote_addr')}:{port} : "
f"{msg}\nTo connect as a different user, use -u <username>."
)
raise AnsibleConnectionFailure(msg)
raise AnsibleConnectionFailure(msg) from e
else:
raise AnsibleConnectionFailure(msg)
raise AnsibleConnectionFailure(msg) from e
self.ssh = ssh
self._connected = True
return self
def _any_keys_added(self) -> bool:
for hostname, keys in self.ssh._host_keys.items(): # type: ignore[attr-defined] # TODO: figure out what _host_keys is!
for keytype, key in keys.items():
for host_keys in self.ssh._host_keys.values(): # type: ignore[attr-defined] # TODO: figure out what _host_keys is!
for key in host_keys.values():
added_this_time = getattr(key, "_added_by_ansible_this_time", False)
if added_this_time:
return True
@@ -585,7 +587,7 @@ class Connection(ConnectionBase):
args.extend(["--user", wsl_user])
args.extend(["--"])
args.extend(shlex.split(cmd))
if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_Waeri5tepheeSha2fae8"):
if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_WAERI5TEPHEESHA2FAE8"):
return shlex.join(args)
return list2cmdline(args) # see https://github.com/python/cpython/blob/3.11/Lib/subprocess.py#L576
@@ -609,18 +611,18 @@ class Connection(ConnectionBase):
msg = "Failed to open session"
if text_e:
msg += f": {text_e}"
raise AnsibleConnectionFailure(to_native(msg))
raise AnsibleConnectionFailure(to_native(msg)) from e
display.vvv(f"EXEC {cmd}", host=self.get_option("remote_addr"))
cmd = to_bytes(cmd, errors="surrogate_or_strict")
cmd_b = to_bytes(cmd, errors="surrogate_or_strict")
no_prompt_out = b""
no_prompt_err = b""
become_output = b""
try:
chan.exec_command(cmd)
chan.exec_command(cmd_b)
if self.become and self.become.expect_prompt():
password_prompt = False
become_success = False
@@ -665,8 +667,8 @@ class Connection(ConnectionBase):
elif in_data == b"":
chan.shutdown_write()
except socket.timeout:
raise AnsibleError(f"ssh timed out waiting for privilege escalation.\n{to_text(become_output)}")
except socket.timeout as e:
raise AnsibleError(f"ssh timed out waiting for privilege escalation.\n{to_text(become_output)}") from e
stdout = b"".join(chan.makefile("rb", bufsize))
stderr = b"".join(chan.makefile_stderr("rb", bufsize))
@@ -699,7 +701,7 @@ class Connection(ConnectionBase):
)
raise AnsibleError(f"{to_text(stdout)}\n{to_text(stderr)}")
except Exception as e:
raise AnsibleError(f"error occurred while putting file from {in_path} to {out_path}!\n{to_text(e)}")
raise AnsibleError(f"error occurred while putting file from {in_path} to {out_path}!\n{to_text(e)}") from e
def fetch_file(self, in_path: str, out_path: str) -> None:
"""save a remote file to the specified path"""
@@ -718,7 +720,7 @@ class Connection(ConnectionBase):
with open(out_path, "wb") as f:
f.write(stdout)
except Exception as e:
raise AnsibleError(f"error occurred while fetching file from {in_path} to {out_path}!\n{to_text(e)}")
raise AnsibleError(f"error occurred while fetching file from {in_path} to {out_path}!\n{to_text(e)}") from e
def reset(self) -> None:
"""reset the connection"""
@@ -772,16 +774,16 @@ class Connection(ConnectionBase):
self._save_ssh_host_keys(tmp_keyfile_name)
os.rename(tmp_keyfile_name, self.keyfile)
except LockTimeout:
except LockTimeout as e:
raise AnsibleError(
f"writing lock file for {self.keyfile} ran in to the timeout of {self.get_option('lock_file_timeout')}s"
)
) from e
except paramiko.hostkeys.InvalidHostKey as e:
raise AnsibleConnectionFailure(f"Invalid host key: {e.line}")
raise AnsibleConnectionFailure(f"Invalid host key: {e.line}") from e
except Exception as e:
# unable to save keys, including scenario when key was invalid
# and caught earlier
raise AnsibleError(f"error occurred while writing SSH host keys!\n{to_text(e)}")
raise AnsibleError(f"error occurred while writing SSH host keys!\n{to_text(e)}") from e
finally:
if tmp_keyfile_name is not None:
pathlib.Path(tmp_keyfile_name).unlink(missing_ok=True)

View File

@@ -66,8 +66,8 @@ class Connection(ConnectionBase):
def _search_executable(executable):
try:
return get_bin_path(executable)
except ValueError:
raise AnsibleError(f"{executable} command not found in PATH")
except ValueError as e:
raise AnsibleError(f"{executable} command not found in PATH") from e
def list_zones(self):
process = subprocess.Popen(
@@ -160,17 +160,17 @@ class Connection(ConnectionBase):
count = ""
try:
p = self._buffered_exec_command(f"dd of={out_path} bs={BUFSIZE}{count}", stdin=in_file)
except OSError:
raise AnsibleError("jail connection requires dd command in the jail")
except OSError as e:
raise AnsibleError("jail connection requires dd command in the jail") from e
try:
stdout, stderr = p.communicate()
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
if p.returncode != 0:
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")
except IOError:
raise AnsibleError(f"file or module does not exist at: {in_path}")
except IOError as e:
raise AnsibleError(f"file or module does not exist at: {in_path}") from e
def fetch_file(self, in_path, out_path):
"""fetch a file from zone to local"""
@@ -180,8 +180,8 @@ class Connection(ConnectionBase):
in_path = shlex_quote(self._prefix_login_path(in_path))
try:
p = self._buffered_exec_command(f"dd if={in_path} bs={BUFSIZE}")
except OSError:
raise AnsibleError("zone connection requires dd command in the zone")
except OSError as e:
raise AnsibleError("zone connection requires dd command in the zone") from e
with open(out_path, "wb+") as out_file:
try:
@@ -189,9 +189,9 @@ class Connection(ConnectionBase):
while chunk:
out_file.write(chunk)
chunk = p.stdout.read(BUFSIZE)
except Exception:
except Exception as e:
traceback.print_exc()
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}")
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}") from e
stdout, stderr = p.communicate()
if p.returncode != 0:
raise AnsibleError(f"failed to transfer file {in_path} to {out_path}:\n{stdout}\n{stderr}")

View File

@@ -12,8 +12,8 @@ options:
api_token:
description:
- Scaleway OAuth token.
- This is required if O(profile) is not specified.
type: str
required: true
aliases: [oauth_token]
api_url:
description:
@@ -27,6 +27,13 @@ options:
type: int
default: 30
aliases: [timeout]
profile:
description:
- The config profile in config file to load the Scaleway OAuth token from, use instead of O(api_token).
- It is also possible to set E(SCW_PROFILE) to use a SCW CLI config profile.
type: str
aliases: [scw_profile]
version_added: 12.2.0
query_parameters:
description:
- List of parameters passed to the query string.
@@ -37,6 +44,8 @@ options:
- Validate SSL certs of the Scaleway API.
type: bool
default: true
requirements:
- PyYAML (when O(profile) is used)
notes:
- Also see the API documentation on U(https://developer.scaleway.com/).
- If O(api_token) is not set within the module, the following environment variables can be used in decreasing order of precedence

View File

@@ -51,7 +51,7 @@ def counter(sequence):
except TypeError as e:
raise AnsibleFilterError(
f"community.general.counter needs a sequence with hashable elements (int, float or str) - {e}"
)
) from e
return result

View File

@@ -98,7 +98,7 @@ def from_csv(data, dialect="excel", fieldnames=None, delimiter=None, skipinitial
try:
dialect = initialize_dialect(dialect, **dialect_params)
except (CustomDialectFailureError, DialectNotAvailableError) as e:
raise AnsibleFilterError(str(e))
raise AnsibleFilterError(str(e)) from e
reader = read_csv(data, dialect, fieldnames)
@@ -108,7 +108,7 @@ def from_csv(data, dialect="excel", fieldnames=None, delimiter=None, skipinitial
for row in reader:
data_list.append(row)
except CSVError as e:
raise AnsibleFilterError(f"Unable to process file: {e}")
raise AnsibleFilterError(f"Unable to process file: {e}") from e
return data_list

View File

@@ -79,7 +79,7 @@ def from_ini(obj):
try:
parser.read_file(StringIO(obj))
except Exception as ex:
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex)
raise AnsibleFilterError(f"from_ini failed to parse given string: {ex}", orig_exc=ex) from ex
return parser.as_dict()

View File

@@ -9,7 +9,6 @@ from ansible.errors import (
AnsibleFilterError,
)
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.common.collections import is_sequence
try:
@@ -34,10 +33,8 @@ def initialize_hashids(**kwargs):
try:
return Hashids(**params)
except TypeError as e:
raise AnsibleFilterError(
"The provided parameters %s are invalid: %s"
% (", ".join(["%s=%s" % (k, v) for k, v in params.items()]), to_native(e))
)
str_params = ", ".join([f"{k}={v}" for k, v in params.items()])
raise AnsibleFilterError(f"The provided parameters {str_params} are invalid: {e}") from e
def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
@@ -60,7 +57,7 @@ def hashids_encode(nums, salt=None, alphabet=None, min_length=None):
try:
hashid = hashids.encode(*nums)
except TypeError as e:
raise AnsibleTypeError(f"Data to encode must by a tuple or list of ints: {e}")
raise AnsibleTypeError(f"Data to encode must by a tuple or list of ints: {e}") from e
return hashid

View File

@@ -149,7 +149,7 @@ def jc_filter(data, parser, quiet=True, raw=False):
return jc_parser.parse(data, quiet=quiet, raw=raw)
except Exception as e:
raise AnsibleFilterError(f"Error in jc filter plugin: {e}")
raise AnsibleFilterError(f"Error in jc filter plugin: {e}") from e
class FilterModule:

View File

@@ -10,7 +10,8 @@ from ansible.errors import AnsibleFilterError
if t.TYPE_CHECKING:
from typing import Any, Callable, Union
from typing import Any
from collections.abc import Callable
JSONPATCH_IMPORT_ERROR: ImportError | None
try:
@@ -60,7 +61,7 @@ class FilterModule:
def json_patch(
self,
inp: Union[str, list, dict, bytes, bytearray],
inp: str | list | dict | bytes | bytearray,
op: str,
path: str,
value: Any = None,
@@ -105,7 +106,7 @@ class FilterModule:
def json_patch_recipe(
self,
inp: Union[str, list, dict, bytes, bytearray],
inp: str | list | dict | bytes | bytearray,
operations: list,
/,
fail_test: bool = False,
@@ -141,8 +142,8 @@ class FilterModule:
def json_diff(
self,
inp: Union[str, list, dict, bytes, bytearray],
target: Union[str, list, dict, bytes, bytearray],
inp: str | list | dict | bytes | bytearray,
target: str | list | dict | bytes | bytearray,
) -> list:
if not HAS_LIB:
raise AnsibleFilterError(

View File

@@ -141,10 +141,10 @@ def json_query(data, expr):
try:
return jmespath.search(expr, data)
except jmespath.exceptions.JMESPathError as e:
raise AnsibleFilterError(f"JMESPathError in json_query filter plugin:\n{e}")
raise AnsibleFilterError(f"JMESPathError in json_query filter plugin:\n{e}") from e
except Exception as e:
# For older jmespath, we can get ValueError and TypeError without much info.
raise AnsibleFilterError(f"Error in jmespath.search in json_query filter plugin:\n{e}")
raise AnsibleFilterError(f"Error in jmespath.search in json_query filter plugin:\n{e}") from e
class FilterModule:

View File

@@ -56,10 +56,8 @@ def to_time_unit(human_time, unit="ms", **kwargs):
unit = unit_to_short_form.get(unit.rstrip("s"), unit)
if unit not in unit_factors:
raise AnsibleFilterError(
(
f"to_time_unit() can not convert to the following unit: {unit}. Available units (singular or plural):"
f"{', '.join(unit_to_short_form.keys())}. Available short units: {', '.join(unit_factors.keys())}"
)
f"to_time_unit() can not convert to the following unit: {unit}. Available units (singular or plural):"
f"{', '.join(unit_to_short_form.keys())}. Available short units: {', '.join(unit_factors.keys())}"
)
if "year" in kwargs:

View File

@@ -72,7 +72,7 @@ def to_ini(obj):
try:
ini_parser.read_dict(obj)
except Exception as ex:
raise AnsibleFilterError(f"to_ini failed to parse given dict:{ex}", orig_exc=ex)
raise AnsibleFilterError(f"to_ini failed to parse given dict:{ex}", orig_exc=ex) from ex
# catching empty dicts
if obj == dict():

View File

@@ -229,7 +229,6 @@ def _configure_alignments(table, field_names, column_alignments):
field_names: List of field names to align
column_alignments: Dict of column alignments
"""
valid_alignments = {"left", "center", "right", "l", "c", "r"}
if not isinstance(column_alignments, dict):
return

View File

@@ -373,7 +373,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
ip_address_first = None
ipv6_address = None
ipv6_address_first = None
for iname, ivalue in interfaces.items():
for ivalue in interfaces.values():
# Set to first interface or management interface if defined or hostname matches dns_name
if ivalue["ip_address"] != "":
if ip_address_first is None:

View File

@@ -124,7 +124,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option("keyed_groups"), host_attrs, host, strict=strict)
except Exception as e:
raise AnsibleParserError(f"Unable to fetch hosts from GitLab API, this was the original exception: {e}")
raise AnsibleParserError(
f"Unable to fetch hosts from GitLab API, this was the original exception: {e}"
) from e
def verify_file(self, path):
"""Return the possibly of a file being consumable by this plugin."""

View File

@@ -166,8 +166,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
except Exception:
error_body = {"status": None}
if e.code == 404 and error_body.get("status") == "No objects found.":
raise AnsibleParserError("Host filter returned no data. Please confirm your host_filter value is valid")
raise AnsibleParserError(f"Unexpected data returned: {e} -- {error_body}")
raise AnsibleParserError(
"Host filter returned no data. Please confirm your host_filter value is valid"
) from e
raise AnsibleParserError(f"Unexpected data returned: {e} -- {error_body}") from e
response_body = response.read()
json_data = json.loads(response_body.decode("utf-8"))

View File

@@ -292,7 +292,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
self.get_jails(t_stdout, results)
if get_properties:
for hostname, host_vars in results["_meta"]["hostvars"].items():
for hostname in results["_meta"]["hostvars"]:
cmd_get_properties = cmd.copy()
cmd_get_properties.append(self.IOCAGE)
cmd_get_properties.append("get")
@@ -335,7 +335,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
except Exception as e:
raise AnsibleError(f"Failed to get pool: {e}") from e
for hostname, host_vars in results["_meta"]["hostvars"].items():
for hostname in results["_meta"]["hostvars"]:
iocage_hooks = []
for hook in hooks_results:
path = f"/{iocage_pool}/iocage/jails/{hostname}/root{hook}"

View File

@@ -151,7 +151,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
access_token = self.templar.template(variable=access_token)
if access_token is None:
raise AnsibleError(("Could not retrieve Linode access token from plugin configuration sources"))
raise AnsibleError("Could not retrieve Linode access token from plugin configuration sources")
self.client = LinodeClient(access_token)
@@ -160,7 +160,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
self.instances = self.client.linode.instances()
except LinodeApiError as exception:
raise AnsibleError(f"Linode client raised: {exception}")
raise AnsibleError(f"Linode client raised: {exception}") from exception
def _add_groups(self):
"""Add Linode instance groups to the dynamic inventory."""

View File

@@ -213,7 +213,7 @@ class InventoryModule(BaseInventoryPlugin):
with open(path, "r") as json_file:
return json.load(json_file)
except (IOError, json.decoder.JSONDecodeError) as err:
raise AnsibleParserError(f"Could not load the test data from {to_native(path)}: {err}")
raise AnsibleParserError(f"Could not load the test data from {to_native(path)}: {err}") from err
def save_json_data(self, path, file_name=None):
"""save data as json
@@ -243,7 +243,7 @@ class InventoryModule(BaseInventoryPlugin):
with open(os.path.abspath(os.path.join(cwd, *path)), "w") as json_file:
json.dump(self.data, json_file)
except IOError as err:
raise AnsibleParserError(f"Could not save data: {err}")
raise AnsibleParserError(f"Could not save data: {err}") from err
def verify_file(self, path):
"""Check the config
@@ -602,7 +602,7 @@ class InventoryModule(BaseInventoryPlugin):
else:
path[instance_name][key] = value
except KeyError as err:
raise AnsibleParserError(f"Unable to store Information: {err}")
raise AnsibleParserError(f"Unable to store Information: {err}") from err
def extract_information_from_instance_configs(self):
"""Process configuration information
@@ -853,7 +853,7 @@ class InventoryModule(BaseInventoryPlugin):
except ValueError as err:
raise AnsibleParserError(
f"Error while parsing network range {self.groupby[group_name].get('attribute')}: {err}"
)
) from err
for instance_name in self.inventory.hosts:
if self.data["inventory"][instance_name].get("network_interfaces") is not None:
@@ -1203,6 +1203,6 @@ class InventoryModule(BaseInventoryPlugin):
self.trust_password = self.get_option("trust_password")
self.url = self.get_option("url")
except Exception as err:
raise AnsibleParserError(f"All correct options required: {err}")
raise AnsibleParserError(f"All correct options required: {err}") from err
# Call our internal helper to populate the dynamic inventory
self._populate()

View File

@@ -180,7 +180,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
self._nmap = get_bin_path("nmap")
except ValueError as e:
raise AnsibleParserError(f"nmap inventory plugin requires the nmap cli tool to work: {e}")
raise AnsibleParserError(f"nmap inventory plugin requires the nmap cli tool to work: {e}") from e
super().parse(inventory, loader, path, cache=cache)
@@ -265,7 +265,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
t_stdout = to_text(stdout, errors="surrogate_or_strict")
except UnicodeError as e:
raise AnsibleParserError(f"Invalid (non unicode) input returned: {e}")
raise AnsibleParserError(f"Invalid (non unicode) input returned: {e}") from e
for line in t_stdout.splitlines():
hits = self.find_host.match(line)
@@ -310,7 +310,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
results[-1]["ports"] = ports
except Exception as e:
raise AnsibleParserError(f"failed to parse {to_native(path)}: {e} ")
raise AnsibleParserError(f"failed to parse {to_native(path)}: {e} ") from e
if cache_needs_update:
self._cache[cache_key] = results

View File

@@ -135,19 +135,19 @@ class InventoryModule(BaseInventoryPlugin):
def _fetch_information(self, url):
try:
response = open_url(url, headers=self.headers)
except Exception as e:
except Exception:
self.display.warning(f"An error happened while fetching: {url}")
return None
try:
raw_data = to_text(response.read(), errors="surrogate_or_strict")
except UnicodeError:
raise AnsibleError("Incorrect encoding of fetched payload from Online servers")
except UnicodeError as e:
raise AnsibleError("Incorrect encoding of fetched payload from Online servers") from e
try:
return json.loads(raw_data)
except ValueError:
raise AnsibleError("Incorrect JSON payload")
except ValueError as e:
raise AnsibleError("Incorrect JSON payload") from e
@staticmethod
def extract_rpn_lookup_cache(rpn_list):

View File

@@ -122,10 +122,10 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
with open(authfile, "r") as fp:
authstring = fp.read().rstrip()
username, password = authstring.split(":")
except (OSError, IOError):
raise AnsibleError(f"Could not find or read ONE_AUTH file at '{authfile}'")
except Exception:
raise AnsibleError(f"Error occurs when reading ONE_AUTH file at '{authfile}'")
except (OSError, IOError) as e:
raise AnsibleError(f"Could not find or read ONE_AUTH file at '{authfile}'") from e
except Exception as e:
raise AnsibleError(f"Error occurs when reading ONE_AUTH file at '{authfile}'") from e
auth_params = namedtuple("auth", ("url", "username", "password"))
@@ -167,7 +167,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
try:
vm_pool = one_client.vmpool.infoextended(-2, -1, -1, 3)
except Exception as e:
raise AnsibleError(f"Something happened during XML-RPC call: {e}")
raise AnsibleError(f"Something happened during XML-RPC call: {e}") from e
return vm_pool

View File

@@ -45,6 +45,9 @@ options:
not defined.
type: string
version_added: 4.4.0
env:
- name: SCW_PROFILE
version_added: 12.2.0
oauth_token:
description:
- Scaleway OAuth token.
@@ -143,16 +146,16 @@ def _fetch_information(token, url):
try:
response = open_url(paginated_url, headers={"X-Auth-Token": token, "Content-type": "application/json"})
except Exception as e:
raise AnsibleError(f"Error while fetching {url}: {e}")
raise AnsibleError(f"Error while fetching {url}: {e}") from e
try:
raw_json = json.loads(to_text(response.read()))
except ValueError:
raise AnsibleError("Incorrect JSON payload")
except ValueError as e:
raise AnsibleError("Incorrect JSON payload") from e
try:
results.extend(raw_json["servers"])
except KeyError:
raise AnsibleError("Incorrect format from the Scaleway API response")
except KeyError as e:
raise AnsibleError("Incorrect format from the Scaleway API response") from e
link = response.headers["Link"]
if not link:

View File

@@ -312,7 +312,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
self._vbox_path = get_bin_path(self.VBOX)
except ValueError as e:
raise AnsibleParserError(e)
raise AnsibleParserError(e) from e
super().parse(inventory, loader, path)
@@ -354,7 +354,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
try:
p = Popen(cmd, stdout=PIPE)
except Exception as e:
raise AnsibleParserError(str(e))
raise AnsibleParserError(str(e)) from e
source_data = p.stdout.read().splitlines()

View File

@@ -112,7 +112,7 @@ try:
if LooseVersion(websocket.__version__) <= LooseVersion("1.0.0"):
raise ImportError
except ImportError as e:
except ImportError:
HAS_WEBSOCKET = False

View File

@@ -107,6 +107,6 @@ class LookupModule(LookupBase):
with open(path, "rb") as f:
result.append(base64.b64encode(f.read()).decode("utf-8"))
except Exception as exc:
raise AnsibleLookupError(f"Error while reading {path}: {exc}")
raise AnsibleLookupError(f"Error while reading {path}: {exc}") from exc
return result

View File

@@ -49,7 +49,7 @@ try:
import chef
HAS_CHEF = True
except ImportError as missing_module:
except ImportError:
HAS_CHEF = False
@@ -77,8 +77,8 @@ class LookupModule(LookupBase):
continue
parsed = str(arg_raw)
setattr(self, arg, parsed)
except ValueError:
raise AnsibleError(f"can't parse arg {arg}={arg_raw} as string")
except ValueError as e:
raise AnsibleError(f"can't parse arg {arg}={arg_raw} as string") from e
if args:
raise AnsibleError(f"unrecognized arguments to with_sequence: {list(args.keys())!r}")

View File

@@ -122,7 +122,7 @@ class LookupModule(LookupBase):
try:
data = load_collection_meta(collection_pkg, no_version=no_version)
except Exception as exc:
raise AnsibleLookupError(f"Error while loading metadata for {term}: {exc}")
raise AnsibleLookupError(f"Error while loading metadata for {term}: {exc}") from exc
result.append(data.get("version", no_version))

View File

@@ -120,7 +120,7 @@ try:
import consul
HAS_CONSUL = True
except ImportError as e:
except ImportError:
HAS_CONSUL = False
@@ -170,7 +170,7 @@ class LookupModule(LookupBase):
else:
values.append(to_text(results[1]["Value"]))
except Exception as e:
raise AnsibleError(f"Error locating '{term}' in kv store. Error was {e}")
raise AnsibleError(f"Error locating '{term}' in kv store. Error was {e}") from e
return values
@@ -194,6 +194,6 @@ class LookupModule(LookupBase):
raise AnsibleAssertionError(f"{name} not a valid consul lookup parameter")
paramvals[name] = value
except (ValueError, AssertionError) as e:
raise AnsibleError(e)
raise AnsibleError(e) from e
return paramvals

View File

@@ -145,9 +145,9 @@ class LookupModule(LookupBase):
for term in terms:
try:
ret.append(credstash.getSecret(term, version, region, table, context=context, **kwargs_pass))
except credstash.ItemNotFound:
raise AnsibleError(f"Key {term} not found")
except credstash.ItemNotFound as e:
raise AnsibleError(f"Key {term} not found") from e
except Exception as e:
raise AnsibleError(f"Encountered exception while fetching {term}: {e}")
raise AnsibleError(f"Encountered exception while fetching {term}: {e}") from e
return ret

View File

@@ -164,11 +164,11 @@ class CyberarkPassword:
result_dict[output_names[i]] = to_native(output_values[i])
except subprocess.CalledProcessError as e:
raise AnsibleError(e.output)
raise AnsibleError(e.output) from e
except OSError as e:
raise AnsibleError(
f"ERROR - AIM not installed or clipasswordsdk not in standard location. ERROR=({e.errno}) => {e.strerror} "
)
) from e
return [result_dict]

View File

@@ -145,7 +145,9 @@ class LookupModule(LookupBase):
``variables`` are the variables to use.
"""
templar.available_variables = variables or {}
quoted_expression = "{0}{1}{2}".format("{{", expression, "}}")
open_br = "{{"
close_br = "}}"
quoted_expression = f"{open_br}{expression}{close_br}"
if hasattr(templar, "evaluate_expression"):
# This is available since the Data Tagging PR has been merged
return templar.evaluate_expression(_make_safe(expression))
@@ -174,7 +176,7 @@ class LookupModule(LookupBase):
try:
values = self.__evaluate(expression, templar, variables=vars)
except Exception as e:
raise AnsibleLookupError(f'Caught "{e}" while evaluating {key!r} with item == {current!r}')
raise AnsibleLookupError(f'Caught "{e}" while evaluating {key!r} with item == {current!r}') from e
if isinstance(values, Mapping):
for idx, val in sorted(values.items()):

View File

@@ -387,7 +387,7 @@ class LookupModule(LookupBase):
try:
rdclass = dns.rdataclass.from_text(self.get_option("class"))
except Exception as e:
raise AnsibleError(f"dns lookup illegal CLASS: {e}")
raise AnsibleError(f"dns lookup illegal CLASS: {e}") from e
myres.retry_servfail = self.get_option("retry_servfail")
for t in terms:
@@ -405,7 +405,7 @@ class LookupModule(LookupBase):
nsaddr = dns.resolver.query(ns)[0].address
nameservers.append(nsaddr)
except Exception as e:
raise AnsibleError(f"dns lookup NS: {e}")
raise AnsibleError(f"dns lookup NS: {e}") from e
continue
if "=" in t:
try:
@@ -421,7 +421,7 @@ class LookupModule(LookupBase):
try:
rdclass = dns.rdataclass.from_text(arg)
except Exception as e:
raise AnsibleError(f"dns lookup illegal CLASS: {e}")
raise AnsibleError(f"dns lookup illegal CLASS: {e}") from e
elif opt == "retry_servfail":
myres.retry_servfail = boolean(arg)
elif opt == "fail_on_error":
@@ -458,7 +458,7 @@ class LookupModule(LookupBase):
except dns.exception.SyntaxError:
pass
except Exception as e:
raise AnsibleError(f"dns.reversename unhandled exception {e}")
raise AnsibleError(f"dns.reversename unhandled exception {e}") from e
domains = reversed_domains
if len(domains) > 1:
@@ -487,20 +487,20 @@ class LookupModule(LookupBase):
ret.append(rd)
except Exception as err:
if fail_on_error:
raise AnsibleError(f"Lookup failed: {err}")
raise AnsibleError(f"Lookup failed: {err}") from err
ret.append(str(err))
except dns.resolver.NXDOMAIN as err:
if fail_on_error:
raise AnsibleError(f"Lookup failed: {err}")
raise AnsibleError(f"Lookup failed: {err}") from err
if not real_empty:
ret.append("NXDOMAIN")
except (dns.resolver.NoAnswer, dns.resolver.Timeout, dns.resolver.NoNameservers) as err:
if fail_on_error:
raise AnsibleError(f"Lookup failed: {err}")
raise AnsibleError(f"Lookup failed: {err}") from err
if not real_empty:
ret.append("")
except dns.exception.DNSException as err:
raise AnsibleError(f"dns.resolver unhandled exception {err}")
raise AnsibleError(f"dns.resolver unhandled exception {err}") from err
return ret

View File

@@ -105,7 +105,7 @@ class LookupModule(LookupBase):
continue
string = ""
except DNSException as e:
raise AnsibleError(f"dns.resolver unhandled exception {e}")
raise AnsibleError(f"dns.resolver unhandled exception {e}") from e
ret.append("".join(string))

View File

@@ -109,8 +109,8 @@ class LookupModule(LookupBase):
try:
vault = SecretsVault(**vault_parameters)
return vault
except TypeError:
raise AnsibleError("python-dsv-sdk==0.0.1 must be installed to use this plugin")
except TypeError as e:
raise AnsibleError("python-dsv-sdk==0.0.1 must be installed to use this plugin") from e
def run(self, terms, variables, **kwargs):
if sdk_is_missing:
@@ -140,5 +140,5 @@ class LookupModule(LookupBase):
display.vvv(f"DevOps Secrets Vault GET /secrets/{path}")
result.append(vault.get_secret_json(path))
except SecretsVaultError as error:
raise AnsibleError(f"DevOps Secrets Vault lookup failure: {error.message}")
raise AnsibleError(f"DevOps Secrets Vault lookup failure: {error.message}") from error
return result

View File

@@ -167,7 +167,7 @@ def etcd3_client(client_params):
etcd = etcd3.client(**client_params)
etcd.status()
except Exception as exp:
raise AnsibleLookupError(f"Cannot connect to etcd cluster: {exp}")
raise AnsibleLookupError(f"Cannot connect to etcd cluster: {exp}") from exp
return etcd

View File

@@ -116,7 +116,7 @@ class PythonJWT:
with open(path, "rb") as pem_file:
return jwk_from_pem(pem_file.read())
except Exception as e:
raise AnsibleError(f"Error while parsing key file: {e}")
raise AnsibleError(f"Error while parsing key file: {e}") from e
@staticmethod
def encode_jwt(app_id, jwk, exp=600):
@@ -129,7 +129,7 @@ class PythonJWT:
try:
return jwt_instance.encode(payload, jwk, alg="RS256")
except Exception as e:
raise AnsibleError(f"Error while encoding jwt: {e}")
raise AnsibleError(f"Error while encoding jwt: {e}") from e
def read_key(path, private_key=None):
@@ -143,7 +143,7 @@ def read_key(path, private_key=None):
key_bytes = pem_file.read()
return serialization.load_pem_private_key(key_bytes, password=None)
except Exception as e:
raise AnsibleError(f"Error while parsing key file: {e}")
raise AnsibleError(f"Error while parsing key file: {e}") from e
def encode_jwt(app_id, private_key_obj, exp=600):
@@ -158,7 +158,7 @@ def encode_jwt(app_id, private_key_obj, exp=600):
try:
return jwt.encode(payload, private_key_obj, algorithm="RS256")
except Exception as e:
raise AnsibleError(f"Error while encoding jwt: {e}")
raise AnsibleError(f"Error while encoding jwt: {e}") from e
def post_request(generated_jwt, installation_id, api_base):
@@ -178,15 +178,15 @@ def post_request(generated_jwt, installation_id, api_base):
except Exception:
error_body = {}
if e.code == 404:
raise AnsibleError("Github return error. Please confirm your installation_id value is valid")
raise AnsibleError("Github return error. Please confirm your installation_id value is valid") from e
elif e.code == 401:
raise AnsibleError("Github return error. Please confirm your private key is valid")
raise AnsibleError(f"Unexpected data returned: {e} -- {error_body}")
raise AnsibleError("Github return error. Please confirm your private key is valid") from e
raise AnsibleError(f"Unexpected data returned: {e} -- {error_body}") from e
response_body = response.read()
try:
json_data = json.loads(response_body.decode("utf-8"))
except json.decoder.JSONDecodeError as e:
raise AnsibleError(f"Error while dencoding JSON respone from github: {e}")
raise AnsibleError(f"Error while dencoding JSON respone from github: {e}") from e
return json_data.get("token")

View File

@@ -93,7 +93,7 @@ class LookupModule(LookupBase):
try:
env = lmdb.open(str(db), readonly=True)
except Exception as e:
raise AnsibleError(f"LMDB cannot open database {db}: {e}")
raise AnsibleError(f"LMDB cannot open database {db}: {e}") from e
ret = []
if len(terms) == 0:

View File

@@ -129,7 +129,7 @@ def _verify_and_get_type(variable):
elif isinstance(variable, dict):
return "dict"
else:
raise AnsibleError("Not supported type detected, variable must be a list or a dict")
raise AnsibleError(f"Not supported type detected, variable must be a list or a dict: '{variable}'")
class LookupModule(LookupBase):
@@ -163,10 +163,7 @@ class LookupModule(LookupBase):
return True
group_intersection = [host_group_name for host_group_name in host_groups if host_group_name in self._groups]
if group_intersection:
return True
return False
return bool(group_intersection)
def _var_matches(self, key, search_pattern):
if self._pattern_type == "prefix":

View File

@@ -198,13 +198,13 @@ class OnePassCLIBase(metaclass=abc.ABCMeta):
based on the current version."""
try:
bin_path = get_bin_path(cls.bin)
except ValueError:
raise AnsibleLookupError(f"Unable to locate '{cls.bin}' command line tool")
except ValueError as e:
raise AnsibleLookupError(f"Unable to locate '{cls.bin}' command line tool") from e
try:
b_out = subprocess.check_output([bin_path, "--version"], stderr=subprocess.PIPE)
except subprocess.CalledProcessError as cpe:
raise AnsibleLookupError(f"Unable to get the op version: {cpe}")
raise AnsibleLookupError(f"Unable to get the op version: {cpe}") from cpe
return to_text(b_out).strip()
@@ -653,7 +653,7 @@ class OnePass:
self.connect_token,
)
except TypeError as e:
raise AnsibleLookupError(e)
raise AnsibleLookupError(e) from e
raise AnsibleLookupError(f"op version {version} is unsupported")

View File

@@ -309,7 +309,7 @@ class LookupModule(LookupBase):
)
self.realpass = "pass: the standard unix password manager" in passoutput
except subprocess.CalledProcessError as e:
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
return self.realpass
@@ -329,14 +329,14 @@ class LookupModule(LookupBase):
raise AnsibleAssertionError(f"{name} not in paramvals")
self.paramvals[name] = value
except (ValueError, AssertionError) as e:
raise AnsibleError(e)
raise AnsibleError(e) from e
# check and convert values
try:
for key in ["create", "returnall", "overwrite", "backup", "nosymbols"]:
if not isinstance(self.paramvals[key], bool):
self.paramvals[key] = boolean(self.paramvals[key])
except (ValueError, AssertionError) as e:
raise AnsibleError(e)
raise AnsibleError(e) from e
if self.paramvals["missing"] not in ["error", "warn", "create", "empty"]:
raise AnsibleError(f"{self.paramvals['missing']} is not a valid option for missing")
if not isinstance(self.paramvals["length"], int):
@@ -395,7 +395,7 @@ class LookupModule(LookupBase):
except subprocess.CalledProcessError as e:
# 'not in password store' is the expected error if a password wasn't found
if "not in the password store" not in e.output:
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
if self.paramvals["missing"] == "error":
raise AnsibleError(f"passwordstore: passname {self.passname} not found and missing=error is set")
@@ -459,7 +459,7 @@ class LookupModule(LookupBase):
try:
check_output2([self.pass_cmd, "insert", "-f", "-m", self.passname], input=msg, env=self.env)
except subprocess.CalledProcessError as e:
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
return newpass
def generate_password(self):
@@ -480,7 +480,7 @@ class LookupModule(LookupBase):
try:
check_output2([self.pass_cmd, "insert", "-f", "-m", self.passname], input=msg, env=self.env)
except subprocess.CalledProcessError as e:
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}")
raise AnsibleError(f"exit code {e.returncode} while running {e.cmd}. Error output: {e.output}") from e
return newpass

View File

@@ -112,5 +112,5 @@ class LookupModule(LookupBase):
ret.append(to_text(res))
except Exception as e:
# connection failed or key not found
raise AnsibleError(f"Encountered exception while fetching {term}: {e}")
raise AnsibleError(f"Encountered exception while fetching {term}: {e}") from e
return ret

View File

@@ -98,5 +98,5 @@ class LookupModule(LookupBase):
display.vvv(f"Secret Server lookup of Secret with ID {term}")
result.append({term: secret_server.get_pam_secret(term)})
except Exception as error:
raise AnsibleError(f"Secret Server lookup failure: {error.message}")
raise AnsibleError(f"Secret Server lookup failure: {error.message}") from error
return result

View File

@@ -74,7 +74,7 @@ class LookupModule(LookupBase):
except (ValueError, AssertionError) as e:
# In case "file" or "key" are not present
raise AnsibleError(e)
raise AnsibleError(e) from e
key = paramvals["key"]

View File

@@ -7,7 +7,7 @@ from __future__ import annotations
DOCUMENTATION = r"""
name: tss
author: Adam Migus (@amigus) <adam@migus.org>
short_description: Get secrets from Thycotic Secret Server
short_description: Get secrets from Delinea Secret Server
version_added: 1.0.0
description:
- Uses the Thycotic Secret Server Python SDK to get Secrets from Secret Server using token authentication with O(username)
@@ -119,14 +119,16 @@ options:
RETURN = r"""
_list:
description:
- The JSON responses to C(GET /secrets/{id}).
- The JSON responses to C(GET /secrets/{id}) and C(GET /secrets/{path}).
- See U(https://updates.thycotic.net/secretserver/restapiguide/TokenAuth/#operation--secrets--id--get).
type: list
elements: dict
"""
EXAMPLES = r"""
- hosts: localhost
# Using Secret Server Authentication
- name: Lookup secret using Secret Server user credentials
hosts: localhost
vars:
secret: >-
{{
@@ -147,7 +149,8 @@ EXAMPLES = r"""
value_name='itemValue'))['password']
}}
- hosts: localhost
- name: Lookup secret with domain user
hosts: localhost
vars:
secret: >-
{{
@@ -169,7 +172,8 @@ EXAMPLES = r"""
value_name='itemValue'))['password']
}}
- hosts: localhost
- name: Lookup secret using Secret Server token
hosts: localhost
vars:
secret_password: >-
{{
@@ -187,7 +191,8 @@ EXAMPLES = r"""
# Private key stores into certificate file which is attached with secret.
# If fetch_attachments=True then private key file will be download on specified path
# and file content will display in debug message.
- hosts: localhost
- name: Lookup secret and fetch attachments using Secret Server token
hosts: localhost
vars:
secret: >-
{{
@@ -210,7 +215,8 @@ EXAMPLES = r"""
}}
# If fetch_secret_ids_from_folder=true then secret IDs are in a folder is fetched based on folder ID
- hosts: localhost
- name: Lookup secret IDs by folder ID using Secret Server token
hosts: localhost
vars:
secret: >-
{{
@@ -230,7 +236,8 @@ EXAMPLES = r"""
}}
# If secret ID is 0 and secret_path has value then secret is fetched by secret path
- hosts: localhost
- name: Lookup secret by secret path using Secret Server user credentials
hosts: localhost
vars:
secret: >-
{{
@@ -251,6 +258,45 @@ EXAMPLES = r"""
| items2dict(key_name='slug',
value_name='itemValue'))['password']
}}
# Using Platform Authentication
- name: Lookup secret using Platform service user credentials
hosts: localhost
vars:
secret: >-
{{
lookup(
'community.general.tss',
102,
base_url='https://platform.delinea.app/',
username='platform_service_username',
password='platform_service_user_password'
)
}}
tasks:
- ansible.builtin.debug:
msg: >
the password is {{
(secret['items']
| items2dict(key_name='slug',
value_name='itemValue'))['password']
}}
- name: Lookup secret using platform token
hosts: localhost
vars:
secret_password: >-
{{
((lookup(
'community.general.tss',
102,
base_url='https://platform.delinea.app/',
token='delinea_platform_access_token',
) | from_json).get('items') | items2dict(key_name='slug', value_name='itemValue'))['password']
}}
tasks:
- ansible.builtin.debug:
msg: the password is {{ secret_password }}
"""
import abc
@@ -331,8 +377,8 @@ class TSSClient(metaclass=abc.ABCMeta): # noqa: B024
file_content = i["itemValue"].content
with open(os.path.join(file_download_path, f"{obj['id']}_{i['slug']}"), "wb") as f:
f.write(file_content)
except ValueError:
raise AnsibleOptionsError(f"Failed to download {i['slug']}")
except ValueError as e:
raise AnsibleOptionsError(f"Failed to download {i['slug']}") from e
except AttributeError:
display.warning(f"Could not read file content for {i['slug']}")
finally:
@@ -357,15 +403,15 @@ class TSSClient(metaclass=abc.ABCMeta): # noqa: B024
def _term_to_secret_id(term):
try:
return int(term)
except ValueError:
raise AnsibleOptionsError("Secret ID must be an integer")
except ValueError as e:
raise AnsibleOptionsError("Secret ID must be an integer") from e
@staticmethod
def _term_to_folder_id(term):
try:
return int(term)
except ValueError:
raise AnsibleOptionsError("Folder ID must be an integer")
except ValueError as e:
raise AnsibleOptionsError("Folder ID must be an integer") from e
class TSSClientV0(TSSClient):
@@ -394,9 +440,7 @@ class TSSClientV1(TSSClient):
@staticmethod
def _get_authorizer(**server_parameters):
if server_parameters.get("token"):
return AccessTokenAuthorizer(
server_parameters["token"],
)
return AccessTokenAuthorizer(server_parameters["token"], server_parameters["base_url"])
if server_parameters.get("domain"):
return DomainPasswordGrantAuthorizer(
@@ -449,4 +493,4 @@ class LookupModule(LookupBase):
for term in terms
]
except SecretServerError as error:
raise AnsibleError(f"Secret Server lookup failure: {error.message}")
raise AnsibleError(f"Secret Server lookup failure: {error.message}") from error

View File

@@ -11,10 +11,13 @@ import os
import stat
import time
import fcntl
import sys
import typing as t
from contextlib import contextmanager
if t.TYPE_CHECKING:
from io import TextIOWrapper
class LockTimeout(Exception):
pass
@@ -28,11 +31,13 @@ class FileLock:
unwanted and/or unexpected behaviour
"""
def __init__(self):
self.lockfd = None
def __init__(self) -> None:
self.lockfd: TextIOWrapper | None = None
@contextmanager
def lock_file(self, path, tmpdir, lock_timeout=None):
def lock_file(
self, path: os.PathLike, tmpdir: os.PathLike, lock_timeout: int | float | None = None
) -> t.Generator[None]:
"""
Context for lock acquisition
"""
@@ -42,7 +47,9 @@ class FileLock:
finally:
self.unlock()
def set_lock(self, path, tmpdir, lock_timeout=None):
def set_lock(
self, path: os.PathLike, tmpdir: os.PathLike, lock_timeout: int | float | None = None
) -> t.Literal[True]:
"""
Create a lock file based on path with flock to prevent other processes
using given path.
@@ -59,25 +66,22 @@ class FileLock:
"""
lock_path = os.path.join(tmpdir, f"ansible-{os.path.basename(path)}.lock")
l_wait = 0.1
r_exception = IOError
if sys.version_info[0] == 3:
r_exception = BlockingIOError
self.lockfd = open(lock_path, "w")
if lock_timeout <= 0:
if lock_timeout is not None and lock_timeout <= 0:
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
os.chmod(lock_path, stat.S_IWRITE | stat.S_IREAD)
return True
if lock_timeout:
e_secs = 0
e_secs: float = 0
while e_secs < lock_timeout:
try:
fcntl.flock(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
os.chmod(lock_path, stat.S_IWRITE | stat.S_IREAD)
return True
except r_exception:
except BlockingIOError:
time.sleep(l_wait)
e_secs += l_wait
continue
@@ -90,7 +94,7 @@ class FileLock:
return True
def unlock(self):
def unlock(self) -> t.Literal[True]:
"""
Make sure lock file is available for everyone and Unlock the file descriptor
locked by set_lock

View File

@@ -0,0 +1,61 @@
# Copyright (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
# Copyright (c) 2025, Alexei Znamensky <russoz@gmail.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
import os
import subprocess
import tempfile
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_bytes
# This is used to attach to a running container and execute commands from
# within the container on the host. This will provide local access to a
# container without using SSH. The template will attempt to work within the
# home directory of the user that was attached to the container and source
# that users environment variables by default.
ATTACH_TEMPLATE = """#!/usr/bin/env bash
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
if [[ -f ".bashrc" ]];then
source .bashrc
unset HOSTNAME
fi
popd
# User defined command
{}
"""
def create_script(command: str, module: AnsibleModule) -> None:
"""Write out a script onto a target.
This method should be backward compatible with Python when executing
from within the container.
:param command: command to run, this can be a script and can use spacing
with newlines as separation.
:param module: AnsibleModule to run commands with.
"""
script_file = ""
try:
f = tempfile.NamedTemporaryFile(prefix="lxc-attach-script", delete=False, mode="wb")
f.write(to_bytes(ATTACH_TEMPLATE.format(command), errors="surrogate_or_strict"))
script_file = f.name
f.flush()
f.close()
os.chmod(script_file, 0o0700)
with tempfile.NamedTemporaryFile(prefix="lxc-attach-script-log", delete=False, mode="ab") as stdout_file:
with tempfile.NamedTemporaryFile(prefix="lxc-attach-script-err", delete=False, mode="ab") as stderr_file:
subprocess.Popen([script_file], stdout=stdout_file, stderr=stderr_file).communicate()
finally:
if script_file:
os.remove(script_file)

View File

@@ -1,52 +0,0 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is based on
# Lib/posixpath.py of cpython
#
# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved.
# It is licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
# (See LICENSES/PSF-2.0.txt in this collection)
# SPDX-License-Identifier: PSF-2.0
from __future__ import annotations
import os
def ismount(path):
"""Test whether a path is a mount point
This is a copy of the upstream version of ismount(). Originally this was copied here as a workaround
until Python issue 2466 was fixed. Now it is here so this will work on older versions of Python
that may not have the upstream fix.
https://github.com/ansible/ansible-modules-core/issues/2186
http://bugs.python.org/issue2466
"""
try:
s1 = os.lstat(path)
except (OSError, ValueError):
# It doesn't exist -- so not a mount point. :-)
return False
else:
# A symlink can never be a mount point
if os.path.stat.S_ISLNK(s1.st_mode):
return False
if isinstance(path, bytes):
parent = os.path.join(path, b"..")
else:
parent = os.path.join(path, "..")
parent = os.path.realpath(parent)
try:
s2 = os.lstat(parent)
except (OSError, ValueError):
return False
dev1 = s1.st_dev
dev2 = s2.st_dev
if dev1 != dev2:
return True # path/.. on a different device as path
ino1 = s1.st_ino
ino2 = s2.st_ino
if ino1 == ino2:
return True # path/.. is the same i-node as path
return False

View File

@@ -184,7 +184,7 @@ class ConfigParser:
continue
searchable_information = host_entry.get("host")
for key, value in host_entry.get("options").items():
for value in host_entry.get("options").values():
if isinstance(value, list):
value = " ".join(value)
if isinstance(value, int):

View File

@@ -14,8 +14,13 @@ from __future__ import annotations
import os
import json
import traceback
import typing as t
from ansible.module_utils.basic import env_fallback
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule
try:
import footmark
import footmark.ecs
@@ -200,7 +205,7 @@ def get_profile(params):
return params
def ecs_connect(module):
def ecs_connect(module: AnsibleModule):
"""Return an ecs connection"""
ecs_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -214,7 +219,7 @@ def ecs_connect(module):
return ecs
def slb_connect(module):
def slb_connect(module: AnsibleModule):
"""Return an slb connection"""
slb_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -228,7 +233,7 @@ def slb_connect(module):
return slb
def dns_connect(module):
def dns_connect(module: AnsibleModule):
"""Return an dns connection"""
dns_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -242,7 +247,7 @@ def dns_connect(module):
return dns
def vpc_connect(module):
def vpc_connect(module: AnsibleModule):
"""Return an vpc connection"""
vpc_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -256,7 +261,7 @@ def vpc_connect(module):
return vpc
def rds_connect(module):
def rds_connect(module: AnsibleModule):
"""Return an rds connection"""
rds_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -270,7 +275,7 @@ def rds_connect(module):
return rds
def ess_connect(module):
def ess_connect(module: AnsibleModule):
"""Return an ess connection"""
ess_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -284,7 +289,7 @@ def ess_connect(module):
return ess
def sts_connect(module):
def sts_connect(module: AnsibleModule):
"""Return an sts connection"""
sts_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -298,7 +303,7 @@ def sts_connect(module):
return sts
def ram_connect(module):
def ram_connect(module: AnsibleModule):
"""Return an ram connection"""
ram_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.
@@ -312,7 +317,7 @@ def ram_connect(module):
return ram
def market_connect(module):
def market_connect(module: AnsibleModule):
"""Return an market connection"""
market_params = get_profile(module.params)
# If we have a region specified, connect to its endpoint.

View File

@@ -6,22 +6,27 @@ from __future__ import annotations
import re
import typing as t
from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule
__state_map = {"present": "--install", "absent": "--uninstall"}
# sdkmanager --help 2>&1 | grep -A 2 -- --channel
__channel_map = {"stable": 0, "beta": 1, "dev": 2, "canary": 3}
def __map_channel(channel_name):
def __map_channel(channel_name: str) -> int:
if channel_name not in __channel_map:
raise ValueError(f"Unknown channel name '{channel_name}'")
return __channel_map[channel_name]
def sdkmanager_runner(module, **kwargs):
def sdkmanager_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
return CmdRunner(
module,
command="sdkmanager",
@@ -40,18 +45,18 @@ def sdkmanager_runner(module, **kwargs):
class Package:
def __init__(self, name):
def __init__(self, name: str) -> None:
self.name = name
def __hash__(self):
def __hash__(self) -> int:
return hash(self.name)
def __ne__(self, other):
def __ne__(self, other: object) -> bool:
if not isinstance(other, Package):
return True
return self.name != other.name
def __eq__(self, other):
def __eq__(self, other: object) -> bool:
if not isinstance(other, Package):
return False
@@ -78,20 +83,20 @@ class AndroidSdkManager:
r"the packages they depend on were not accepted"
)
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self.runner = sdkmanager_runner(module)
def get_installed_packages(self):
def get_installed_packages(self) -> set[Package]:
with self.runner("installed sdk_root channel") as ctx:
rc, stdout, stderr = ctx.run()
return self._parse_packages(stdout, self._RE_INSTALLED_PACKAGES_HEADER, self._RE_INSTALLED_PACKAGE)
def get_updatable_packages(self):
def get_updatable_packages(self) -> set[Package]:
with self.runner("list newer sdk_root channel") as ctx:
rc, stdout, stderr = ctx.run()
return self._parse_packages(stdout, self._RE_UPDATABLE_PACKAGES_HEADER, self._RE_UPDATABLE_PACKAGE)
def apply_packages_changes(self, packages, accept_licenses=False):
def apply_packages_changes(self, packages: list[Package], accept_licenses: bool = False) -> tuple[int, str, str]:
"""Install or delete packages, depending on the `module.vars.state` parameter"""
if len(packages) == 0:
return 0, "", ""
@@ -113,7 +118,7 @@ class AndroidSdkManager:
return rc, stdout, stderr
return 0, "", ""
def _try_parse_stderr(self, stderr):
def _try_parse_stderr(self, stderr: str) -> None:
data = stderr.splitlines()
for line in data:
unknown_package_regex = self._RE_UNKNOWN_PACKAGE.match(line)
@@ -122,15 +127,15 @@ class AndroidSdkManager:
raise SdkManagerException(f"Unknown package {package}")
@staticmethod
def _parse_packages(stdout, header_regexp, row_regexp):
def _parse_packages(stdout: str, header_regexp: re.Pattern, row_regexp: re.Pattern) -> set[Package]:
data = stdout.splitlines()
section_found = False
section_found: bool = False
packages = set()
for line in data:
if not section_found:
section_found = header_regexp.match(line)
section_found = bool(header_regexp.match(line))
continue
else:
p = row_regexp.match(line)

View File

@@ -7,6 +7,10 @@ from __future__ import annotations
from ansible.module_utils.common.text.converters import to_bytes
import re
import os
import typing as t
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule
def normalize_subvolume_path(path):
@@ -28,12 +32,12 @@ class BtrfsCommands:
Provides access to a subset of the Btrfs command line
"""
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self.__module = module
self.__btrfs = self.__module.get_bin_path("btrfs", required=True)
self.__btrfs: str = self.__module.get_bin_path("btrfs", required=True)
def filesystem_show(self):
command = f"{self.__btrfs} filesystem show -d"
def filesystem_show(self) -> list[dict[str, t.Any]]:
command = [self.__btrfs, "filesystem", "show", "-d"]
result = self.__module.run_command(command, check_rc=True)
stdout = [x.strip() for x in result[1].splitlines()]
filesystems = []
@@ -43,14 +47,16 @@ class BtrfsCommands:
current = self.__parse_filesystem(line)
filesystems.append(current)
elif line.startswith("devid"):
if current is None:
raise ValueError("Found 'devid' line without previous 'Label' line")
current["devices"].append(self.__parse_filesystem_device(line))
return filesystems
def __parse_filesystem(self, line):
def __parse_filesystem(self, line) -> dict[str, t.Any]:
label = re.sub(r"\s*uuid:.*$", "", re.sub(r"^Label:\s*", "", line))
id = re.sub(r"^.*uuid:\s*", "", line)
filesystem = {}
filesystem: dict[str, t.Any] = {}
filesystem["label"] = label.strip("'") if label != "none" else None
filesystem["uuid"] = id
filesystem["devices"] = []
@@ -59,46 +65,46 @@ class BtrfsCommands:
filesystem["default_subvolid"] = None
return filesystem
def __parse_filesystem_device(self, line):
def __parse_filesystem_device(self, line: str) -> str:
return re.sub(r"^.*path\s", "", line)
def subvolumes_list(self, filesystem_path):
command = f"{self.__btrfs} subvolume list -tap {filesystem_path}"
def subvolumes_list(self, filesystem_path: str) -> list[dict[str, t.Any]]:
command = [self.__btrfs, "subvolume", "list", "-tap", to_bytes(filesystem_path)]
result = self.__module.run_command(command, check_rc=True)
stdout = [x.split("\t") for x in result[1].splitlines()]
subvolumes = [{"id": 5, "parent": None, "path": "/"}]
subvolumes: list[dict[str, t.Any]] = [{"id": 5, "parent": None, "path": "/"}]
if len(stdout) > 2:
subvolumes.extend([self.__parse_subvolume_list_record(x) for x in stdout[2:]])
return subvolumes
def __parse_subvolume_list_record(self, item):
def __parse_subvolume_list_record(self, item: list[str]) -> dict[str, t.Any]:
return {
"id": int(item[0]),
"parent": int(item[2]),
"path": normalize_subvolume_path(item[5]),
}
def subvolume_get_default(self, filesystem_path):
def subvolume_get_default(self, filesystem_path: str) -> int:
command = [self.__btrfs, "subvolume", "get-default", to_bytes(filesystem_path)]
result = self.__module.run_command(command, check_rc=True)
# ID [n] ...
return int(result[1].strip().split()[1])
def subvolume_set_default(self, filesystem_path, subvolume_id):
def subvolume_set_default(self, filesystem_path: str, subvolume_id: int) -> None:
command = [self.__btrfs, "subvolume", "set-default", str(subvolume_id), to_bytes(filesystem_path)]
result = self.__module.run_command(command, check_rc=True)
self.__module.run_command(command, check_rc=True)
def subvolume_create(self, subvolume_path):
def subvolume_create(self, subvolume_path: str) -> None:
command = [self.__btrfs, "subvolume", "create", to_bytes(subvolume_path)]
result = self.__module.run_command(command, check_rc=True)
self.__module.run_command(command, check_rc=True)
def subvolume_snapshot(self, snapshot_source, snapshot_destination):
def subvolume_snapshot(self, snapshot_source: str, snapshot_destination: str) -> None:
command = [self.__btrfs, "subvolume", "snapshot", to_bytes(snapshot_source), to_bytes(snapshot_destination)]
result = self.__module.run_command(command, check_rc=True)
self.__module.run_command(command, check_rc=True)
def subvolume_delete(self, subvolume_path):
def subvolume_delete(self, subvolume_path: str) -> None:
command = [self.__btrfs, "subvolume", "delete", to_bytes(subvolume_path)]
result = self.__module.run_command(command, check_rc=True)
self.__module.run_command(command, check_rc=True)
class BtrfsInfoProvider:
@@ -106,12 +112,12 @@ class BtrfsInfoProvider:
Utility providing details of the currently available btrfs filesystems
"""
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self.__module = module
self.__btrfs_api = BtrfsCommands(module)
self.__findmnt_path = self.__module.get_bin_path("findmnt", required=True)
self.__findmnt_path: str = self.__module.get_bin_path("findmnt", required=True)
def get_filesystems(self):
def get_filesystems(self) -> list[dict[str, t.Any]]:
filesystems = self.__btrfs_api.filesystem_show()
mountpoints = self.__find_mountpoints()
for filesystem in filesystems:
@@ -126,21 +132,23 @@ class BtrfsInfoProvider:
return filesystems
def get_mountpoints(self, filesystem_devices):
def get_mountpoints(self, filesystem_devices: list[str]) -> list[dict[str, t.Any]]:
mountpoints = self.__find_mountpoints()
return self.__filter_mountpoints_for_devices(mountpoints, filesystem_devices)
def get_subvolumes(self, filesystem_path):
def get_subvolumes(self, filesystem_path) -> list[dict[str, t.Any]]:
return self.__btrfs_api.subvolumes_list(filesystem_path)
def get_default_subvolume_id(self, filesystem_path):
def get_default_subvolume_id(self, filesystem_path) -> int:
return self.__btrfs_api.subvolume_get_default(filesystem_path)
def __filter_mountpoints_for_devices(self, mountpoints, devices):
def __filter_mountpoints_for_devices(
self, mountpoints: list[dict[str, t.Any]], devices: list[str]
) -> list[dict[str, t.Any]]:
return [m for m in mountpoints if (m["device"] in devices)]
def __find_mountpoints(self):
command = f"{self.__findmnt_path} -t btrfs -nvP"
def __find_mountpoints(self) -> list[dict[str, t.Any]]:
command = [self.__findmnt_path, "-t", "btrfs", "-nvP"]
result = self.__module.run_command(command)
mountpoints = []
if result[0] == 0:
@@ -150,7 +158,7 @@ class BtrfsInfoProvider:
mountpoints.append(mountpoint)
return mountpoints
def __parse_mountpoint_pairs(self, line):
def __parse_mountpoint_pairs(self, line) -> dict[str, t.Any]:
pattern = re.compile(
r'^TARGET="(?P<target>.*)"\s+SOURCE="(?P<source>.*)"\s+FSTYPE="(?P<fstype>.*)"\s+OPTIONS="(?P<options>.*)"\s*$'
)
@@ -164,13 +172,13 @@ class BtrfsInfoProvider:
"subvolid": self.__extract_mount_subvolid(groups["options"]),
}
else:
raise BtrfsModuleException(f"Failed to parse findmnt result for line: '{line}'")
raise BtrfsModuleException(f"Failed to parse findmnt result for line: {line!r}")
def __extract_mount_subvolid(self, mount_options):
def __extract_mount_subvolid(self, mount_options: str) -> int:
for option in mount_options.split(","):
if option.startswith("subvolid="):
return int(option[len("subvolid=") :])
raise BtrfsModuleException(f"Failed to find subvolid for mountpoint in options '{mount_options}'")
raise BtrfsModuleException(f"Failed to find subvolid for mountpoint in options {mount_options!r}")
class BtrfsSubvolume:
@@ -178,39 +186,38 @@ class BtrfsSubvolume:
Wrapper class providing convenience methods for inspection of a btrfs subvolume
"""
def __init__(self, filesystem, subvolume_id):
def __init__(self, filesystem: BtrfsFilesystem, subvolume_id: int):
self.__filesystem = filesystem
self.__subvolume_id = subvolume_id
def get_filesystem(self):
def get_filesystem(self) -> BtrfsFilesystem:
return self.__filesystem
def is_mounted(self):
def is_mounted(self) -> bool:
mountpoints = self.get_mountpoints()
return mountpoints is not None and len(mountpoints) > 0
def is_filesystem_root(self):
return 5 == self.__subvolume_id
def is_filesystem_root(self) -> bool:
return self.__subvolume_id == 5
def is_filesystem_default(self):
def is_filesystem_default(self) -> bool:
return self.__filesystem.default_subvolid == self.__subvolume_id
def get_mounted_path(self):
def get_mounted_path(self) -> str | None:
mountpoints = self.get_mountpoints()
if mountpoints is not None and len(mountpoints) > 0:
return mountpoints[0]
elif self.parent is not None:
if self.parent is not None:
parent = self.__filesystem.get_subvolume_by_id(self.parent)
parent_path = parent.get_mounted_path()
parent_path = parent.get_mounted_path() if parent else None
if parent_path is not None:
return parent_path + os.path.sep + self.name
else:
return None
return f"{parent_path}{os.path.sep}{self.name}"
return None
def get_mountpoints(self):
def get_mountpoints(self) -> list[str]:
return self.__filesystem.get_mountpoints_by_subvolume_id(self.__subvolume_id)
def get_child_relative_path(self, absolute_child_path):
def get_child_relative_path(self, absolute_child_path: str) -> str:
"""
Get the relative path from this subvolume to the named child subvolume.
The provided parameter is expected to be normalized as by normalize_subvolume_path.
@@ -222,19 +229,21 @@ class BtrfsSubvolume:
else:
raise BtrfsModuleException(f"Path '{absolute_child_path}' doesn't start with '{path}'")
def get_parent_subvolume(self):
def get_parent_subvolume(self) -> BtrfsSubvolume | None:
parent_id = self.parent
return self.__filesystem.get_subvolume_by_id(parent_id) if parent_id is not None else None
def get_child_subvolumes(self):
def get_child_subvolumes(self) -> list[BtrfsSubvolume]:
return self.__filesystem.get_subvolume_children(self.__subvolume_id)
@property
def __info(self):
return self.__filesystem.get_subvolume_info_for_id(self.__subvolume_id)
def __info(self) -> dict[str, t.Any]:
result = self.__filesystem.get_subvolume_info_for_id(self.__subvolume_id)
# assert result is not None
return result # type: ignore
@property
def id(self):
def id(self) -> int:
return self.__subvolume_id
@property
@@ -242,7 +251,7 @@ class BtrfsSubvolume:
return self.path.split("/").pop()
@property
def path(self):
def path(self) -> str:
return self.__info["path"]
@property
@@ -255,105 +264,105 @@ class BtrfsFilesystem:
Wrapper class providing convenience methods for inspection of a btrfs filesystem
"""
def __init__(self, info, provider, module):
def __init__(self, info: dict[str, t.Any], provider: BtrfsInfoProvider, module: AnsibleModule) -> None:
self.__provider = provider
# constant for module execution
self.__uuid = info["uuid"]
self.__label = info["label"]
self.__devices = info["devices"]
self.__uuid: str = info["uuid"]
self.__label: str = info["label"]
self.__devices: list[str] = info["devices"]
# refreshable
self.__default_subvolid = info["default_subvolid"] if "default_subvolid" in info else None
self.__default_subvolid: int | None = info["default_subvolid"] if "default_subvolid" in info else None
self.__update_mountpoints(info["mountpoints"] if "mountpoints" in info else [])
self.__update_subvolumes(info["subvolumes"] if "subvolumes" in info else [])
@property
def uuid(self):
def uuid(self) -> str:
return self.__uuid
@property
def label(self):
def label(self) -> str:
return self.__label
@property
def default_subvolid(self):
def default_subvolid(self) -> int | None:
return self.__default_subvolid
@property
def devices(self):
def devices(self) -> list[str]:
return list(self.__devices)
def refresh(self):
def refresh(self) -> None:
self.refresh_mountpoints()
self.refresh_subvolumes()
self.refresh_default_subvolume()
def refresh_mountpoints(self):
def refresh_mountpoints(self) -> None:
mountpoints = self.__provider.get_mountpoints(list(self.__devices))
self.__update_mountpoints(mountpoints)
def __update_mountpoints(self, mountpoints):
self.__mountpoints = dict()
def __update_mountpoints(self, mountpoints: list[dict[str, t.Any]]) -> None:
self.__mountpoints: dict[int, list[str]] = dict()
for i in mountpoints:
subvolid = i["subvolid"]
mountpoint = i["mountpoint"]
subvolid: int = i["subvolid"]
mountpoint: str = i["mountpoint"]
if subvolid not in self.__mountpoints:
self.__mountpoints[subvolid] = []
self.__mountpoints[subvolid].append(mountpoint)
def refresh_subvolumes(self):
def refresh_subvolumes(self) -> None:
filesystem_path = self.get_any_mountpoint()
if filesystem_path is not None:
subvolumes = self.__provider.get_subvolumes(filesystem_path)
self.__update_subvolumes(subvolumes)
def __update_subvolumes(self, subvolumes):
def __update_subvolumes(self, subvolumes: list[dict[str, t.Any]]) -> None:
# TODO strategy for retaining information on deleted subvolumes?
self.__subvolumes = dict()
self.__subvolumes: dict[int, dict[str, t.Any]] = dict()
for subvolume in subvolumes:
self.__subvolumes[subvolume["id"]] = subvolume
def refresh_default_subvolume(self):
def refresh_default_subvolume(self) -> None:
filesystem_path = self.get_any_mountpoint()
if filesystem_path is not None:
self.__default_subvolid = self.__provider.get_default_subvolume_id(filesystem_path)
def contains_device(self, device):
def contains_device(self, device: str) -> bool:
return device in self.__devices
def contains_subvolume(self, subvolume):
def contains_subvolume(self, subvolume: str) -> bool:
return self.get_subvolume_by_name(subvolume) is not None
def get_subvolume_by_id(self, subvolume_id):
def get_subvolume_by_id(self, subvolume_id: int) -> BtrfsSubvolume | None:
return BtrfsSubvolume(self, subvolume_id) if subvolume_id in self.__subvolumes else None
def get_subvolume_info_for_id(self, subvolume_id):
def get_subvolume_info_for_id(self, subvolume_id: int) -> dict[str, t.Any] | None:
return self.__subvolumes[subvolume_id] if subvolume_id in self.__subvolumes else None
def get_subvolume_by_name(self, subvolume):
def get_subvolume_by_name(self, subvolume: str) -> BtrfsSubvolume | None:
for subvolume_info in self.__subvolumes.values():
if subvolume_info["path"] == subvolume:
return BtrfsSubvolume(self, subvolume_info["id"])
return None
def get_any_mountpoint(self):
def get_any_mountpoint(self) -> str | None:
for subvol_mountpoints in self.__mountpoints.values():
if len(subvol_mountpoints) > 0:
return subvol_mountpoints[0]
# maybe error?
return None
def get_any_mounted_subvolume(self):
def get_any_mounted_subvolume(self) -> BtrfsSubvolume | None:
for subvolid, subvol_mountpoints in self.__mountpoints.items():
if len(subvol_mountpoints) > 0:
return self.get_subvolume_by_id(subvolid)
return None
def get_mountpoints_by_subvolume_id(self, subvolume_id):
def get_mountpoints_by_subvolume_id(self, subvolume_id: int) -> list[str]:
return self.__mountpoints[subvolume_id] if subvolume_id in self.__mountpoints else []
def get_nearest_subvolume(self, subvolume):
def get_nearest_subvolume(self, subvolume: str) -> BtrfsSubvolume:
"""Return the identified subvolume if existing, else the closest matching parent"""
subvolumes_by_path = self.__get_subvolumes_by_path()
while len(subvolume) > 1:
@@ -364,30 +373,31 @@ class BtrfsFilesystem:
return BtrfsSubvolume(self, 5)
def get_mountpath_as_child(self, subvolume_name):
def get_mountpath_as_child(self, subvolume_name: str) -> str:
"""Find a path to the target subvolume through a mounted ancestor"""
nearest = self.get_nearest_subvolume(subvolume_name)
nearest_or_none: BtrfsSubvolume | None = nearest
if nearest.path == subvolume_name:
nearest = nearest.get_parent_subvolume()
if nearest is None or nearest.get_mounted_path() is None:
nearest_or_none = nearest.get_parent_subvolume()
if nearest_or_none is None or nearest_or_none.get_mounted_path() is None:
raise BtrfsModuleException(f"Failed to find a path '{subvolume_name}' through a mounted parent subvolume")
else:
return nearest.get_mounted_path() + os.path.sep + nearest.get_child_relative_path(subvolume_name)
return f"{nearest_or_none.get_mounted_path()}{os.path.sep}{nearest_or_none.get_child_relative_path(subvolume_name)}"
def get_subvolume_children(self, subvolume_id):
def get_subvolume_children(self, subvolume_id: int) -> list[BtrfsSubvolume]:
return [BtrfsSubvolume(self, x["id"]) for x in self.__subvolumes.values() if x["parent"] == subvolume_id]
def __get_subvolumes_by_path(self):
def __get_subvolumes_by_path(self) -> dict[str, dict[str, t.Any]]:
result = {}
for s in self.__subvolumes.values():
path = s["path"]
result[path] = s
return result
def is_mounted(self):
def is_mounted(self) -> bool:
return self.__mountpoints is not None and len(self.__mountpoints) > 0
def get_summary(self):
def get_summary(self) -> dict[str, t.Any]:
subvolumes = []
sources = self.__subvolumes.values() if self.__subvolumes is not None else []
for subvolume in sources:
@@ -415,17 +425,19 @@ class BtrfsFilesystemsProvider:
Provides methods to query available btrfs filesystems
"""
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self.__module = module
self.__provider = BtrfsInfoProvider(module)
self.__filesystems = None
self.__filesystems: dict[str, BtrfsFilesystem] | None = None
def get_matching_filesystem(self, criteria):
def get_matching_filesystem(self, criteria: dict[str, t.Any]) -> BtrfsFilesystem:
if criteria["device"] is not None:
criteria["device"] = os.path.realpath(criteria["device"])
self.__check_init()
matching = [f for f in self.__filesystems.values() if self.__filesystem_matches_criteria(f, criteria)]
# assert self.__filesystems is not None # TODO
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
matching = [f for f in self_filesystems.values() if self.__filesystem_matches_criteria(f, criteria)]
if len(matching) == 1:
return matching[0]
else:
@@ -433,26 +445,30 @@ class BtrfsFilesystemsProvider:
f"Found {len(matching)} filesystems matching criteria uuid={criteria['uuid']} label={criteria['label']} device={criteria['device']}"
)
def __filesystem_matches_criteria(self, filesystem, criteria):
def __filesystem_matches_criteria(self, filesystem: BtrfsFilesystem, criteria: dict[str, t.Any]):
return (
(criteria["uuid"] is None or filesystem.uuid == criteria["uuid"])
and (criteria["label"] is None or filesystem.label == criteria["label"])
and (criteria["device"] is None or filesystem.contains_device(criteria["device"]))
)
def get_filesystem_for_device(self, device):
def get_filesystem_for_device(self, device: str) -> BtrfsFilesystem | None:
real_device = os.path.realpath(device)
self.__check_init()
for fs in self.__filesystems.values():
# assert self.__filesystems is not None # TODO
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
for fs in self_filesystems.values():
if fs.contains_device(real_device):
return fs
return None
def get_filesystems(self):
def get_filesystems(self) -> list[BtrfsFilesystem]:
self.__check_init()
return list(self.__filesystems.values())
# assert self.__filesystems is not None # TODO
self_filesystems: dict[str, BtrfsFilesystem] = self.__filesystems # type: ignore
return list(self_filesystems.values())
def __check_init(self):
def __check_init(self) -> None:
if self.__filesystems is None:
self.__filesystems = dict()
for f in self.__provider.get_filesystems():

View File

@@ -3,6 +3,8 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# This module utils is deprecated and will be removed in community.general 13.0.0
from __future__ import annotations

View File

@@ -5,11 +5,19 @@
from __future__ import annotations
import os
import typing as t
from ansible.module_utils.common.collections import is_sequence
from ansible.module_utils.common.locale import get_best_parsable_locale
from ansible_collections.community.general.plugins.module_utils import cmd_runner_fmt
if t.TYPE_CHECKING:
from collections.abc import Callable, Mapping, Sequence
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.community.general.plugins.module_utils.cmd_runner_fmt import ArgFormatType
ArgFormatter = t.Union[ArgFormatType, cmd_runner_fmt._ArgFormat] # noqa: UP007
def _ensure_list(value):
return list(value) if is_sequence(value) else [value]
@@ -24,7 +32,7 @@ class CmdRunnerException(Exception):
class MissingArgumentFormat(CmdRunnerException):
def __init__(self, arg, args_order, args_formats):
def __init__(self, arg, args_order: tuple[str, ...], args_formats) -> None:
self.args_order = args_order
self.arg = arg
self.args_formats = args_formats
@@ -37,7 +45,7 @@ class MissingArgumentFormat(CmdRunnerException):
class MissingArgumentValue(CmdRunnerException):
def __init__(self, args_order, arg):
def __init__(self, args_order: tuple[str, ...], arg) -> None:
self.args_order = args_order
self.arg = arg
@@ -72,19 +80,19 @@ class CmdRunner:
"""
@staticmethod
def _prepare_args_order(order):
return tuple(order) if is_sequence(order) else tuple(order.split())
def _prepare_args_order(order: str | Sequence[str]) -> tuple[str, ...]:
return tuple(order) if is_sequence(order) else tuple(order.split()) # type: ignore
def __init__(
self,
module,
module: AnsibleModule,
command,
arg_formats=None,
default_args_order=(),
check_rc=False,
force_lang="C",
path_prefix=None,
environ_update=None,
arg_formats: Mapping[str, ArgFormatter] | None = None,
default_args_order: str | Sequence[str] = (),
check_rc: bool = False,
force_lang: str = "C",
path_prefix: Sequence[str] | None = None,
environ_update: dict[str, str] | None = None,
):
self.module = module
self.command = _ensure_list(command)
@@ -117,10 +125,17 @@ class CmdRunner:
)
@property
def binary(self):
def binary(self) -> str:
return self.command[0]
def __call__(self, args_order=None, output_process=None, check_mode_skip=False, check_mode_return=None, **kwargs):
def __call__(
self,
args_order: str | Sequence[str] | None = None,
output_process: Callable[[int, str, str], t.Any] | None = None,
check_mode_skip: bool = False,
check_mode_return: t.Any | None = None,
**kwargs,
):
if output_process is None:
output_process = _process_as_is
if args_order is None:
@@ -146,7 +161,15 @@ class CmdRunner:
class _CmdRunnerContext:
def __init__(self, runner, args_order, output_process, check_mode_skip, check_mode_return, **kwargs):
def __init__(
self,
runner: CmdRunner,
args_order: tuple[str, ...],
output_process: Callable[[int, str, str], t.Any],
check_mode_skip: bool,
check_mode_return: t.Any,
**kwargs,
) -> None:
self.runner = runner
self.args_order = tuple(args_order)
self.output_process = output_process
@@ -194,7 +217,7 @@ class _CmdRunnerContext:
except MissingArgumentValue:
raise
except Exception as e:
raise FormatError(arg_name, value, runner.arg_formats[arg_name], e)
raise FormatError(arg_name, value, runner.arg_formats[arg_name], e) from e
if self.check_mode_skip and module.check_mode:
return self.check_mode_return
@@ -204,7 +227,7 @@ class _CmdRunnerContext:
return self.results_processed
@property
def run_info(self):
def run_info(self) -> dict[str, t.Any]:
return dict(
check_rc=self.check_rc,
environ_update=self.environ_update,

View File

@@ -11,36 +11,46 @@ from functools import wraps
from ansible.module_utils.common.collections import is_sequence
if t.TYPE_CHECKING:
from collections.abc import Callable
from collections.abc import Callable, Mapping, Sequence
ArgFormatType = Callable[[t.Any], list[str]]
ArgFormatType = Callable[[t.Any], Sequence[t.Any]]
_T = t.TypeVar("_T")
def _ensure_list(value):
return list(value) if is_sequence(value) else [value]
def _ensure_list(value: _T | Sequence[_T]) -> list[_T]:
return list(value) if is_sequence(value) else [value] # type: ignore # TODO need type assertion for is_sequence
class _ArgFormat:
def __init__(self, func, ignore_none=True, ignore_missing_value=False):
def __init__(
self,
func: ArgFormatType,
ignore_none: bool | None = True,
ignore_missing_value: bool = False,
) -> None:
self.func = func
self.ignore_none = ignore_none
self.ignore_missing_value = ignore_missing_value
def __call__(self, value):
def __call__(self, value: t.Any | None) -> list[str]:
ignore_none = self.ignore_none if self.ignore_none is not None else True
if value is None and ignore_none:
return []
f = self.func
return [str(x) for x in f(value)]
def __str__(self):
def __str__(self) -> str:
return f"<ArgFormat: func={self.func}, ignore_none={self.ignore_none}, ignore_missing_value={self.ignore_missing_value}>"
def __repr__(self):
def __repr__(self) -> str:
return str(self)
def as_bool(args_true, args_false=None, ignore_none=None):
def as_bool(
args_true: Sequence[t.Any] | t.Any,
args_false: Sequence[t.Any] | t.Any | None = None,
ignore_none: bool | None = None,
) -> _ArgFormat:
if args_false is not None:
if ignore_none is None:
ignore_none = False
@@ -51,24 +61,24 @@ def as_bool(args_true, args_false=None, ignore_none=None):
)
def as_bool_not(args):
def as_bool_not(args: Sequence[t.Any] | t.Any) -> _ArgFormat:
return as_bool([], args, ignore_none=False)
def as_optval(arg, ignore_none=None):
def as_optval(arg, ignore_none: bool | None = None) -> _ArgFormat:
return _ArgFormat(lambda value: [f"{arg}{value}"], ignore_none=ignore_none)
def as_opt_val(arg, ignore_none=None):
def as_opt_val(arg: str, ignore_none: bool | None = None) -> _ArgFormat:
return _ArgFormat(lambda value: [arg, value], ignore_none=ignore_none)
def as_opt_eq_val(arg, ignore_none=None):
def as_opt_eq_val(arg: str, ignore_none: bool | None = None) -> _ArgFormat:
return _ArgFormat(lambda value: [f"{arg}={value}"], ignore_none=ignore_none)
def as_list(ignore_none=None, min_len=0, max_len=None):
def func(value):
def as_list(ignore_none: bool | None = None, min_len: int = 0, max_len: int | None = None) -> _ArgFormat:
def func(value: t.Any) -> list[t.Any]:
value = _ensure_list(value)
if len(value) < min_len:
raise ValueError(f"Parameter must have at least {min_len} element(s)")
@@ -79,17 +89,21 @@ def as_list(ignore_none=None, min_len=0, max_len=None):
return _ArgFormat(func, ignore_none=ignore_none)
def as_fixed(*args):
def as_fixed(*args: t.Any) -> _ArgFormat:
if len(args) == 1 and is_sequence(args[0]):
args = args[0]
return _ArgFormat(lambda value: _ensure_list(args), ignore_none=False, ignore_missing_value=True)
def as_func(func, ignore_none=None):
def as_func(func: ArgFormatType, ignore_none: bool | None = None) -> _ArgFormat:
return _ArgFormat(func, ignore_none=ignore_none)
def as_map(_map, default=None, ignore_none=None):
def as_map(
_map: Mapping[t.Any, Sequence[t.Any] | t.Any],
default: Sequence[t.Any] | t.Any | None = None,
ignore_none: bool | None = None,
) -> _ArgFormat:
if default is None:
default = []
return _ArgFormat(lambda value: _ensure_list(_map.get(value, default)), ignore_none=ignore_none)
@@ -126,5 +140,5 @@ def stack(fmt):
return wrapper
def is_argformat(fmt):
def is_argformat(fmt: object) -> t.TypeGuard[_ArgFormat]:
return isinstance(fmt, _ArgFormat)

View File

@@ -14,6 +14,9 @@ from urllib.parse import urlencode
from ansible.module_utils.urls import open_url
if t.TYPE_CHECKING:
from ansible.module_utils.basic import AnsibleModule
def get_consul_url(configuration):
return f"{configuration.scheme}://{configuration.host}:{configuration.port}/v1"
@@ -120,7 +123,7 @@ class _ConsulModule:
operational_attributes: set[str] = set()
params: dict[str, t.Any] = {}
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self._module = module
self.params = _normalize_params(module.params, module.argument_spec)
self.api_params = {

View File

@@ -6,11 +6,26 @@
from __future__ import annotations
import csv
import typing as t
from io import StringIO
from ansible.module_utils.common.text.converters import to_native
if t.TYPE_CHECKING:
from collections.abc import Sequence
class DialectParamsOrNone(t.TypedDict):
delimiter: t.NotRequired[str | None]
doublequote: t.NotRequired[bool | None]
escapechar: t.NotRequired[str | None]
lineterminator: t.NotRequired[str | None]
quotechar: t.NotRequired[str | None]
quoting: t.NotRequired[int | None]
skipinitialspace: t.NotRequired[bool | None]
strict: t.NotRequired[bool | None]
class CustomDialectFailureError(Exception):
pass
@@ -22,7 +37,7 @@ class DialectNotAvailableError(Exception):
CSVError = csv.Error
def initialize_dialect(dialect, **kwargs):
def initialize_dialect(dialect: str, **kwargs: t.Unpack[DialectParamsOrNone]) -> str:
# Add Unix dialect from Python 3
class unix_dialect(csv.Dialect):
"""Describe the usual properties of Unix-generated CSV files."""
@@ -43,16 +58,16 @@ def initialize_dialect(dialect, **kwargs):
dialect_params = {k: v for k, v in kwargs.items() if v is not None}
if dialect_params:
try:
csv.register_dialect("custom", dialect, **dialect_params)
csv.register_dialect("custom", dialect, **dialect_params) # type: ignore
except TypeError as e:
raise CustomDialectFailureError(f"Unable to create custom dialect: {e}")
raise CustomDialectFailureError(f"Unable to create custom dialect: {e}") from e
dialect = "custom"
return dialect
def read_csv(data, dialect, fieldnames=None):
BOM = to_native("\ufeff")
def read_csv(data: str, dialect: str, fieldnames: Sequence[str] | None = None) -> csv.DictReader:
BOM = "\ufeff"
data = to_native(data, errors="surrogate_or_strict")
if data.startswith(BOM):
data = data[len(BOM) :]

Some files were not shown because too many files have changed in this diff Show More