1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00
Commit graph

4036 commits

Author SHA1 Message Date
Felix Fontein
ddf05104f3
Add missing integration test aliases files (#11357)
* Add missing aliases files.

* Fix directory name.

* Add another missing aliases file.

* Adjust test to also work with newer jsonpatch versions.
2026-01-02 09:34:06 +01:00
Alexei Znamensky
61d794f171
incus conn plugin: improve readability (was ruff: set target-python 3.7) (#11346)
* incus connection plugin: improve readability

* add changelog frag

* Update plugins/connection/incus.py

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

* Update plugins/connection/incus.py

* Update plugins/connection/incus.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-31 11:27:49 +13:00
Alexei Znamensky
e8f2b135ba
batch 3 - update Python idiom to 3.7 using pyupgrade (#11343)
* batch 3 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* bring back sanity

* adjust test

* Apply suggestions from code review
2025-12-30 22:18:52 +01:00
Alexei Znamensky
543329cecb
batch 4 - update Python idiom to 3.7 using pyupgrade (#11344)
* batch 4 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* bring back sanity

* remove unused import
2025-12-30 16:15:48 +01:00
Alexei Znamensky
5b5f7e9e64
batch 1 - update Python idiom to 3.7 using pyupgrade (#11341)
* batch 1 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* add changelog frag
2025-12-30 16:15:24 +01:00
Alexei Znamensky
a0d3bac88c
cronvar: simplify exception raise - remove import sys (#11340)
* cronvar: simplify exception raise - remove import sys

* add changelog frag
2025-12-30 16:09:24 +01:00
Alexei Znamensky
266d9d3fb0
batch 2 - update Python idiom to 3.7 using pyupgrade (#11342)
* batch 2 - update Python idiom to 3.7 using pyupgrade

* Apply suggestions from code review
2025-12-30 22:50:16 +13:00
Felix Fontein
9e363c9f94 The next expected release will be 12.3.0. 2025-12-29 14:45:34 +01:00
Alexei Znamensky
6ae47590cd
lxc_container: replace subprocess.Popen() with run_command() (#11204)
* lxc_container: replace subprocess.Popen() with run_command()

* Update plugins/modules/lxc_container.py

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

* add changelog frag

* retain Popen logic in module_utils

* Update plugins/module_utils/_lxc.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-29 11:47:26 +01:00
Alexei Znamensky
18c362eef4
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
2025-12-29 21:55:52 +13:00
Greg Harvey
b3c066b99f
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.

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

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

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-28 21:03:55 +01:00
Greg Harvey
4fe129a0ed
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.
2025-12-28 21:03:20 +01:00
Daniel Gonçalves
280d269d78
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

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-28 21:02:31 +01:00
maxblome
9f5114dc76
keycloak_userprofile: Add missing selector option (#11309)
* Add selector option

* Add fragment

* Formatting
2025-12-28 09:30:56 +01:00
Felix Fontein
97e6ba0b65 Add reformat commit to .git-blame-ignore-revs. 2025-12-27 16:30:49 +01:00
Alexei Znamensky
d549baa5e1
straight up: ruff format (#11329)
* straight up: ruff format

* Apply suggestions from code review
2025-12-28 01:36:24 +13:00
Alexei Znamensky
04d0a4daf3
lxc_container: rearrange docs notes (#11325)
* lxc_container: rearrange docs notes

* Update plugins/modules/lxc_container.py

* reformat docs
2025-12-25 08:22:03 +01:00
Alexei Znamensky
ec6b7bf91c
lxc_container: use tempfile.TemporaryDirectory (#11323)
* lxc_container: use tempfile.TemporaryDirectory

* add changelog frag

* typo
2025-12-25 08:18:19 +01:00
Felix Fontein
99b9680ea2
Announce making all module utils, plugin utils, and doc fragments private (#11320)
Announce making all module utils, plugin utils, and doc fragments private.
2025-12-23 22:59:38 +01:00
Greg Harvey
3debc968a4
Fixing documentation for scaleway_private_network module. (#11316) 2025-12-23 13:58:04 +01:00
Aleksandr Gabidullin
61b559c4fd
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

---------

Co-authored-by: Александр Габидуллин <agabidullin@astralinux.ru>
2025-12-22 15:55:28 +01:00
Felix Fontein
02b185932c
Remove unittest.main() calls (#11304)
Remove unittest.main() calls.
2025-12-22 15:47:42 +01:00
IP2Location
2c6746ffa0
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

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

* Update plugins/modules/ip2locationio_facts.py

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

* Update plugins/modules/ip2locationio_facts.py

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

* Update plugins/modules/ip2locationio_facts.py

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

* Update plugins/modules/ip2locationio_facts.py

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

* Update plugins/modules/ip2locationio_facts.py

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

* Update plugins/modules/ip2locationio_facts.py

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

* 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.

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

* Update plugins/modules/ip2location_info.py

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

* Update plugins/modules/ip2location_info.py

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

* Updated return definition.

* Update BOTMETA.yml to latest module name.

* Update plugins/modules/ip2location_info.py

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

* Update plugins/modules/ip2location_info.py

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

* Removed extra parameter from "fetch_url".

* Fixed "test_ip2location_info.py" with formatter.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-22 09:41:28 +01:00
nwintering
a55884c921
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

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

* fix ruff formatting

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-22 09:40:26 +01:00
Ivan Kokalovic
a5aec7d61a
Fix typo in auth_username in examples (#11295) 2025-12-19 16:49:07 +13:00
Alexei Znamensky
4632e3d5ee
aix_*: docs adjustments (#11291) 2025-12-16 10:16:55 +13:00
Felix Fontein
ef632145e9
Add more module_utils typing (#11283)
Add more module_utils typing.
2025-12-15 19:46:51 +01:00
Samuli Seppänen
df34945991
keycloak_authentication_required_actions: fix examples (#11284)
The correct parameter name is "required_actions" (plural).
2025-12-15 19:16:49 +01:00
Felix Fontein
a96a5c44a5
sysrc tests: skip FreeBSD 14.2 for ezjail tests (#11276)
Looks like 14.2 no longer works.
2025-12-14 11:55:40 +01:00
Alexei Znamensky
1b15e595e0
use FQCN for extending docs with files and url (#11277)
* use FQCN for extending docs with files and url

* remove typo
2025-12-14 23:49:28 +13:00
s-hamann
d424907172
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
2025-12-10 13:29:41 +01:00
Alexei Znamensky
ac37544c53
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

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-10 13:29:32 +01:00
Guillaume Dorschner
a977c6f7c1
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

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

---------

Co-authored-by: Guillaume Dorschner <guillaume.dorschner@thalesgroup.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-08 22:51:02 +01:00
Guillaume Dorschner
a9540f93d2
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

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

---------

Co-authored-by: Guillaume Dorschner <guillaume.dorschner@thalesgroup.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-06 13:41:40 +01:00
Felix Fontein
0ef3eac0f4
iptables_state: get rid of temporary files (#11258)
Get rid of temporary files.
2025-12-06 13:40:59 +01:00
Alexei Znamensky
3d25aac978
monit: use enum (#11245)
* monit: use enum

* make mypy happy about the var type

* add changelog frag

* typo - this is getting frequent
2025-12-02 21:54:50 +01:00
Tiziano Müller
76589bd97a
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.

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-02 21:34:34 +01:00
Alexei Znamensky
8d51c5f666
btrfs module utils: pass command as list to run_command() (#11240)
* btrfs module utils: pass command as list to run_command()

* add changelog frag
2025-12-03 00:08:41 +13:00
Alexei Znamensky
0a802ecdcb
deps module util: use Enum to represent states (#11242)
* deps module util: use Enum to represent states

* add changelog frag
2025-12-03 00:07:46 +13:00
Felix Fontein
7016b681fd The next expected release is 12.2.0. 2025-12-01 20:47:47 +01:00
Felix Fontein
c7f6a28d89
Add basic typing for module_utils (#11222)
* Add basic typing for module_utils.

* Apply some suggestions.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* 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.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* 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.

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-01 20:40:06 +01:00
Felix Fontein
fb2f34ba85
Stop re-defining the argument spec in unit tests (#11235)
* Stop re-defining the argument spec in unit tests.

* Shut up linter.
2025-12-01 06:59:23 +01:00
Sean McAvoy
6365b5a981
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.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-01 06:58:45 +01:00
Alexei Znamensky
16d51a8233
remove % templating (#11231)
* remove % templating

* add changelog frag

* suggestions from review

* remove unused import
2025-12-01 06:46:50 +01:00
Felix Fontein
d30428ac71
Remove no longer needed _mount module util (#11232)
Remove no longer needed _mount module util.
2025-12-01 06:42:13 +01:00
Paul Mercier-Handisyde
ebcad7e6d1
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).

Signed-off-by: handisyde <github@handisyde.com>

* changelog: rename fragment to match PR number

Signed-off-by: handisyde <github@handisyde.com>

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

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

---------

Signed-off-by: handisyde <github@handisyde.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-30 14:51:14 +01:00
Alexei Znamensky
f27839673c
fix couple of f-string mishaps (#11229)
* fix couple of f-string mishaps

* add changelog frag

* fix insanity
2025-11-30 08:27:13 +01:00
Christer Warén
379db770c5
keycloak_realm: add webAuthnPolicyPasswordlessPasskeysEnabled param (#11197)
* keycloak_realm: add webAuthnPolicyPasswordlessPasskeysEnabled param

* Changelog Fragment - 11197

* Apply suggestions from code review

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

* Fix typo in changelog fragment filename

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 15:20:34 +01:00
Marc Olivier Bergeron
22a4f8e272
Added support for Windows VM with Incus connection. (#11199)
* Added support for Windows VM with Incus connection.

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

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

* Attempt to fix the argument splitting.

* Only split on the first occurrence of the command argument

* Applying nox

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 15:18:02 +01:00
Alexei Znamensky
d550baacfa
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

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

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

* reformat

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-29 08:28:22 +01:00