1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00
Commit graph

894 commits

Author SHA1 Message Date
Mariam Ahhttouche
f57843c1e1
Merge 936854e9e3 into dae2157bb7 2026-03-19 22:48:54 +01:00
Christoph Fiehe
dae2157bb7
merge_variables: extended merge capabilities added (#11536)
* merge_variables: extended merge capabilities added

This extension gives you more control over the variable merging process of the lookup plugin `merge_variables`. It closes the gap between Puppet's Hiera merging capabilities and the limitations of Ansible's default variable plugin `host_group_vars` regarding fragment-based value definition. You can now decide which merge strategy should be applied to dicts, lists, and other types. Furthermore, you can specify a merge strategy that should be applied in case of type conflicts.

The default behavior of the plugin has been preserved so that it is fully backward-compatible with the already implemented state.

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Update changelogs/fragments/11536-merge-variables-extended-merging-capabilities.yml

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

* Update plugins/lookup/merge_variables.py

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

* Periods added at the end of each choice description

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Update plugins/lookup/merge_variables.py

Co-authored-by: Mark <40321020+m-a-r-k-e@users.noreply.github.com>

* ref: follow project standard for choice descriptions

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* ref: more examples added and refactoring

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Update plugins/lookup/merge_variables.py

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

* ref: some more comments to examples added

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* fix: unused import removed

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* ref: re-add "merge" to strategy map

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Update comments

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Specification of transformations solely as string

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Comments updated

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* ref: `append_rp` and `prepend_rp` removed
feat: options dict for list transformations re-added
feat: allow setting `keep` for dedup transformation with possible values: `first` (default) and `last`

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* ref: improve options documentation

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* ref: documentation improved, avoiding words like newer or older in merge description

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* Update plugins/lookup/merge_variables.py

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

* ref: "prio" replaced by "dict"

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* feat: two integration tests added

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

---------

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Mark <40321020+m-a-r-k-e@users.noreply.github.com>
2026-03-19 22:45:44 +01:00
Mariam Ahhttouche
936854e9e3
skip running ci tests in macos
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-18 15:28:56 +01:00
thomasbargetz
25b5655be7
keycloak_authentication_v2: verify providerIds (fix 11583) (#11585)
* 11583 verify providerIds in keycloak_authentication_v2

* 11583 code cleanup

---------

Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
2026-03-18 07:06:09 +01:00
thomasbargetz
e7a253b4c9
keycloak_authentication_v2: covers idp flow overrides in safe swap (fix 11582) (#11601)
* 11582 keycloak_authentication_v2 covers idp flow overrides in safe swap

* 11583 update documentation and comments
2026-03-18 06:49:24 +01:00
thomasbargetz
a69f7e60b4
add module keycloak_authentication_v2 (#11557)
* add module keycloak_authentication_v2

* skip sanity checks, because the run into a recursion

* 11556 fix documentation

* 11556 limit the depth of nested flows to 4

* 11556 code cleanup

* 11556 code cleanup - add type hints

* 11556 add keycloak_authentication_v2 to meta/runtime.yml

* 11556 code cleanup - remove custom type hints

* 11556 code cleanup - none checks

* Update plugins/modules/keycloak_authentication_v2.py

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

* Update plugins/modules/keycloak_authentication_v2.py

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

* 11556 code cleanup - remove document starts

* 11556 cleanup

* 11556 cleanup

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
2026-03-12 22:04:08 +01:00
Felix Fontein
4cd91ba4d4
Fix templating bug in iptables_state tests (#11541)
* Fix templating bug in iptables_state tests.

* Try to install older packages on RHEL.
2026-03-11 22:02:08 +01:00
Mariam Ahhttouche
990c0a5eaf Allow testing using Python versions lower or equal to 3.8 2026-03-11 15:01:03 +00:00
Mariam Ahhttouche
f7051feeaf Clean uv_python module tests 2026-03-10 17:40:57 +00:00
Mariam Ahhttouche
9633e951d4 Add task to uv_python tests to add uv installation directory to PATH 2026-03-10 15:54:27 +00:00
Alexei Znamensky
93112d23e5
monit: remove unstable tag from integration tests (#11562) 2026-03-10 06:42:54 +01:00
Mariam Ahhttouche
e221795cf8 Update tests to install uv using pip and fix some tests 2026-03-07 17:35:00 +00:00
Mariam Ahhttouche
a21646d398 Handle case when version given is an empty string in uv_python module 2026-03-07 16:10:03 +00:00
Mariam Ahhttouche
97bda3fb5e Make uv_python tests more deterministic 2026-03-07 16:10:03 +00:00
Mariam Ahhttouche
9697c31e8d Add aliases to skip running tests on freebsd and rhel 2026-03-07 16:10:03 +00:00
Mariam Ahhttouche
58616656ce Remove unecessary integration test for uv_python 2026-03-07 16:09:34 +00:00
Mariam Ahhttouche
22147bd913 Updates test aliases 2026-03-06 13:30:53 +00:00
Mariam Ahhttouche
4a4ec34145 Fix typing.Tuple is deprecated linting error 2026-03-06 12:46:50 +00:00
Mariam Ahhttouche
d52fdc4c83 make integration tests more deterministic and fix typo 2026-03-05 15:49:38 +01:00
Mariam Ahhttouche
f3475ae023 make integration tests more deterministic 2026-03-05 12:17:51 +01:00
Matt Clay
9b9d8eac09
Update tests to pass on macOS arm64 (#11544) 2026-02-27 18:55:29 +01:00
Mariam Ahhttouche
5033a4f922 Use StrictVersion instead of packaging Version 2026-02-27 17:18:48 +01:00
Mariam Ahhttouche
ed0eb833f7 Add integration tests' aliases file for uv_python module 2026-02-25 20:39:24 +01:00
Mariam Ahhttouche
1858a586b4
Fix typo
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-25 20:06:23 +01:00
Mariam Ahhttouche
19043541f1 Fix yamllint errors 2026-02-25 08:33:22 +01:00
Mariam Ahhttouche
14b3f86c45 uv_python module: pin uv version used in tests 2026-02-24 11:32:55 +01:00
Mariam Ahhttouche
77b04b4885 uv_python module: improve tests 2026-02-23 14:31:12 +01:00
Mariam Ahhttouche
a35e1216f9 uv_python module: clean tests 2026-02-23 08:05:14 +01:00
Mariam Ahhttouche
8181aa0343 uv_python module: update integration tests 2026-02-23 06:53:46 +01:00
Felix Fontein
e118b23ba0
Simplify and extend from_ini tests (#11534)
Simplify and extend from_ini tests.
2026-02-23 06:16:51 +01:00
Robert Sander
aec0e61ba1
adds parameter delimiters to from_ini filter (#11512)
* adds parameter delimiters to from_ini filter

fixes issue #11506

* adds changelog fragment

* fixes pylint dangerous-default-value / W0102

* does not assume default delimiters

let that be decided in the super class

* Update plugins/filter/from_ini.py

verbose description

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

* Update changelogs/fragments/11512-from_ini-delimiters.yaml

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

* adds input validation

* adss check for delimiters not None

* adds missing import

* removes the negation

* adds suggestions from russoz

* adds ruff format suggestion

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-23 05:44:32 +01:00
Mariam Ahhttouche
5b59f830a2 uv_python module: improve integration tests 2026-02-21 14:23:58 +01:00
Mariam Ahhttouche
1371cf2fcb uv_python module: fix integration tests 2026-02-20 17:06:08 +01:00
Mariam Ahhttouche
ae5eeaffe2 uv_python module: add python version to module return values for present state 2026-02-19 20:42:12 +01:00
Ivan Kokalovic
34938ca1ef
keycloak_user_rolemapping: handle None response for client role lookup (#11471)
* fix(keycloak_user_rolemapping): handle None response for client role lookup

When adding a client role to a user who has no existing roles for that
client, get_client_user_rolemapping_by_id() returns None. The existing
code indexed directly into the result causing a TypeError. Add the same
None check that already existed for realm roles since PR #11256.

Fixes #10960

* fix(tests): use dict format for task vars in keycloak_user_rolemapping tests

Task-level vars requires a YAML mapping, not a sequence. The leading
dash (- roles:) produced a list instead of a dict, which ansible-core
2.20 rejects with "Vars in a Task must be specified as a dictionary".

* Update changelogs/fragments/keycloak-user-rolemapping-client-none-check.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 20:24:35 +01:00
Ivan Kokalovic
80d21f2a0d
keycloak_realm_key: add full support for all Keycloak key providers (#11468)
* feat(keycloak_realm_key): add support for auto-generated key providers

Add support for Keycloak's auto-generated key providers where Keycloak
manages the key material automatically:

- rsa-generated: Auto-generates RSA signing keys
- hmac-generated: Auto-generates HMAC signing keys
- aes-generated: Auto-generates AES encryption keys
- ecdsa-generated: Auto-generates ECDSA signing keys

New algorithms:
- HMAC: HS256, HS384, HS512
- ECDSA: ES256, ES384, ES512
- AES: AES (no algorithm parameter needed)

New config options:
- secret_size: For HMAC/AES providers (key size in bytes)
- key_size: For RSA-generated provider (key size in bits)
- elliptic_curve: For ECDSA-generated provider (P-256, P-384, P-521)

Changes:
- Make private_key/certificate optional (only required for rsa/rsa-enc)
- Add provider-algorithm validation with clear error messages
- Fix KeyError when managing default realm keys (issue #11459)
- Maintain backward compatibility: RS256 default works for rsa/rsa-generated

Fixes: #11459

* fix: address sanity test failures

- Add 'default: RS256' to algorithm documentation to match spec
- Add no_log=True to secret_size parameter per sanity check

* feat(keycloak_realm_key): extend support for all Keycloak key providers

Add support for remaining auto-generated key providers:
- rsa-enc-generated (RSA encryption keys with RSA1_5, RSA-OAEP, RSA-OAEP-256)
- ecdh-generated (ECDH key exchange with ECDH_ES, ECDH_ES_A128KW/A192KW/A256KW)
- eddsa-generated (EdDSA signing with Ed25519, Ed448 curves)

Changes:
- Add provider-specific elliptic curve config key mapping
  (ecdsaEllipticCurveKey, ecdhEllipticCurveKey, eddsaEllipticCurveKey)
- Add PROVIDERS_WITHOUT_ALGORITHM constant for providers that don't need algorithm
- Add elliptic curve validation per provider type
- Update documentation with all supported algorithms and examples
- Add comprehensive integration tests for all new providers

This completes full coverage of all Keycloak key provider types.

* style: apply ruff formatting

* feat(keycloak_realm_key): add java-keystore provider and update_password

Add support for java-keystore provider to import keys from Java
Keystore (JKS or PKCS12) files on the Keycloak server filesystem.

Add update_password parameter to control password handling for
java-keystore provider:
- always (default): Always send passwords to Keycloak
- on_create: Only send passwords when creating, preserve existing
  passwords when updating (enables idempotent playbooks)

The on_create mode sends the masked value ("**********") that Keycloak
recognizes as "preserve existing password", matching the behavior when
re-importing an exported realm.

Replace password_checksum with update_password - the checksum approach
was complex and error-prone. The update_password parameter is simpler
and follows the pattern used by ansible.builtin.user module.

Also adds key_info return value containing kid, certificate fingerprint,
status, and expiration for java-keystore keys.

* address PR review feedback

- Remove no_log=True from secret_size (just an int, not sensitive)
- Add version_added: 12.4.0 to new parameters and return values
- Remove "Added in community.general 12.4.0" from description text
- Consolidate changelog entries into 4 focused entries
- Remove bugfix from changelog (now in separate PR #11470)

* address review feedback from russoz and felixfontein

- remove docstrings from module-local helpers
- remove line-by-line comments and unnecessary null guard
- use specific exceptions instead of bare except Exception
- use module.params["key"] instead of .get("key")
- consolidate changelog into single entry
- avoid "complete set" claim, reference Keycloak 26 instead

* address round 2 review feedback

- Extract remove_sensitive_config_keys() helper (DRY refactor)
- Simplify RS256 validation to single code path
- Add TypeError to inner except in compute_certificate_fingerprint()
- Remove redundant comments (L812, L1031)
- Switch .get() to direct dict access for module.params
2026-02-18 07:48:37 +01:00
Mariam Ahhttouche
afbe833c02 uv_python module: return commands' stderr and return code as a variable of stdout 2026-02-17 16:46:42 +01:00
Mariam Ahhttouche
54e7a639ef uv_python module: refactor code 2026-02-17 15:17:02 +01:00
Mariam Ahhttouche
5819c8eb7b uv_python module: improve check mode for present state to fail when no patch version is available 2026-02-17 14:43:12 +01:00
Mariam Ahhttouche
571a5b5161 uv_python module: improve integration tests 2026-02-16 16:13:33 +01:00
Mariam Ahhttouche
cfecbc6d7b uv_python module: refactor code 2026-02-16 14:31:58 +01:00
Mariam Ahhttouche
ce10eba574 uv_python module: add integration test for case when specified version does not exist 2026-02-16 14:28:57 +01:00
Mariam Ahhttouche
7610b82e00 uv_python module: add integration test for when uv executable does not exist 2026-02-16 11:38:07 +01:00
Mariam Ahhttouche
c40054f3f6 uv_python module: improve integration tests 2026-02-16 11:17:23 +01:00
Mariam Ahhttouche
473f758ec1 uv_python module: improve absent state check mode and add corresponding integration test 2026-02-13 17:10:46 +01:00
Mariam Ahhttouche
87ad81992d uv_python module: add integration tests for check mode 2026-02-13 15:49:15 +01:00
Mariam Ahhttouche
0f586328bc uv_python module: add integration tests for latest state 2026-02-13 15:42:09 +01:00
Mariam Ahhttouche
71d7538bdf uv_python module: add integration tests for version format 2026-02-12 17:27:25 +01:00
Mariam Ahhttouche
458cd11c42 uv_python module: add integration tests 2026-02-12 10:47:21 +01:00
Mariam Ahhttouche
731d7b571f uv_python module: add integration tests 2026-02-11 17:20:48 +01:00