Compare commits

...

347 Commits

Author SHA1 Message Date
patchback[bot]
412a348738 [PR #11918/89d82ab9 backport][stable-12] scaleway: fix NoneType error in get_resources() (#11924)
scaleway: fix NoneType error in get_resources() (#11918)

* scaleway: fix NoneType error in get_resources() when API returns empty or non-JSON response

* add changelog fragment for #11918

* Update changelogs/fragments/11361-scaleway-get-resources-none-type.yml



---------



(cherry picked from commit 89d82ab9df)

Co-authored-by: RealCharlesChia <161665317+RealCharlesChia@users.noreply.github.com>
Co-authored-by: RealCharlesChia <RealCharlesChia@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-27 21:13:47 +02:00
Felix Fontein
020fcb251f Prepare 12.6.1. 2026-04-22 20:51:30 +02:00
patchback[bot]
1ea0904e69 [PR #11912/7db237aa backport][stable-12] Add Python 3.15 to CI (#11915)
Add Python 3.15 to CI (#11912)

Add Python 3.15 to CI.

(cherry picked from commit 7db237aaa4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-22 20:50:32 +02:00
patchback[bot]
90aa3ec24d [PR #11909/d57a6672 backport][stable-12] Replace default favicon URL again (#11913)
Replace default favicon URL again (#11909)

* replace default favicon URL

* add changelog fragment for PR 11909

* fix syntax for change fragment



* use higher res favicon by default

---------



(cherry picked from commit d57a667274)

Co-authored-by: Lars Krahl <57526005+mmslkr@users.noreply.github.com>
Co-authored-by: Lars Krahl <lars.krahl@telekom.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-22 20:17:17 +02:00
patchback[bot]
2b64eb69be [PR #11901/9ef1dbb6 backport][stable-12] Move ansible-core 2.18 to EOL CI (#11904)
Move ansible-core 2.18 to EOL CI (#11901)

Move ansible-core 2.18 to EOL CI.

(cherry picked from commit 9ef1dbb6d5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-20 17:03:32 +02:00
patchback[bot]
9233243c13 [PR #11898/6b5bf0a0 backport][stable-12] Fix FQCNs in examples (#11902)
Fix FQCNs in examples (#11898)

Fix FQCNs in examples.

(cherry picked from commit 6b5bf0a0bc)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-20 15:20:24 +02:00
Felix Fontein
6407d59323 The next release will be 12.6.1. 2026-04-20 13:56:57 +02:00
Felix Fontein
25b09239f6 Release 12.6.0. 2026-04-20 12:34:53 +02:00
patchback[bot]
524aa8bab4 [PR #11840/7ce198f0 backport][stable-12] keycloak modules: add missing author credit (#11895)
keycloak modules: add missing author credit (#11840)

keycloak modules: add missing author credit for contributions

Added myself (@koke1997) to the author list of three modules
I contributed to in PRs #11468, #11470, #11471, and #11473 but forgot
to include at the time. Also signing up as maintainer for these modules
in .github/BOTMETA.yml so the bot can route related issues and PRs.

(cherry picked from commit 7ce198f0e7)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
2026-04-20 12:17:16 +02:00
patchback[bot]
09bea0031d [PR #11892/3325b854 backport][stable-12] Fix typo (#11894)
Fix typo (#11892)

(cherry picked from commit 3325b854ee)

Co-authored-by: Matt Williams <matt@milliams.com>
2026-04-20 12:17:03 +02:00
patchback[bot]
be4cf3ba4d [PR #11735/3e9689b1 backport][stable-12] jira - resolve Cloud assignee email to account ID via user search (#11891)
jira - resolve Cloud assignee email to account ID via user search (#11735)

* jira - resolve Cloud assignee email to account ID via user search

When cloud=true and assignee contains '@', look up a unique user with
GET /rest/api/2/user/search and use accountId for create, transition,
and edit. Document Jira Cloud vs Server/Data Center assignee behavior.

Fixes https://github.com/ansible-collections/community.general/issues/11734

Assisted-by AI: Claude 4.6 Opus (Anthropic) via Cursor IDE



* * Using urllib.parse.quote for URL encoding
* Adding "added in version" note for assignee when resolving account_id from email



* * Added cached variable 'user_email'
* Changed comparison to handle missing email safely
* Updated error message formatting to use repr-style values



* jira - adjust assignee and cloud descriptions (#11734)



* jira - resolve user-type field emails to account IDs on Jira Cloud (#11734)

When cloud=true, user-type fields (assignee, reporter, and any listed
in the new custom_user_fields parameter) that contain '@' are resolved
from email to Jira Cloud account ID via the user search API. Strings
without '@' are assumed to be account IDs. Add custom_user_fields
parameter for user to declare additional custom fields of user type.



* jira - address PR 11735 review (docs, assignee path, errors, naming)

- Clarify O(custom_user_fields): built-ins stay automatic; list extra
  user-typed fields without implying they are only custom-field IDs.
- On Jira Cloud, set assignee from the module param as a plain string and
  let resolve_user_fields() map it to accountId (including email lookup).
- Drop redundant ``or []`` when merging O(custom_user_fields) with the
  built-in user field list.
- Use public names USER_FIELDS, resolve_user_fields, and resolve_account_id
  (no leading underscore) per reviewer preference.
- Quote field name and email in resolution errors with explicit "…" text
  instead of repr-style !r, keeping values readable in failure messages.

Refs: https://github.com/ansible-collections/community.general/pull/11735

AI-assisted: Composer 2 (Anthropic) via Cursor IDE



* Changing fail_json formatting



* formatting fixes



* jira - fixing assignee as module option in description



---------


(cherry picked from commit 3e9689b13d)

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>
Co-authored-by: vladi-k <53343355+vladi-k@users.noreply.github.com>
2026-04-20 09:36:05 +02:00
patchback[bot]
03da9164d1 [PR #11888/5b409fac backport][stable-12] filesystem - migrate LVM.get_fs_size() to use CmdRunner (#11889)
filesystem - migrate LVM.get_fs_size() to use CmdRunner (#11888)

* filesystem - migrate LVM.get_fs_size() to use CmdRunner



* filesystem - add changelog fragment for #11888



---------


(cherry picked from commit 5b409facbe)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 09:35:55 +02:00
patchback[bot]
d99b778fa1 [PR #11887/9f80d89f backport][stable-12] lvol - migrate to CmdRunner (#11890)
lvol - migrate to CmdRunner (#11887)

* lvol - migrate to CmdRunner



* lvol - add changelog fragment for #11887



* adjust the changelog fragment

---------


(cherry picked from commit 9f80d89fc3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:35:47 +02:00
patchback[bot]
fa179e6d0c [PR #11694/180da98a backport][stable-12] ipa_dnsrecord: add exclusive parameter for append-without-replace semantics (#11885)
ipa_dnsrecord: add `exclusive` parameter for append-without-replace semantics (#11694)

* ipa_dnsrecord: add solo parameter for append-without-replace semantics

Fixes #682

Adds O(solo) boolean parameter (default true, preserving current
replace behaviour) consistent with other DNS modules such as
community.general.dnsimple. When solo=false, only values not
already present in IPA are added, leaving existing values untouched.



* ipa_dnsrecord: rename solo parameter to exclusive

Rename O(solo) to O(exclusive) following reviewer feedback.
'exclusive' is the established Ansible convention for this semantic
(e.g. community.general.ini_file), while 'solo' implies single-value
DNS records.



* ipa_dnsrecord: fix changelog fragment symbol markup

Use double backticks per RST convention in changelog fragments,
not the O() macro (which is for module docstrings).



* Update plugins/modules/ipa_dnsrecord.py



* ipa_dnsrecord: implement exclusive semantics for state=absent

- exclusive=true + state=absent: remove all existing values of that
  record type and name, ignoring the specified record_value(s)
- exclusive=false + state=absent: remove only the specified values
  that actually exist in IPA, preserving all others

Also updates the exclusive parameter documentation to cover both
state=present and state=absent behaviour.



---------



(cherry picked from commit 180da98a7c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-19 23:07:11 +02:00
patchback[bot]
dc79f4a170 [PR #11860/25b21183 backport][stable-12] udm_user, homectl - replace crypt/legacycrypt with passlib (#11884)
udm_user, homectl - replace crypt/legacycrypt with passlib (#11860)

* udm_user - replace crypt/legacycrypt with passlib

The stdlib crypt module was removed in Python 3.13. Replace the
crypt/legacycrypt import chain with passlib (already used elsewhere
in the collection) and use CryptContext.verify() for password
comparison.

Fixes #4690



* Add changelog fragment for PR 11860



* remove redundant ignore file entries

* udm_user, homectl - replace crypt/legacycrypt with _crypt module utils

Add a new _crypt module_utils that abstracts password hashing and
verification. It uses passlib when available, falling back to the
stdlib crypt or legacycrypt, and raises ImportError if none of them
can be imported. Both udm_user and homectl now use this shared
utility, fixing compatibility with Python 3.13+.

Fixes #4690



* Add BOTMETA entry for _crypt module utils



* _crypt - fix mypy errors and handle complete unavailability

Replace CryptContext = object fallback (rejected by mypy) with a
proper dummy class definition. Add has_crypt_context flag so modules
can detect when no backend is available. Update both modules to
import and check has_crypt_context instead of testing for None.



* adjsutments from review

* Update plugins/modules/homectl.py



* Update plugins/modules/udm_user.py



---------



(cherry picked from commit 25b21183bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-19 22:51:20 +02:00
patchback[bot]
748882dfa8 [PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881)
Replace .format() calls with f-strings across multiple plugins (#11879)

* Replace .format() calls with f-strings across multiple plugins



* Add changelog fragment for PR 11879



---------


(cherry picked from commit 77509be2aa)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 12:49:29 +02:00
patchback[bot]
6458abb9c1 [PR #11838/d0d213a4 backport][stable-12] homebrew_cask: fix false failure on upgrade of latest-versioned casks (#11880)
homebrew_cask: fix false failure on upgrade of latest-versioned casks (#11838)

* homebrew_cask: fix false failure on upgrade of latest-versioned casks

Use rc == 0 to determine upgrade success, consistent with _upgrade_all().
The previous check (_current_cask_is_installed() and not _current_cask_is_outdated())
was unreliable: for `latest`-versioned casks under --greedy, brew may still
list the cask as outdated after a successful upgrade, causing the task to fail
with a harmless warning from stderr as the error message.

Fixes #1647



* homebrew_cask: add changelog fragment for #11838



* Fix changelog fragment

---------


(cherry picked from commit d0d213a41d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:49:23 +02:00
patchback[bot]
09201bf49e [PR #11878/1b0b8d5c backport][stable-12] gitlab_project_variable - use find_project() for graceful error handling (#11882)
gitlab_project_variable - use find_project() for graceful error handling (#11878)

* gitlab_project_variable - use find_project() for consistent error handling

Replace the bare projects.get() call in GitlabProjectVariables.get_project()
with find_project() from module_utils/gitlab, which all other GitLab modules
already use. This ensures a graceful fail_json (with a clear error message)
when the project is not found, rather than an unhandled GitlabGetError
propagating as a module traceback.



* Add changelog fragment for PR 11878



* minor adjustment in f-string

---------


(cherry picked from commit 1b0b8d5cc1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 12:49:16 +02:00
patchback[bot]
973b5be063 [PR #11824/39f4cda6 backport][stable-12] locale_gen: support locales not yet listed in /etc/locale.gen (#11883)
locale_gen: support locales not yet listed in /etc/locale.gen (#11824)

* locale_gen: support locales not yet listed in /etc/locale.gen

On systems like Gentoo where /etc/locale.gen starts with only a handful
of commented examples, set_locale_glibc() now appends missing locale
entries sourced from /usr/share/i18n/SUPPORTED instead of silently
doing nothing. Also extracts the shared locale-entry regex into a
module-level constant RE_LOCALE_ENTRY.



* locale_gen: add changelog fragment for issue 2399



---------


(cherry picked from commit 39f4cda6b5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:49:10 +02:00
patchback[bot]
449a179d8f [PR #11750/6c809dd9 backport][stable-12] pacemaker: fix race condition on resource creation (#11877)
pacemaker: fix race condition on resource creation (#11750)

* remove pacemaker wait arg and fix race condition

* fix up pacemaker resource and stonith polling

* add changelog for pacemaker timeout bug

* remove env from test case and fix changelog file name

* Update changelogs/fragments/11750-pacemaker-wait-race-condition.yml



---------


(cherry picked from commit 6c809dd9db)

Co-authored-by: munchtoast <45038532+munchtoast@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-18 22:55:56 +02:00
patchback[bot]
27ca6be10a [PR #11813/edf8f249 backport][stable-12] parted: add unit_preserve_case option to fix unit case in return value (#11875)
parted: add unit_preserve_case option to fix unit case in return value (#11813)

* parted: add unit_preserve_case option to fix unit case in return value

Adds O(unit_preserve_case) feature flag (bool, default None) to control
the case of the ``unit`` field in the module return value.

Previously the unit was always lowercased (e.g. ``kib``), making it
impossible to feed ``disk.unit`` back as the ``unit`` parameter without
a validation error. With O(unit_preserve_case=true) the unit is returned
in its original mixed case (e.g. ``KiB``), matching the accepted input
values.

The default (None) emits a deprecation notice; the default will become
V(true) in community.general 14.0.0.

Fixes #1860



* parted: add changelog fragment for PR #11813



* adjustments from review

* Comment 15.0.0 deprecation in option decription.

* parted: fix unit test calls to parse_partition_info after signature change



* parted: fix unit_preserve_case - parted outputs lowercase units in machine mode

Parted's machine-parseable output always uses lowercase unit suffixes
(e.g. ``kib``, ``mib``) regardless of what was passed to the ``unit``
parameter. Removing the explicit ``.lower()`` call was therefore not
enough to preserve case.

Add a ``canonical_unit()`` helper that maps a unit string to its canonical
mixed-case form using ``parted_units`` as the reference, and use it
instead of a bare identity when ``unit_preserve_case=true``.

Also fix a yamllint violation in the DOCUMENTATION block (missing space
after ``#`` in inline comments).



* Update plugins/modules/parted.py



* Update plugins/modules/parted.py



---------



(cherry picked from commit edf8f24959)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-18 22:55:45 +02:00
patchback[bot]
3867300eca [PR #11839/afe9de75 backport][stable-12] homebrew_service: remove redundant code (#11876)
homebrew_service: remove redundant code (#11839)

* homebrew_service: remove redundant code

* homebrew_services: add changelog fragment for #11839



---------


(cherry picked from commit afe9de7562)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 22:55:25 +02:00
patchback[bot]
ae05131a54 [PR #11702/314863e3 backport][stable-12] xenserver_guest: changed cdrom handling for userdevice != 3, fixes #11624 (#11872)
xenserver_guest: changed cdrom handling for userdevice != 3, fixes #11624 (#11702)

* xenserver_guest: changed cdrom handling for userdevice != 3, fixes #11624

  - CD-ROM handling code has been moved before disk handling code. This more
    closely mimics XenCenter/XCP-ng Center behavior. CD-ROM device, if added,
    will now grab position 3 before any disk grabs it.
  - Position 3 is now skipped when adding disks to leave it reserved for
    CD-ROM device. If any disk ends up occupying position 3 and CD-ROM
    device ends up pushed to position above 3, booting from ISO is not
    possible (#11624).

* Added changelog fragment for #11702

* Added missing issue and PR URLs to changelog fragment for #11702

* Fixed changelog fragment for #11702

(cherry picked from commit 314863e3a7)

Co-authored-by: Bojan Vitnik <bvitnik@yahoo.com>
2026-04-17 18:55:33 +02:00
patchback[bot]
f67003cf3a [PR #11835/3416efa5 backport][stable-12] lvg - migrate to CmdRunner (#11858)
lvg - migrate to CmdRunner (#11835)


(cherry picked from commit 3416efa5bf)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:33:10 +02:00
patchback[bot]
2bd64a891c [PR #11817/175808d9 backport][stable-12] consul_kv: add ca_path option for custom CA certificate (#11852)
consul_kv: add ca_path option for custom CA certificate (#11817)

* consul_kv: add ca_path option for custom CA certificate

Adds ca_path parameter to both the consul_kv module and consul_kv lookup
plugin, allowing users to specify a CA bundle for HTTPS connections instead
of being limited to toggling certificate validation on/off.



* consul_kv: add changelog fragment for PR #11817



* consul_kv: address review comments from felixfontein

- Fix verify logic: ca_path is ignored when validate_certs=false
- Improve validate_certs description to nudge users toward ca_path



---------


(cherry picked from commit 175808d997)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:33:02 +02:00
patchback[bot]
6e226f4588 [PR #11812/e2a7dc46 backport][stable-12] sefcontext: flush in-process matchpathcon cache (#11854)
sefcontext: flush in-process matchpathcon cache (#11812)

* fix sefcontext: flush in-process matchpathcon cache after changes

Fixes https://github.com/ansible-collections/community.general/issues/888



* update changelog fragment with PR number and URL



---------


(cherry picked from commit e2a7dc467d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:32:53 +02:00
patchback[bot]
d82bf01128 [PR #11849/74c096b0 backport][stable-12] homebrew_cask: handle placeholder version from brew --version (#11855)
homebrew_cask: handle placeholder version from brew --version (#11849)

* homebrew_cask: handle placeholder version from brew --version

When brew is run as the wrong user, git repositories may be owned by
a different user, causing brew --version to output a placeholder like
"Homebrew >= 4.3.0 (shallow or no git repository)" instead of the real
version. The parsed version would then be lower than the 2.6.0 threshold,
causing _brew_cask_command_is_deprecated() to return False and the module
to use the disabled "brew cask" command syntax.

Detect the ">=" prefix in the parsed version and treat it as a modern
installation.

Fixes #4708



* homebrew_cask: add changelog fragment for #11849



---------


(cherry picked from commit 74c096b00c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:32:45 +02:00
patchback[bot]
2873d439c3 [PR #11764/e9110811 backport][stable-12] logrotate: fix parameter and config file validation and more (#11856)
logrotate: fix parameter and config file validation and more (#11764)

* fix(logrotate): add missing defaults and parameter validation declarations

- Add default="present" to state parameter
- Add default="/etc/logrotate.d" to config_dir parameter
- Add required_by declarations for shred and compression parameters

* fix(logrotate): fix runtime validation bugs, remove duplicate checks

- Fix shred_cycles TypeError when value is None
- Fix enabled=None handling in get_config_path
- Remove duplicate runtime mutually_exclusive checks
- Add runtime boolean truthiness checks
- Add 'create' parameter format validation
- Remove stale test method

* fix(logrotate): restructure file operations, validate before write

- Write content to tmpdir temp file, validate, then atomic move to destination.
- Wrap all os.remove() calls in try/except with fail_json on error
- Wrap all module.atomic_move() calls in try/except with fail_json on error
- Also add self.mock_module.tmpdir = self.test_dir to test setUp for new code path

* docs(logrotate): update DOCUMENTATION block

- Add 'default: present' to state option
- Add 'default: /etc/logrotate.d' to config_dir option

* feat(logrotate): add optional backup parameter

* chore: add logrotate fixes changelog fragment

* chore(changelog/logrotate): use present tense singular

* fix(logrotate): handle trailing spaces in create param



* refactor(logrotate): remove redundant checks

These are already handled by `required_if` statements in the module spec

* refactor(logrotate): use tempfile to create temporary file

* refactor(logrotate): remove redundant `bool()` casts on `target_enabled`

`target_enabled` is guaranteed to be bool by this point. It's either the module param (typed bool) or falls back to `current_enabled` (also bool). The `bool()` wraps are no-ops.

* refactor(logrotate): remove unused `self.config_file` attribute

* refactor(logrotate): remove dead `any_state` parameter from `read_existing_config`

* fix(logrotate): raise error instead of falling through on enabled-state rename failures

* refactor(logrotate): tighten `get_config_path` sig to bool

`None` callers are removed now so this is safe

* test(logrotate): remove stale open mock assertion after tempfile refactor

* style(logrotate): format file

* chore(logrotate): add missing `version_added` attribute



* fix(logrotate): clean up temp file



* fix(logrotate): remove redundant temp file cleanup



* refactor(logrotate): Use dict subscript to access required backup param



* fix(logrotate): fix: only remove old config file when path differs from target



* fix(logrotate): update logrotate_bin type hint to str

* feat(logrotate): add backup file handling when removing old config

* style(logrotate): format file

* test(logrotate): add missing backup default to `_setup_module_params`

* test(logrotate): fix incorrect `os.remove` assertion in update test

* refactor(logrotate): remove unnecessary `to_native()` call



* refactor(logrotate): replace str quotes with !r



* fix(logrotate): change backup default back to true

* fix(logrotate): raise error when `shred_cycle`s is set with `shred=false`

* docs(logrotate): clarify `shred_cycles` behaviour

* fix(logrotate): remove to_native calls for exception messages

* docs(logrotate): improve `config_dir` param description

* refactor(logrotate): simplify backup file assignment logic

* style(logrotate): format file

* docs(logrotate): improve config_map description

---------



(cherry picked from commit e911081102)

Co-authored-by: tigattack <10629864+tigattack@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-17 18:32:36 +02:00
patchback[bot]
956fc075ef [PR #11837/87ecfa34 backport][stable-12] iso_extract: retry umount on busy filesystem before cleanup (#11857)
iso_extract: retry umount on busy filesystem before cleanup (#11837)

* iso_extract: retry umount on busy filesystem before cleanup

Fixes #5333



* iso_extract: add changelog fragment for #11837



* make chglog more concise

---------


(cherry picked from commit 87ecfa3432)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:32:27 +02:00
patchback[bot]
7b82e694a2 [PR #11859/dad84dd3 backport][stable-12] udm_user - fix alias-to-canonical param name mismatch (#11863)
udm_user - fix alias-to-canonical param name mismatch (#11859)

* udm_user - fix alias-to-canonical param name mismatch

The loop that maps UDM object properties to module params iterated
over UDM keys (camelCase, e.g. displayName, primaryGroup) and looked
them up directly in module.params, which is keyed by canonical names
(snake_case, e.g. display_name, primary_group). This caused all
aliased params to be silently ignored.

Build an alias-to-canonical mapping from argument_spec and use it
to resolve UDM keys to the correct module.params entries.

Also fix the direct module.params["displayName"] access which raised
KeyError when the user did not explicitly use the alias form.

Fixes #2950
Fixes #3691



* Add changelog fragment for PR 11859



---------


(cherry picked from commit dad84dd36d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 18:32:17 +02:00
patchback[bot]
119623952d [PR #11848/c4ed3467 backport][stable-12] homebrew_tap: fix None in command, redundant brew tap calls, format strings, and drop no-op locale vars (#11865)
homebrew_tap: fix None in command, redundant brew tap calls, format strings, and drop no-op locale vars (#11848)

* homebrew_tap: fix None in command list, redundant brew tap calls, and bad format strings

- Fix None being injected into the run_command list when url is not
  provided to add_tap (filter with [opt for opt in [...] if opt])
- Reduce redundant `brew tap` calls: add_taps and remove_taps now
  fetch the tap list once upfront and pass it to the per-tap functions;
  already_tapped accepts an optional pre-fetched list to avoid re-running
  brew for every tap in a batch
- Fix mixed f-string/%-formatting in error messages in add_taps and
  remove_taps, replaced with plain f-strings



* homebrew_tap: simplify command construction in add_tap

Replace the opaque list comprehension filter with an explicit conditional
append — only url is ever optional, so testing the known-present items
was misleading.



* homebrew_tap: remove unnecessary locale env vars

Homebrew has no i18n/l10n support — all output is hardcoded English.
LANGUAGE=C and LC_ALL=C have no effect on brew output.



* homebrew_tap: add changelog fragment for #11848



* remove hombrew_tap from PR #11783 changelog - change reverted here

---------


(cherry picked from commit c4ed3467b6)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:32:10 +02:00
patchback[bot]
644d362228 [PR #11851/1db3d4f4 backport][stable-12] gitlab_project_members: fail when multiple projects match by name (#11864)
gitlab_project_members: fail when multiple projects match by name (#11851)

* gitlab_project_members: fail when multiple projects match by name

When the project parameter is a bare name (not a full path), and the
search returns more than one match, the module now fails with a clear
error asking the user to provide the full path (group/project) to
disambiguate, instead of silently operating on the first result.

Fixes #2767



* gitlab_project_members: improve code formatting



* gitlab_project_members: add changelog fragment for #11851



---------


(cherry picked from commit 1db3d4f441)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 18:32:02 +02:00
patchback[bot]
8def5bf46e [PR #11850/f8869af6 backport][stable-12] homebrew_cask: fix sudo_password failing with special characters (#11867)
homebrew_cask: fix sudo_password failing with special characters (#11850)

* homebrew_cask: fix sudo_password with special characters in password

The SUDO_ASKPASS script embedded the password inside single quotes, which
breaks shell parsing whenever the password contains a single quote. Use a
quoted heredoc (cat <<'SUDO_PASS') instead, which treats the content
completely literally regardless of special characters.

Also replace .file.close() with .flush() (correct semantics — flushes
the write buffer without leaving the NamedTemporaryFile in a half-closed
state) and remove the redundant add_cleanup_file() call (the context
manager already deletes the file on exit).

Fixes #4957



* homebrew_cask: add changelog fragment for #11850



* homebrew_cask: fix sudo_password example and clarify ansible_become_password



* homebrew_cask: use shlex.quote() for sudo_password instead of heredoc

shlex.quote() is the standard Python approach for shell-safe quoting
and handles all special characters without the edge cases of heredocs.



---------


(cherry picked from commit f8869af65f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 18:31:52 +02:00
patchback[bot]
057fd16cc0 [PR #11861/076bc4e0 backport][stable-12] etcd3 lookup - improve HTTPS connection handling and docs (#11871)
etcd3 lookup - improve HTTPS connection handling and docs (#11861)

* etcd3 lookup - improve HTTPS connection handling and documentation

Improve user experience when connecting to HTTPS etcd3 endpoints:
- Strip URL scheme from host option when present, with a warning
- Warn when HTTPS endpoint is specified but ca_cert is not provided
- Document that ca_cert is required to enable TLS
- Add HTTPS connection example
- Fix minor doc markup issue in notes section

Fixes #1664



* Add changelog fragment for PR 11861



---------


(cherry picked from commit 076bc4e03b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 18:31:39 +02:00
patchback[bot]
3a56f19656 [PR #11862/342a76d5 backport][stable-12] Remove unstable CI target (#11870)
Remove unstable CI target (#11862)

Remove unstable CI target.

(cherry picked from commit 342a76d5dd)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-17 18:31:21 +02:00
patchback[bot]
729eb996e8 [PR #11836/ef656cb9 backport][stable-12] CI: Replace Fedora 43 with 44 for devel (#11846)
CI: Replace Fedora 43 with 44 for devel (#11836)

* Replace Fedora 43 with 44 for devel in CI.

* Adjust tests.

* Adjust flatpak module to Fedora 44.

(cherry picked from commit ef656cb9b6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-16 22:00:37 +02:00
patchback[bot]
3e721f9572 [PR #11842/7884a3f2 backport][stable-12] CI: Temporarily skip failing callback unit tests for ansible-core 2.21+ (#11844)
CI: Temporarily skip failing callback unit tests for ansible-core 2.21+ (#11842)

Temporarily skip failing unit tests.

(cherry picked from commit 7884a3f2a2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-16 21:39:55 +02:00
patchback[bot]
4d30704615 [PR #11826/7dcd3c1c backport][stable-12] lxd_container: document that config values must be strings (#11829)
lxd_container: document that config values must be strings (#11826)

Fixes #8307


(cherry picked from commit 7dcd3c1c45)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 22:01:36 +02:00
patchback[bot]
308a5d7e06 [PR #11823/71723268 backport][stable-12] lvol: fix LVM version regex to handle date formats without dashes (#11831)
lvol: fix LVM version regex to handle date formats without dashes (#11823)

* lvol: fix LVM version regex to handle date formats without dashes

Fixes #5445



* lvol: add changelog fragment for issue 5445



---------


(cherry picked from commit 7172326868)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 22:01:28 +02:00
patchback[bot]
f78a44c6a3 [PR #11825/d1448b76 backport][stable-12] iso_extract: strip leading path separator from file entries (#11832)
iso_extract: strip leading path separator from file entries (#11825)

* iso_extract: strip leading path separator from file entries

Fixes #5283



* iso_extract: add changelog fragment for issue 5283



---------


(cherry picked from commit d1448b76c1)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 22:01:19 +02:00
patchback[bot]
1b4e58bbbf [PR #11811/ff5c34c4 backport][stable-12] lvm_pv - use CmdRunner (#11833)
lvm_pv - use CmdRunner (#11811)

* lvm_pv - migrate to CmdRunner using shared runners from module_utils/_lvm



* lvm_pv - add changelog fragment for #11811



* Update changelogs/fragments/11811-lvm_pv-use-cmdrunner.yml



---------



(cherry picked from commit ff5c34c4a7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-15 22:01:11 +02:00
patchback[bot]
705ffc564d [PR #11771/df252e5f backport][stable-12] incus, machinectl, run0 - fix become over pty connections (#11827)
incus, machinectl, run0 - fix become over pty connections (#11771)

* incus, machinectl, run0 - fix become over pty connections

Four small fixes across three plugins, all discovered while trying to
use community.general.machinectl (and later community.general.run0)
as become methods over the community.general.incus connection.

Core bug: machinectl and run0 both set require_tty = True, but the
incus connection plugin was ignoring that hint and invoking
'incus exec' without -t. Honor require_tty by passing -t, mirroring
what the OpenSSH plugin does with -tt.

Once the pty is in place, both become plugins emit terminal control
sequences (window-title OSC, ANSI reset) around the child command
that land in captured stdout alongside the module JSON and trip the
result parser with "Module invocation had junk after the JSON data".
Suppress that decoration at the source by prefixing the constructed
shell command with SYSTEMD_COLORS=0. TERM=dumb would work too but
has a wider blast radius (it also affects interactive tools inside
the become-user session); SYSTEMD_COLORS is the documented
systemd-scoped knob.

run0 was also missing pipelining = False. When run0 is used over a
connection that honors require_tty, ansible's pipelining sends the
module source on stdin to remote python3, which cannot be forwarded
cleanly through the pty chain and hangs indefinitely. Disable
pipelining the same way community.general.machinectl already does.

Also add tests/unit/plugins/become/test_machinectl.py mirroring the
existing test_run0.py. machinectl had no unit test coverage before,
which is why CI did not catch the SYSTEMD_COLORS=0 prefix change
when the equivalent run0 change broke test_run0_basic/test_run0_flags.



* Update changelogs/fragments/11771-incus-machinectl-run0-become-pty.yml



---------



(cherry picked from commit df252e5fab)

Co-authored-by: Martin Schürrer <martin@schuerrer.org>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-15 22:01:06 +02:00
patchback[bot]
86dc3c8816 [PR #11815/78d004d9 backport][stable-12] lvg: clarify desired-state semantics of pvs parameter in docs (#11821)
lvg: clarify desired-state semantics of pvs parameter in docs (#11815)

lvg: doc adjustment
(cherry picked from commit 78d004d96e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-14 22:03:13 +02:00
patchback[bot]
1b1746896d [PR #11772/24ca7965 backport][stable-12] dconf: add dbus-broker support by improving D-Bus session discovery (#11820)
dconf: add dbus-broker support by improving D-Bus session discovery (#11772)

* dconf: add dbus-broker support by improving D-Bus session discovery

Extend DBusWrapper._get_existing_dbus_session() to check:
1. DBUS_SESSION_BUS_ADDRESS in the current process environment
2. /run/user/<uid>/bus (canonical socket for systemd and dbus-broker)
3. Process scan (legacy fallback, as before)

Also add _validate_address() to support both dbus-send and busctl,
making the module work on systems using dbus-broker (e.g. Fedora Silverblue)
where no process exposes DBUS_SESSION_BUS_ADDRESS in its environment.

Fixes: https://github.com/ansible-collections/community.general/issues/495



* dconf: add changelog fragment for dbus-broker support



* dconf: restore dbus validator requirement and example usage

Restore fail_json when neither dbus-send nor busctl is available,
preserving the original hard requirement for a validator binary.
Restore the example invocation in DBusWrapper docstring.



---------


(cherry picked from commit 24ca79658a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 22:02:54 +02:00
patchback[bot]
32c4bbea30 [PR #11748/972bed66 backport][stable-12] flatpak: add from_url parameter, deprecate URLs in name (#11814)
flatpak: add from_url parameter, deprecate URLs in name (#11748)

* flatpak: add from_url parameter, deprecate URLs in name

Adds a new `from_url` parameter for installing flatpaks from a
.flatpakref URL, using `flatpak install --from <url>`. The `name`
parameter then carries the reverse DNS application ID, enabling
reliable idempotency checks.

Passing URLs directly in `name` is now deprecated and will be
removed in community.general 14.0.0.

Fixes #4000



* flatpak: add changelog fragment for PR #11748



* flatpak: remove deprecation, adjust docs tone



* flatpak: add integration tests for from_url parameter



---------


(cherry picked from commit 972bed66f4)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 21:30:31 +02:00
patchback[bot]
e278490fe7 [PR #11746/61060532 backport][stable-12] feat: use CmdRunner for LVM commands (#11794)
feat: use CmdRunner for LVM commands (#11746)

* feat: use CmdRunner for LVM commands

* Update plugins/module_utils/lvm.py



* rename module util to _lvm

---------


(cherry picked from commit 61060532f9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-12 22:29:22 +02:00
patchback[bot]
d01187d03b [PR #11768/b40608a3 backport][stable-12] Ensure standard locale in run_command (group5-batch1) (#11795)
Ensure standard locale in run_command (group5-batch1) (#11768)

* ensure standard locale in run_command (group5-batch1)

Adds ``LANGUAGE=C`` and ``LC_ALL=C`` to ``run_command()`` calls in modules
that parse command output, to prevent locale-dependent parsing failures on
non-C-locale systems.

Modules updated: apache2_module, composer, facter_facts, known_hosts module
utils, lvg_rename, macports, modprobe, monit, open_iscsi, pacman_key,
rhsm_release, rpm_ostree_pkg, sysupgrade.



* add changelog fragment for group5-batch1



* Remove lvg_rename from locale fix — superseded by PR #11746

PR #11746 (feat: use CmdRunner for LVM commands) takes priority and
will handle lvg_rename.py via CmdRunner refactor. Removing our
run_command_environ_update change to avoid conflict.



---------


(cherry picked from commit b40608a39d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:29:14 +02:00
patchback[bot]
3ef5b36066 [PR #11773/8fbb43e6 backport][stable-12] Ensure standard locale in run_command (group5-batch2) (#11806)
Ensure standard locale in run_command (group5-batch2) (#11773)

* ensure standard locale in run_command (group5-batch2)

Adds ``LANGUAGE=C`` and ``LC_ALL=C`` to ``run_command()`` calls in modules
that parse command output, to prevent locale-dependent parsing failures on
non-C-locale systems.

Modules updated: cronvar, dnf_versionlock, dpkg_divert, flatpak_remote, hg.



* add changelog fragment for group5-batch2



---------


(cherry picked from commit 8fbb43e660)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:29:04 +02:00
patchback[bot]
150f63b36b [PR #11779/d6909578 backport][stable-12] Ensure standard locale in run_command (group5-batch8) (#11804)
Ensure standard locale in run_command (group5-batch8) (#11779)

* Fix locale env vars in run_command() calls for group5 batch8 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in lxc_container, ip_netns,
and capabilities.



* Add changelog fragment for PR #11779



---------


(cherry picked from commit d6909578b9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:52 +02:00
patchback[bot]
582807ea3a [PR #11780/5c6a5999 backport][stable-12] Ensure standard locale in run_command (group5-batch9) (#11803)
Ensure standard locale in run_command (group5-batch9) (#11780)

* Fix locale env vars in run_command() calls for group5 batch9 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in beadm, pkg5, pkg5_publisher,
and swdepot.



* Add changelog fragment for PR #11780



---------


(cherry picked from commit 5c6a599940)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:44 +02:00
patchback[bot]
bdcd10ca2c [PR #11781/5f0a9bba backport][stable-12] Ensure standard locale in run_command (group5-batch10) (#11802)
Ensure standard locale in run_command (group5-batch10) (#11781)

* Fix locale env vars in run_command() calls for group5 batch10 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in imgadm, smartos_image_info,
syspatch, portage, portinstall, xbps, and lbu.



* Add changelog fragment for PR #11781



---------


(cherry picked from commit 5f0a9bba01)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:35 +02:00
patchback[bot]
42e88c56b6 [PR #11782/fe9e7284 backport][stable-12] Ensure standard locale in run_command (group5-batch11) (#11801)
Ensure standard locale in run_command (group5-batch11) (#11782)

* Fix locale env vars in run_command() calls for group5 batch11 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in apt_repo, easy_install, pear,
and zypper_repository_info.



* Add changelog fragment for PR #11782



---------


(cherry picked from commit fe9e728401)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:26 +02:00
patchback[bot]
d858cfa8a8 [PR #11783/9cadc947 backport][stable-12] Ensure standard locale in run_command (group5-batch12) (#11800)
Ensure standard locale in run_command (group5-batch12) (#11783)

* Fix locale env vars in run_command() calls for group5 batch12 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in bower, bundler, homebrew_tap,
and kibana_plugin.



* Add changelog fragment for PR #11783



---------


(cherry picked from commit 9cadc94793)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:19 +02:00
patchback[bot]
15d5670065 [PR #11784/3f7ae199 backport][stable-12] Ensure standard locale in run_command (group5-batch13) (#11799)
Ensure standard locale in run_command (group5-batch13) (#11784)

* Fix locale env vars in run_command() calls for group5 batch13 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in awall, openwrt_init, and
pip_package_info.



* Add changelog fragment for PR #11784



---------


(cherry picked from commit 3f7ae1999e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:12 +02:00
patchback[bot]
e5f55149c6 [PR #11785/269a5ed8 backport][stable-12] Ensure standard locale in run_command (group5-batch14) (#11797)
Ensure standard locale in run_command (group5-batch14) (#11785)

* Fix locale env vars in run_command() calls for group5 batch14 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in bzr, lldp, and ohai.



* Add changelog fragment for PR #11785



---------


(cherry picked from commit 269a5ed85e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:28:00 +02:00
patchback[bot]
50d22c9f70 [PR #11786/37653bc7 backport][stable-12] Ensure standard locale in run_command (group5-batch15) (#11796)
Ensure standard locale in run_command (group5-batch15) (#11786)

* Fix locale env vars in run_command() calls for group5 batch15 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in keyring_info, onepassword_info,
and riak.



* Add changelog fragment for PR #11786



---------


(cherry picked from commit 37653bc7f9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:47 +02:00
patchback[bot]
671ce86565 [PR #11787/95e2b771 backport][stable-12] Ensure standard locale in run_command (group5-batch16) (#11798)
Ensure standard locale in run_command (group5-batch16) (#11787)

* Fix locale env vars in run_command() calls for group5 batch16 (btrfs module_utils)



* Add changelog fragment for PR #11787



---------


(cherry picked from commit 95e2b7716a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:35 +02:00
patchback[bot]
0fc99ae2d8 [PR #11774/6d5644ac backport][stable-12] Ensure standard locale in run_command (group5-batch3) (#11807)
Ensure standard locale in run_command (group5-batch3) (#11774)

* Fix locale env vars in run_command() calls for group5 batch3 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in homectl, java_cert, keyring,
launchd, and listen_ports_facts.



* Add changelog fragment for PR #11774



---------


(cherry picked from commit 6d5644ac34)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:28 +02:00
patchback[bot]
dfa9f77b7a [PR #11775/7c52f1c4 backport][stable-12] Ensure standard locale in run_command (group5-batch4) (#11808)
Ensure standard locale in run_command (group5-batch4) (#11775)

* Fix locale env vars in run_command() calls for group5 batch4 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in logstash_plugin, lvg, mas,
osx_defaults, and pkgutil.



* Add changelog fragment for PR #11775



---------


(cherry picked from commit 7c52f1c41d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:16 +02:00
patchback[bot]
cfa712f30e [PR #11776/e45e6cbb backport][stable-12] Ensure standard locale in run_command (group5-batch5) (#11809)
Ensure standard locale in run_command (group5-batch5) (#11776)

* Fix locale env vars in run_command() calls for group5 batch5 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in pnpm, sysrc, timezone, xattr,
and yarn.



* Add changelog fragment for PR #11776



---------


(cherry picked from commit e45e6cbb5d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:07 +02:00
patchback[bot]
c65a675a52 [PR #11777/a9d6bb2a backport][stable-12] Ensure standard locale in run_command (group5-batch6) (#11810)
Ensure standard locale in run_command (group5-batch6) (#11777)

* Fix locale env vars in run_command() calls for group5 batch6 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in yum_versionlock and zypper_repository.



* Add changelog fragment for PR #11777



---------


(cherry picked from commit a9d6bb2a15)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:27:00 +02:00
patchback[bot]
e757ff30b3 [PR #11778/42a1998b backport][stable-12] Ensure standard locale in run_command (group5-batch7) (#11805)
Ensure standard locale in run_command (group5-batch7) (#11778)

* Fix locale env vars in run_command() calls for group5 batch7 modules

Set LANGUAGE=C and LC_ALL=C via run_command_environ_update to ensure
locale-independent output parsing in zfs, zfs_delegate_admin,
zfs_facts, and zpool_facts.



* Add changelog fragment for PR #11778



---------


(cherry picked from commit 42a1998bde)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 22:26:47 +02:00
patchback[bot]
d74e553f4b [PR #11767/f4f2bfe8 backport][stable-12] openbsd_pkg, sorcery: ensure standard locale in run_command (group4-batch2) (#11793)
openbsd_pkg, sorcery: ensure standard locale in run_command (group4-batch2) (#11767)

* ensure standard locale in run_command (group4-batch2)

Adds ``LANGUAGE=C`` and ``LC_ALL=C`` to the ``environ_update`` passed to
``run_command()`` calls in modules that parse command output, to prevent
locale-dependent parsing failures on non-C-locale systems.

Modules updated: openbsd_pkg, sorcery.



* add changelog fragment for group4-batch2



* add changelog fragment for group4-batch2



---------


(cherry picked from commit f4f2bfe847)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:43:30 +02:00
patchback[bot]
d5a759b2e3 [PR #11765/2297a5c8 backport][stable-12] Ensure standard locale in run_command (group4-batch1) (#11792)
Ensure standard locale in run_command (group4-batch1) (#11765)

* ensure standard locale in run_command (group4)

Adds ``LANGUAGE=C`` and ``LC_ALL=C`` to the ``environ_update`` passed to
``run_command()`` calls in modules that parse command output, to prevent
locale-dependent parsing failures on non-C-locale systems.

Modules updated: dconf, pkgng, terraform.



* add changelog fragment for group4



* add PR link to group4 changelog fragment



* fix changelog fragment: rename with PR prefix, fix URL order



---------


(cherry picked from commit 2297a5c876)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:38:43 +02:00
patchback[bot]
c8f2219fb0 [PR #11733/6f12d930 backport][stable-12] gem: use CmdRunner (#11791)
gem: use `CmdRunner` (#11733)

* gem: use `CmdRunner`

* add changelog frag

* gem: restore get_rubygems_path() helper to preserve executable splitting



---------


(cherry picked from commit 6f12d93057)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 13:38:08 +02:00
patchback[bot]
8fe227d456 [PR #11487/5eaa22b0 backport][stable-12] ipa_host: fix errors when disabling host (#11789)
ipa_host: fix errors when disabling host (#11487)

* fix errors when disabling host

- Fix the logic to actually allow disabling hosts
- Fix the dict != string error when error does happen
- Add has_keytab to returned dicts to allow users see if host is disabled or not

* Add changelog-fragments

* Run formatters

* More formatting

* Remove feature, only fix the logic

* Update changelogs/fragments/11487-ipa-host-fix-disable.yml



* Update changelogs/fragments/11487-ipa-host-fix-disable.yml



* Back to fstring

* Update plugins/modules/ipa_host.py



* Use more Pythonic way to for if

* Nox

* Revert back to working if

* Simplify if

* Remove extra get

---------




(cherry picked from commit 5eaa22b067)

Co-authored-by: quasd <quasd@users.noreply.github.com>
Co-authored-by: quasd <1747330+quasd@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-12 13:37:56 +02:00
patchback[bot]
59fe80ef94 [PR #11712/bd7b361d backport][stable-12] nsupdate: fix GSS-TSIG support (#11790)
nsupdate: fix GSS-TSIG support (#11712)

The fix for missing keyring initialization without TSIG auth in
PR #11461 put the initialization of "self.keyring" and "self.keyname"
in an else clause after checking if "key_name" is set.

The problem is that for "key_algorithm" == "gss-tsig":
a) "key_name" isn't set
b) self.keyring and self.keyname have already been initialized and
   will be discarded

This means that gss-tsig support is broken. Fix it by moving the
initialization of "self.keyring" and "self.keyname" to the top.

(cherry picked from commit bd7b361db1)

Co-authored-by: David Härdeman <david@hardeman.nu>
2026-04-12 13:37:47 +02:00
patchback[bot]
d9a2fa9bd9 [PR #11753/c7deda2e backport][stable-12] java_cert: support proxy authentication from https_proxy env var (#11761)
java_cert: support proxy authentication from https_proxy env var (#11753)

* java_cert: support proxy authentication from https_proxy env var

When https_proxy is set with credentials (USER:PASSWORD@HOST:PORT),
pass the corresponding JVM proxy auth flags to keytool and clear the
JDK 8u111+ Basic auth tunneling restriction.

Fixes https://github.com/ansible-collections/community.general/issues/4126



* java_cert: add changelog fragment for PR #11753



* java_cert: fix changelog fragment type to minor_changes



---------


(cherry picked from commit c7deda2ec7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 06:35:16 +02:00
Felix Fontein
a046ae812e Prepare 12.6.0. 2026-04-08 20:13:58 +02:00
patchback[bot]
953d70611b [PR #11754/b780224d backport][stable-12] mssql_script: only pass params to cursor.execute() when provided (#11758)
mssql_script: only pass params to cursor.execute() when provided (#11754)

* mssql_script: only pass params to cursor.execute() when provided

Fixes #11699



* mssql_script: add changelog fragment for PR #11754



---------


(cherry picked from commit b780224d6d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 20:06:07 +02:00
patchback[bot]
04367d8b9c [PR #11742/bdd31745 backport][stable-12] nmcli: use get_best_parsable_locale() to support UTF-8 connection names (#11757)
nmcli: use get_best_parsable_locale() to support UTF-8 connection names (#11742)

* nmcli: start locale fix - normalize run_command environ to LANGUAGE=C, LC_ALL=C

Work in progress - issue #10384 (UTF-8 conn_name support) requires deeper
investigation beyond simple locale variable normalization.



* nmcli: use get_best_parsable_locale() to support UTF-8 connection names

Fixes issue where UTF-8 connection names (e.g. Chinese characters) were
corrupted to '????' when LC_ALL=C forced ASCII encoding, causing
connection_exists() to always return False for non-ASCII names.



* add changelog fragment for PR #11742



---------


(cherry picked from commit bdd3174563)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 15:46:30 +02:00
patchback[bot]
e5f9516335 [PR #11741/e59888dd backport][stable-12] Ensure standard locale in run_command (group3-batch3) (#11756)
Ensure standard locale in run_command (group3-batch3) (#11741)

* run_command locale group3 batch3: normalise to LANGUAGE=C, LC_ALL=C



* fix changelog fragment: bugfixes, American English, separate code spans



* fix changelog fragment: correct PR number (11741)



---------


(cherry picked from commit e59888dd7e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 15:34:34 +02:00
patchback[bot]
b4f09831b0 [PR #11740/936ab2ea backport][stable-12] Ensure standard locale in run_command (group3-batch2) (#11755)
Ensure standard locale in run_command (group3-batch2) (#11740)

* run_command locale group3 batch2: normalise to LANGUAGE=C, LC_ALL=C



* fix changelog fragment: bugfixes, American English, separate code spans



* fix changelog fragment: correct PR number (11740)



* remove nmcli from batch2 - moved to dedicated branch



---------


(cherry picked from commit 936ab2ea56)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 15:34:23 +02:00
patchback[bot]
5f5043d4b8 [PR #11743/849a7ee8 backport][stable-12] Add stable-2.21 to CI (#11745)
Add stable-2.21 to CI (#11743)

Add stable-2.21 to CI.

(cherry picked from commit 849a7ee899)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-06 22:13:07 +02:00
patchback[bot]
ea465e21c3 [PR #11738/c90b5046 backport][stable-12] Ensure standard locale in run_command (group3-batch1) (#11739)
Ensure standard locale in run_command (group3-batch1) (#11738)

* ensure standard locale in run_command (group3-batch1)

* add changelog frag

* fix changelog fragment: bugfixes, not minor_changes



* fix changelog fragment: American English, separate code spans per variable



---------


(cherry picked from commit c90b504626)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 10:05:05 +02:00
patchback[bot]
f00f70f849 [PR #11717/b2cd1b55 backport][stable-12] Fix KeyError for 'dnsttl' (#11736)
Fix KeyError for 'dnsttl' (#11717)

* Fix KeyError for 'dnsttl'

I did not further dig into the code. However, since upgrading to the latest version of `community.general`, ansible fails with a weird error message "dnsttl" at a task where `community.general.ipa_dnsrecord` is called. After digging into the code a bit, I found out that it is a KeyError and caused by this line of code. I'm not sure, if it is safe to skip that line and not to set `result["dnsttl"]`.

* Add changelog fragment

* Adopt suggestion for changelogs/fragments/11717-fix-error-dnsttl.yml



---------


(cherry picked from commit b2cd1b555e)

Co-authored-by: sedrubal <sedrubal@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-04 18:44:05 +00:00
patchback[bot]
6020893160 [PR #11729/bdb82c72 backport][stable-12] chore: devcontainer/pre-commit (#11732)
chore: devcontainer/pre-commit (#11729)

(cherry picked from commit bdb82c7248)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-04 11:00:27 +02:00
patchback[bot]
1eecf281bc [PR #11728/2acb20be backport][stable-12] opendj_backendprop: use CmdRunner (#11731)
opendj_backendprop: use CmdRunner (#11728)

* opendj_backendprop: use CmdRunner

* add changelog frag

(cherry picked from commit 2acb20bec2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-03 15:21:16 +02:00
patchback[bot]
fa9ac2b3a9 [PR #11719/66886d08 backport][stable-12] integration tests: remove CentOS conditionals - part 2 (#11730)
integration tests: remove CentOS conditionals - part 2 (#11719)

* test(integration): remove CentOS references - part 2

* adjustments from review

(cherry picked from commit 66886d08f5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-03 12:34:15 +00:00
patchback[bot]
f77d731faf [PR #11715/79431c36 backport][stable-12] integration tests: remove CentOS conditionals (#11726)
integration tests: remove CentOS conditionals (#11715)

* test(integration): remove CentOS references

* further simplification

* more removals

* rollback systemd_info for now

* ufw: not trivially used with RHEL9 and RHEL10, simplifying tests

* remove tasks for setup_epel where unused

* adjustments from review

(cherry picked from commit 79431c36b5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-03 10:41:10 +02:00
patchback[bot]
56bcb0c32b [PR #11697/8b114e99 backport][stable-12] consul integration tests: re-enable on macOS (#11727)
consul integration tests: re-enable on macOS (#11697)

* consul integration tests: re-enable on macOS

- Update consul version to 1.22.6
- Add arm64/aarch64 architecture support
- Fix macOS Gatekeeper quarantine on downloaded binary
- Add wait_for before ACL bootstrap (race condition fix)
- Update HCL config to use tls stanza (required in 1.22)
- Disable gRPC port (conflicts with tls stanza when not configured)
- Remove skip/macos from aliases

Fixes: https://github.com/ansible-collections/community.general/issues/1016



* changelogs/fragments: add PR number for consul tests fix



* remove changelog fragment (test-only PR)



---------


(cherry picked from commit 8b114e999e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 08:03:09 +02:00
patchback[bot]
83aa142331 [PR #11682/b79a4575 backport][stable-12] snap_connect: new module to manage snap interface connections (#11722)
snap_connect: new module to manage snap interface connections (#11682)

* snap_connect: new module to manage snap interface connections

Fixes #7722



* simplify _get_connections()

---------


(cherry picked from commit b79a45753f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 07:35:13 +02:00
patchback[bot]
cac85a5480 [PR #11720/982f9472 backport][stable-12] test(integration): fix for ansible-core devel changes in register (#11724)
test(integration): fix for ansible-core devel changes in register (#11720)

(cherry picked from commit 982f9472c5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-03 07:35:02 +02:00
patchback[bot]
3bca7e1ad4 [PR #11721/08442186 backport][stable-12] xenserver_guest: fix code style caught by codeqa (#11725)
xenserver_guest: fix code style caught by codeqa (#11721)

* xenserver_guest: fix code style caught by codeqa

* add changelog frag

(cherry picked from commit 08442186e6)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-03 07:34:32 +02:00
patchback[bot]
b41916285e [PR #11701/d956fb81 backport][stable-12] jira - add cloud option to support Jira Cloud search endpoint (#11716)
jira - add cloud option to support Jira Cloud search endpoint (#11701)

* jira - add cloud option to support Jira Cloud search endpoint

Jira Cloud has removed the legacy GET /rest/api/2/search endpoint
(see https://developer.atlassian.com/changelog/#CHANGE-2046).

Add a new boolean `cloud` option (default false). When set to true,
the search operation uses the replacement /rest/api/2/search/jql
endpoint. The default remains false to preserve backward compatibility
for Jira Data Center / Server users.

Fixes: https://github.com/ansible-collections/community.general/issues/10786

Assisted-by AI: Claude 4.6 Opus (Anthropic) via Cursor IDE



* Adding PR link to changelogs/fragments/10786-jira-cloud-search.yml



* Adding note about future usage of cloud parameter



---------



(cherry picked from commit d956fb8197)

Signed-off-by: Vladimir Vasilev <vvasilev@redhat.com>
Co-authored-by: vladi-k <53343355+vladi-k@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-01 07:06:25 +02:00
patchback[bot]
1df4b3ee74 [PR #11690/f4e5fc09 backport][stable-12] monit: re-enable tests in RHEL (#11714)
monit: re-enable tests in RHEL (#11690)

* re-enable monit tests in rhel

* enable EPEL for RHEL<11

* rollback EPEL setup, skip only specific versions

* remove skip entirely

* change download URL in setup_epel, adjusted code to use it

* claude tries to install virtualenv, round 1

* claude tries python3 -m venv instead

* remove outdated centos6 file

(cherry picked from commit f4e5fc09d7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-04-01 07:06:16 +02:00
patchback[bot]
ae089aefad [PR #11688/85685944 backport][stable-12] flatpak: fix removal of runtimes (#11713)
flatpak: fix removal of runtimes (#11688)

* flatpak: fix removal of runtimes (issue #553)

The module was using `--app` when listing installed flatpaks for name
matching, which excluded runtimes from the results. This caused removal
of runtimes to fail even though `flatpak_exists()` correctly detected
them as installed (it lists both apps and runtimes).

Fix by dropping `--app` from the three matching functions so that both
apps and runtimes are searchable.



* flatpak: add changelog fragment for PR #11688



---------


(cherry picked from commit 8568594453)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 08:06:46 +02:00
patchback[bot]
f92fedcfa0 [PR #11683/5a27cbde backport][stable-12] snmp_facts: update to pysnmp >= 7.1 async API (#11711)
snmp_facts: update to pysnmp >= 7.1 async API (#11683)

* snmp_facts: update to pysnmp >= 7.1 async API

Migrate snmp_facts module from the removed pysnmp oneliner API
(pysnmp.entity.rfc3413.oneliner.cmdgen) to the current async API
(pysnmp.hlapi.v3arch.asyncio).

This fixes compatibility with Python 3.12+ and pysnmp >= 7.1.

Closes #8852

* Continue to support pysnmp 6.2.4

* Correct PR number

* sort imports

* shorter changelog

* move `SNMP_DEFAULT_PORT`

* Add `notes:`

* Become an author

* use `deps.declare`

* add lalten to BOTMETA

(cherry picked from commit 5a27cbdec6)

Co-authored-by: Laurenz <lalten@users.noreply.github.com>
2026-03-30 22:33:30 +02:00
patchback[bot]
9d269ee8ca [PR #11698/47ef322a backport][stable-12] ipa module utils: detect and fail on errors in API response failed field (#11710)
ipa module utils: detect and fail on errors in API response `failed` field (#11698)

* ipa_* modules: detect and fail on errors in API response ``failed`` field

Fixes: https://github.com/ansible-collections/community.general/issues/1239



* fix chglog frag

* adjust chglog frag

---------


(cherry picked from commit 47ef322a5f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 21:43:39 +02:00
patchback[bot]
66d394dc81 [PR #11686/68ae04a9 backport][stable-12] Cleanup of aliases skip statements (#11709)
Cleanup of `aliases` skip statements (#11686)

* add scripts to clean aliases' skips

* remove legacy skips

* code cosmetics

* add license to ALIASES.md

* Fix typos in ALIASES.md documentation

* rolling back freebsd14.2 and 14.3 in iso_extract

* fix versions and re-run

(cherry picked from commit 68ae04a95a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-30 19:58:13 +02:00
patchback[bot]
de180d01e0 [PR #11689/a4bba992 backport][stable-12] composer - make create-project idempotent, add force parameter (#11700)
composer - make `create-project` idempotent, add `force` parameter (#11689)

* composer - make create-project idempotent, add force parameter

Adds a check for an existing composer.json in working_dir before running
create-project, so the task is skipped rather than failing on second run.
A new force parameter allows bypassing this check when needed.

Fixes #725.



* changelog fragment: rename to PR number, add PR URL



---------


(cherry picked from commit a4bba99203)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 21:34:35 +01:00
patchback[bot]
1a1056099c [PR #11685/909458a6 backport][stable-12] docs: improve timezone module examples and add hwclock usage (#11696)
docs: improve timezone module examples and add hwclock usage (#11685)

* docs: add variable-based example for timezone module

### Summary
Added a variable-based example to the EXAMPLES section of the timezone module.

### Changes
- Added an example demonstrating how to set timezone dynamically using a variable

### Motivation
Using variables is a common practice in Ansible playbooks. This example helps users understand how to make the module usage more flexible and reusable.

* docs: improve timezone module examples with hwclock usage

### Summary
Improved the EXAMPLES section of the timezone module by adding a more meaningful, module-specific example.

### Changes
- Added an example demonstrating usage of the `hwclock` parameter
- Simplified examples to avoid redundancy
- Fixed formatting issues causing CI failures (invalid YAML, lint errors)

### Motivation
The previous examples were minimal and did not demonstrate module-specific features. This update adds a more practical use case and ensures the examples follow proper formatting and validation rules.

(cherry picked from commit 909458a661)

Co-authored-by: Anshjeet Mahir <anshjeetmahir123@gmail.com>
2026-03-27 12:45:03 +01:00
patchback[bot]
300f525ff9 [PR #11673/12af50cf backport][stable-12] docs: add Execution Environment guide (#11693)
docs: add Execution Environment guide (#11673)

* docs: add Execution Environment guide

Closes #2968
Closes #4512



* add to botmeta

* fix code block language

* Apply suggestions from code review



* Update section title for community.general EE metadata

* Apply suggestion from felixfontein



* Remove extraneous paragraph

* Apply suggestions from code review




* remove link to legacy documentation

* Update docs/docsite/rst/guide_ee.rst



---------




(cherry picked from commit 12af50cfb7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Don Naro <dnaro@redhat.com>
2026-03-26 22:20:21 +01:00
patchback[bot]
03a639e809 [PR #11677/ef700b11 backport][stable-12] nsupdate: add unit tests (#11692)
nsupdate: add unit tests (#11677)

* nsupdate: add unit tests



* fix var name to regain sanity

* remove unneeded typing from test file

* formatting

---------


(cherry picked from commit ef700b116a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 21:47:56 +01:00
patchback[bot]
f739035d1f [PR #11681/e2c06f2d backport][stable-12] pacman: add root, cachedir, and config options (#11684)
pacman: add root, cachedir, and config options (#11681)

* pacman: add root, cachedir, and config options

Add three dedicated options -- O(root), O(cachedir), and O(config) --
so that all pacman commands get the corresponding global flags
(--root, --cachedir, --config) prepended, enabling use cases such as
installing packages into a chroot or alternative root directory
(similar to pacstrap).



* add changelog frag

---------


(cherry picked from commit e2c06f2d12)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 06:47:20 +01:00
patchback[bot]
17e02f87c9 [PR #11678/d06c83eb backport][stable-12] etcd3: re-enable and fix tests, add unit tests (#11680)
etcd3: re-enable and fix tests, add unit tests (#11678)

* etcd3: re-enable and fix tests, add unit tests

- Add unit tests for community.general.etcd3 module (12 tests covering
  state=present/absent, idempotency, check mode, and error paths)
- Fix integration test setup: update etcd binary to v3.6.9 (from v3.2.14),
  download from GitHub releases, add health-check retry loop after start
- Work around etcd3 Python library incompatibility with protobuf >= 4.x
  by setting PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
- Update to FQCNs throughout integration tests
- Re-enable both etcd3 and lookup_etcd3 integration targets

Fixes https://github.com/ansible-collections/community.general/issues/322



* improve use of multiple context managers

---------


(cherry picked from commit d06c83eb68)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 07:05:05 +01:00
patchback[bot]
becbd2d80f [PR #11674/cc59f7eb backport][stable-12] botmeta: fix sorting (#11676)
botmeta: fix sorting (#11674)

(cherry picked from commit cc59f7ebeb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-24 22:12:26 +01:00
patchback[bot]
aa352ccf45 [PR #11664/d48a0668 backport][stable-12] mssql_*: named instances (#11672)
mssql_*: named instances (#11664)

* mssql_*: named instances

* add changelog frag

* fix changelog

* Update plugins/modules/mssql_db.py

* Update plugins/modules/mssql_db.py

* Update plugins/modules/mssql_script.py

* Update plugins/modules/mssql_script.py

* fix backslashes

* Update plugins/modules/mssql_db.py



* Update plugins/modules/mssql_script.py



---------


(cherry picked from commit d48a066821)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-24 07:00:36 +01:00
Felix Fontein
e5b01dfc01 The next expected release is 12.6.0. 2026-03-23 21:47:25 +01:00
Felix Fontein
a5d830bbf4 Release 12.5.0. 2026-03-23 21:24:48 +01:00
patchback[bot]
02b25fb096 [PR #11655/6d3ab1a8 backport][stable-12] passwordstore lookup: update code meant for Python2 (#11669)
passwordstore lookup: update code meant for Python2 (#11655)

* passwordstore lookup: update code meant for Python2

* add changelog frag

* add check param to subprocess.run() to reinstate sanity

(cherry picked from commit 6d3ab1a80c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 20:35:20 +01:00
patchback[bot]
555d7b9038 [PR #11658/25a4f568 backport][stable-12] puppet: deprecate param timeout (#11665)
puppet: deprecate param timeout (#11658)

* puppet: deprecate param timeout

* add changelog frag

* Update changelogs/fragments/11658-puppet-timeout-deprecation.yml



---------


(cherry picked from commit 25a4f568f9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-23 20:35:09 +01:00
patchback[bot]
4dfe6816a8 [PR #11622/7c039918 backport][stable-12] keycloak_realm: Add support for setting first broker login flow (#11670)
keycloak_realm: Add support for setting first broker login flow (#11622)

* keycloak_realm: Add support for setting first broker login flow

* Update plugins/modules/keycloak_realm.py



* Add changelog fragment

---------


(cherry picked from commit 7c039918e0)

Co-authored-by: Nils Bergmann <Nils1794@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-23 20:34:51 +01:00
patchback[bot]
a12ac59223 [PR #11656/4dad53ab backport][stable-12] counter_enabled callback: honor display_ok_hosts setting (#11667)
counter_enabled callback: honor display_ok_hosts setting (#11656)

* fix(callback/counter_enabled): honor display_ok_hosts setting

* add changelog frag

* Update changelogs/fragments/11656-counter_enabled-display_ok_hosts.yml

(cherry picked from commit 4dad53abac)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 20:34:43 +01:00
patchback[bot]
9d7097ef4d [PR #11635/3c21ac96 backport][stable-12] nmcli: fix setting_types() to properly handle routing_rules as a list type (#11668)
nmcli: fix setting_types() to properly handle routing_rules as a list type (#11635)

* Fix setting_types() to properly handle routing_rules as a list type

* Add changelog fragment for ipv6.routing-rules bugfix

* Update changelogs/fragments/11630-nmcli-ipv6-routing-rules.yml



* Add PR URL to changelog fragment

---------


(cherry picked from commit 3c21ac961b)

Co-authored-by: Ted W. <ted.l.wood@gmail.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 20:34:36 +01:00
patchback[bot]
8e4581c0e6 [PR #11659/d6cb56c0 backport][stable-12] osx_defaults: add dict support (#11671)
osx_defaults: add dict support (#11659)

* osx_defaults: add dict support

* add changelog frag

* osx_defaults: fix dict idempotency by using plutil -extract for type-preserving read

The previous approach piped `defaults read` output (old-style plist text)
through `plutil -convert json`. Old-style plist loses boolean type info
(booleans appear as 1/0, indistinguishable from integers), causing the
comparison to fail and reporting changed=True on every run.

Fix by exporting the domain binary plist to a temp file and using
`plutil -extract key json` which correctly preserves all plist types
(booleans stay true/false, integers stay integers, etc.).



* change param from bool to str

* Apply suggestion from review

* Update plugins/modules/osx_defaults.py



---------



(cherry picked from commit d6cb56c022)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-23 20:34:28 +01:00
patchback[bot]
28b50a1e45 [PR #11657/d48e767e backport][stable-12] open_iscsi: support IPv6 portals (#11663)
open_iscsi: support IPv6 portals (#11657)

* fix(modules/open_iscsi): support IPv6 portals

* add changelog frag

(cherry picked from commit d48e767e1e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 07:04:44 +01:00
patchback[bot]
414f0541a5 [PR #11654/b85a1687 backport][stable-12] test: remove redundant unit test requirements (#11662)
test: remove redundant unit test requirements (#11654)

(cherry picked from commit b85a168716)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 07:04:31 +01:00
patchback[bot]
c4da6e4202 [PR #11660/b1ac989c backport][stable-12] remove skip/aix from aliases files (#11661)
remove skip/aix from aliases files (#11660)

(cherry picked from commit b1ac989c70)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-23 07:04:20 +01:00
Felix Fontein
05f3052937 Prepare 12.5.0. 2026-03-22 20:35:05 +01:00
patchback[bot]
919d27676c [PR #11632/69b9a3f8 backport][stable-12] supervisorctl: skip no such process for all (#11652)
supervisorctl: skip no such process for all (#11632)

* feat(supervisorctl): skip no such process for all

Do not fail, if there are no matching processes for name=all

* feat(supervisorctl): add changelog

* Update 11621-skip-no_such_process-for-name-all.yml



* fix(supervisorctl): replace single quotes to double

---------



(cherry picked from commit 69b9a3f8e2)

Co-authored-by: zr0dy <58261587+zr0dy@users.noreply.github.com>
Co-authored-by: zr0dy <zr0dy@mail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-22 20:33:58 +01:00
patchback[bot]
a425d16e7c [PR #11646/8d403dde backport][stable-12] ansible_galaxy_install: new param executable (#11651)
ansible_galaxy_install: new param executable (#11646)

* ansible_galaxy_install: new param executable

* add changelog frag

(cherry picked from commit 8d403dde5b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 20:33:41 +01:00
patchback[bot]
12808f67d5 [PR #11645/a09e879f backport][stable-12] xfconf: fix boolean return values (#11650)
xfconf: fix boolean return values (#11645)

* xfconf: fix boolean return values

* add changelog frag

(cherry picked from commit a09e879ff2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 20:33:31 +01:00
patchback[bot]
268b31b53d [PR #11639/758a445d backport][stable-12] npm: use uthelper for tests (#11644)
npm: use uthelper for tests (#11639)

(cherry picked from commit 758a445d97)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 11:17:30 +01:00
patchback[bot]
fa682e8b40 [PR #11638/4f5e5c9b backport][stable-12] python_runner: add integration tests (#11643)
test(python_runner): add integration tests (#11638)

* test(python_runner): add integration tests

* simplify the test

* add missing quotes

* use setup_remote_tmp_dir

* build venv manually first

(cherry picked from commit 4f5e5c9bb6)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 11:17:12 +01:00
patchback[bot]
0f7d508344 [PR #11637/3aa4a298 backport][stable-12] cmd_runner_fmt tests: assert that unpack_* functions can handle _ArgFormat objects (#11642)
test(cmd_runner_fmt): assert that `unpack_*` functions can handle `_ArgFormat` objects (#11637)

test(cmd_runner_fmt): assert that unpack functions can handle _ArgFormat objects

(cherry picked from commit 3aa4a29842)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 11:13:50 +01:00
patchback[bot]
ac771079db [PR #11636/1dfc4fed backport][stable-12] test: uthelper now generates one test function per test case (#11641)
test: uthelper now generates one test function per test case (#11636)

(cherry picked from commit 1dfc4fed40)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-22 11:05:28 +01:00
patchback[bot]
96852b7032 [PR #11631/b4336659 backport][stable-12] CI: Remove FreeBSD 14.3 for devel, and replace macOS 15.3 with 26.3 (#11634)
CI: Remove FreeBSD 14.3 for devel, and replace macOS 15.3 with 26.3 (#11631)

* Replace FreeBSD 14.3 with 14.4, and macOS 15.3 with 26.3.

* FreeBSD 14.4 seems to have the same problem as FreeBSD 15.0, disabling for now.

(cherry picked from commit b4336659f6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-21 21:13:57 +01:00
patchback[bot]
08bb917d59 [PR #11625/bc22fbca backport][stable-12] CI: Replace apt_repository and apt_key with deb822_repository (#11627)
CI: Replace apt_repository and apt_key with deb822_repository (#11625)

Replace apt_repository and apt_key with deb822_repository.

(cherry picked from commit bc22fbcaa0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-20 08:06:18 +01:00
patchback[bot]
e7e9cf97e5 [PR #11536/dae2157b backport][stable-12] merge_variables: extended merge capabilities added (#11626)
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.



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



* Update plugins/lookup/merge_variables.py



* Periods added at the end of each choice description



* Update plugins/lookup/merge_variables.py



* ref: follow project standard for choice descriptions



* ref: more examples added and refactoring



* Update plugins/lookup/merge_variables.py



* ref: some more comments to examples added



* fix: unused import removed



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



* Update comments



* Specification of transformations solely as string



* Comments updated



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



* ref: improve options documentation



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



* Update plugins/lookup/merge_variables.py



* ref: "prio" replaced by "dict"



* feat: two integration tests added



---------





(cherry picked from commit dae2157bb7)

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <cfiehe@users.noreply.github.com>
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:59:56 +01:00
patchback[bot]
deb9d63783 [PR #11585/25b5655b backport][stable-12] keycloak_authentication_v2: verify providerIds (fix 11583) (#11619)
keycloak_authentication_v2: verify providerIds (fix 11583) (#11585)

* 11583 verify providerIds in keycloak_authentication_v2

* 11583 code cleanup

---------


(cherry picked from commit 25b5655be7)

Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
2026-03-18 18:14:37 +01:00
patchback[bot]
a882022280 [PR #11589/d8bb637c backport][stable-12] nictagadm: don't call is_valid_mac when etherstub is true (#11618)
nictagadm: don't call is_valid_mac when etherstub is true (#11589)

* nictagadm: don't call is_valid_mac when etherstub is true

* Add changelog fragment

* update changelog fragment

* Shorten changelog fragement

* Update changelogs/fragments/nictagadm-etherstub-nonetype-bugfix.yml



---------


(cherry picked from commit d8bb637cba)

Co-authored-by: Adam D <44533090+emptyDir@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-18 07:05:16 +01:00
patchback[bot]
f06bcabeed [PR #11601/e7a253b4 backport][stable-12] keycloak_authentication_v2: covers idp flow overrides in safe swap (fix 11582) (#11617)
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

(cherry picked from commit e7a253b4c9)

Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
2026-03-18 07:05:10 +01:00
patchback[bot]
19462b72ca [PR #11612/5e4fbfee backport][stable-12] Update BOTMETA.yml (#11616)
Update BOTMETA.yml (#11612)

remove myself from teams

(cherry picked from commit 5e4fbfeee0)

Co-authored-by: Anatoly Pugachev <matorola@gmail.com>
2026-03-18 07:04:59 +01:00
patchback[bot]
a8bd4c750b [PR #11586/df9b3044 backport][stable-12] github_secrets_info: new module (#11610)
github_secrets_info: new module (#11586)

* github_secrets_info: new module



* clean tests



* remove pynacl dep



* fqcn



* remove excess output



* just return result as sample



* only print secrets, adapt tests



* Update plugins/modules/github_secrets_info.py



* Update plugins/modules/github_secrets_info.py



* Update plugins/modules/github_secrets_info.py



* t is for typing, and typing is what we did



* add info_module attributes



---------



(cherry picked from commit df9b30448a)

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-16 20:28:22 +01:00
patchback[bot]
000b92a425 [PR #11254/cc24e573 backport][stable-12] monit: deprecate support for monit <= 5.18 (#11609)
monit: deprecate support for monit <= 5.18 (#11254)

* monit: deprecate support for monit <= 5.18

* add additional runs for checking version

* add changelog frag

* bump deprecation for 14.0.0

(cherry picked from commit cc24e57307)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-16 20:16:41 +01:00
patchback[bot]
7784fbdf17 [PR #11603/c8fe1e57 backport][stable-12] Fix typing imports (#11607)
Fix typing imports (#11603)

Fix typing imports.

(cherry picked from commit c8fe1e571f)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-15 19:53:36 +01:00
patchback[bot]
292bb400eb [PR #11605/f642dac9 backport][stable-12] sssd_info: fix attributes (#11606)
sssd_info: fix attributes (#11605)

Fix attributes.

(cherry picked from commit f642dac900)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-15 19:53:27 +01:00
patchback[bot]
c6ddff0dad [PR #11514/46ffec6f backport][stable-12] github_secrets: new module (#11602)
github_secrets: new module (#11514)

* add support for managing GitHub secrets



* fix tab



* update for sanity



* more sanity fixes



* update botmeta



* formating



* remove list function



* remove docstring, format text strings and return codes



* switch to deps



* black and ruff doesnt get along



* initial unit tests



* update non-existing secret test



* update description and details



* handle when a secret cant be deleted



* fail if not acceptable error codes



* add test for non-acceptable status codes



* remove local ruff config



* allow empty strings



* set required_



* extend tests



* cleanup



* cover all, got a git urlopen error



* cover all, got a git urlopen error



* ensure value cant be None



* check_mode



* bump to 12.5.0



* Update plugins/modules/github_secrets.py



* extend check_mode and related tests



* split constants and return dict when checking secret



* switch to HTTPStatus



* replace DELETE and UPDATE with NO_CONTENT



* Update plugins/modules/github_secrets.py



* Update plugins/modules/github_secrets.py



* update tests



* Update plugins/modules/github_secrets.py



* Update plugins/modules/github_secrets.py



* Update plugins/modules/github_secrets.py



* Update plugins/modules/github_secrets.py



* Update plugins/modules/github_secrets.py



---------



(cherry picked from commit 46ffec6f0e)

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-15 16:38:30 +01:00
patchback[bot]
86616b1559 [PR #11592/2d685e7a backport][stable-12] test(monit): use uthelper (#11593)
test(monit): use uthelper (#11592)

(cherry picked from commit 2d685e7a85)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-14 22:34:22 +01:00
patchback[bot]
99ebbbdf49 [PR #11590/ce5d5622 backport][stable-12] replace list(map(...)) with comprehension (#11591)
replace `list(map(...))` with comprehension (#11590)

* replace `list(map(...))` with comprehension

* add changelog frag

(cherry picked from commit ce5d5622b9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-14 17:14:18 +01:00
patchback[bot]
c853dfb1a8 [PR #11559/3194ed9d backport][stable-12] ipa_dnsrecord fix error when using dnsttl and nothing to change (#11587)
ipa_dnsrecord fix error when using dnsttl and nothing to change (#11559)

* ipa_dnsrecord fix error when using dnsttl and nothing to change

* Add changelog and bump version

* ipa_dnsrecord list comp in dnsrecord_find



* 11559 changelog fragment fix capitalization

* ipa_dnsrecord dnsrecord_find ttl transform to integer always

* ipa_dnsrecord dnsrecord_find method refactor

---------


(cherry picked from commit 3194ed9d36)

Co-authored-by: Dor Breger <75537576+DorBreger@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-13 21:14:48 +01:00
patchback[bot]
79d8c9bd6e [PR #11424/f0e3edc8 backport][stable-12] New module: logrotate (#11581)
New module: `logrotate` (#11424)

* add module logrotate

* add values for start

* fix docs

* version 12.5.0 and fix test

---------


(cherry picked from commit f0e3edc892)

Co-authored-by: Aleksandr Gabidullin <101321307+a-gabidullin@users.noreply.github.com>
Co-authored-by: Александр Габидуллин <agabidullin@astralinux.ru>
2026-03-13 08:01:39 +01:00
patchback[bot]
e631648ef6 [PR #11576/ccc974e2 backport][stable-12] Consolidate changelog fragments (#11580)
Consolidate changelog fragments (#11576)

Consolidate changelog fragments.

(cherry picked from commit ccc974e2fa)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-13 07:58:25 +01:00
patchback[bot]
5106aa8065 [PR #11557/a69f7e60 backport][stable-12] add module keycloak_authentication_v2 (#11579)
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



* Update plugins/modules/keycloak_authentication_v2.py



* 11556 code cleanup - remove document starts

* 11556 cleanup

* 11556 cleanup

---------




(cherry picked from commit a69f7e60b4)

Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
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-13 07:41:56 +01:00
patchback[bot]
25e35bdda7 [PR #11481/55dae7c2 backport][stable-12] doas: allow to explicitly enable pipelining (#11577)
doas: allow to explicitly enable pipelining (#11481)

* Allow to explicitly enable pipelining.

* Add markup.

(cherry picked from commit 55dae7c2a6)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-12 21:44:11 +01:00
patchback[bot]
74bc10b8fc [PR #11558/0e4783dc backport][stable-12] Binary attribute support for ldap_attrs and ldap_entry (#11578)
Binary attribute support for `ldap_attrs` and `ldap_entry` (#11558)

* Binary attribute support for `ldap_attrs` and `ldap_entry`

This commit implements binary attribute support for the `ldap_attrs` and
`ldap_entry` plugins. This used to be "supported" before, because it was
possible to simply load arbitrary binary data into the attributes, but
no longer functions on recent Ansible versions.

In order to support binary attributes, this commit introduces two new
options to both plugins:

  * `binary_attributes`, a list of attribute names which will be
    considered as being binary,
  * `honor_binary_option`, a flag which is true by default and will
    handle all attributes that include the binary option (see RFC 4522)
    as binary automatically.

When an attribute is determined to be binary through either of these
means, the plugin will assume that the attribute's value is in fact
base64-encoded. It will proceed to decode it and handle it accordingly.

While changes to `ldap_entry` are pretty straightforward, more work was
required on `ldap_attrs`.

  * First, because both `present` and `absent` state require checking
    the attribute's current values and normally do that using LDAP search
    queries for each value, a specific path for binary attributes was
    added that loads and caches all values for the attribute and compares
    the values in the Python code.
  * In addition, generating both the modlist and the diff output require
    re-encoding binary attributes' values into base64 so it can be
    transmitted back to Ansible.

* Various fixes on `ldap_attrs`/`ldap_entry` from PR 11558 discussion

* Rename `honor_binary_option` to `honor_binary`

* Add some general documentation about binary attributes

* Fix changelog fragment after renaming one of the new options

* Add examples of `honor_binary` and `binary_attributes`

* Add note that indicates that binary values are supported from 12.5.0+

* Fix punctuation

* Add links to RFC 4522 to `ldap_attrs` and `ldap_entry`

* Catch base64 decoding errors

* Rephrase changelog fragment

* Use f-string to format the encoding error message

(cherry picked from commit 0e4783dcc3)

Co-authored-by: Emmanuel Benoît <tseeker@nocternity.net>
2026-03-12 21:39:01 +01:00
patchback[bot]
7415220cad [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575)
fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573)

* fix: remove HTTPStatus constructs introduced in Python 3.11

* add changelog frag

(cherry picked from commit f9e583dae2)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-12 20:59:26 +01:00
patchback[bot]
7f8bc6f99d [PR #11541/4cd91ba4 backport][stable-12] Fix templating bug in iptables_state tests (#11572)
Fix templating bug in iptables_state tests (#11541)

* Fix templating bug in iptables_state tests.

* Try to install older packages on RHEL.

(cherry picked from commit 4cd91ba4d4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-11 22:15:52 +01:00
patchback[bot]
b5846a3d05 [PR #11567/9b72d954 backport][stable-12] Add missing __future__ imports (#11569)
Add missing __future__ imports (#11567)

Add missing __future__ imports.

(cherry picked from commit 9b72d95452)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-11 07:10:34 +01:00
patchback[bot]
25c475a7ef [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568)
replace literal HTTP codes with `http.HTTPStatus` (#11561)

* replace literal HTTP codes with http.HTTPStatus

* add changelog frag

(cherry picked from commit 7436c0c9ba)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-10 22:14:27 +01:00
patchback[bot]
b3782a76e0 [PR #11551/1554f23b backport][stable-12] nmcli: fix idempotency issue with macvlan (#11566)
nmcli: fix idempotency issue with macvlan (#11551)

* nmcli: fix idempotency issue with macvlan

The nmcli module is not idempotent for macvlan interfaces.

Ansible running in diff mode for a case where the interface in question
already exists:

```
TASK [nm_macvlan : Check macvlan connection] *********************************************************************************
--- before
+++ after
@@ -11,5 +11,5 @@
     "ipv6.method": "disabled",
     "macvlan.mode": "2",
     "macvlan.parent": "eth0",
-    "macvlan.tap": "no"
+    "macvlan.tap": "False"
 }
```
The problem is that `macvlan.tap` isn't treated as boolean option. Fix it.

* Update changelogs/fragments/11551-fix-nmcli-idempotency-for-macvlan.yml



---------


(cherry picked from commit 1554f23bfb)

Co-authored-by: Martin Wilck <mwilck@suse.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-10 22:00:44 +01:00
patchback[bot]
fc5de1a194 [PR #11548/2f33ff10 backport][stable-12] keycloak_authentication: fix TypeError when flow has no authenticationExecutions (#11565)
keycloak_authentication: fix TypeError when flow has no authenticationExecutions (#11548)

* TIAAS-12174: fix(keycloak_authentication): handle None authenticationExecutions

When a flow is defined without authenticationExecutions, module.params.get()
returns None but the key still exists in the config dict. The 'in' check
passes but iterating over None raises TypeError.

Guard the iteration with an explicit None check.

* keycloak_authentication: add changelog fragment for NoneType fix

* keycloak_authentication: update changelog fragment with PR link

* Update plugins/modules/keycloak_authentication.py



* Changelog polishing

---------



(cherry picked from commit 2f33ff1041)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
Co-authored-by: Ivan Kokalovic <ivan.kokalovic@example.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-03-10 06:57:51 +01:00
patchback[bot]
80184b6fd4 [PR #11562/93112d23 backport][stable-12] monit: remove unstable tag from integration tests (#11563)
monit: remove unstable tag from integration tests (#11562)

(cherry picked from commit 93112d23e5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-10 06:57:40 +01:00
patchback[bot]
be7dc5f37d [PR #11555/71f8c15d backport][stable-12] Allow setting of independent custom domain for incus inventory (#11560)
Allow setting of independent custom domain for incus inventory (#11555)

Allowing the domain suffix to be appended independent of the `host_fqdn`
setting enables the inventory plugin to construct proper FQDNs if a
network has the `dns.domain` property set. Otherwise you would always
end up with something like `host01.project.local.example.net` despite
`host01.example.net` being the expected result.

(cherry picked from commit 71f8c15d2e)

Co-authored-by: Roland Sommer <rol@ndsommer.de>
2026-03-07 19:12:30 +01:00
patchback[bot]
fc7bcccc9d [PR #11552/aaef821f backport][stable-12] Update links to iocage. Current iocage documentation is at freebsd.gi… (#11554)
Update links to iocage. Current iocage documentation is at freebsd.gi… (#11552)

Update links to iocage. Current iocage documentation is at freebsd.github.io/iocage/

(cherry picked from commit aaef821f60)

Co-authored-by: Vladimir Botka <vbotka@gmail.com>
2026-03-06 05:53:33 +00:00
patchback[bot]
5cb4632c15 [PR #11540/137f5444 backport][stable-12] aix_*: deprecation (#11550)
aix_*: deprecation (#11540)

* aix_*: deprecation

* add changelog frag

* update chglog

* adjustments from review

* typo

* wordsmithing from review

(cherry picked from commit 137f5444e3)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-03-04 21:59:38 +01:00
patchback[bot]
eae5987be1 [PR #11544/9b9d8eac backport][stable-12] Update tests to pass on macOS arm64 (#11545)
Update tests to pass on macOS arm64 (#11544)

(cherry picked from commit 9b9d8eac09)

Co-authored-by: Matt Clay <matt@mystile.com>
2026-02-27 19:29:47 +01:00
patchback[bot]
d45044790a [PR #11538/8929caec backport][stable-12] Fix description error in CONTRIBUTING.md (#11539)
Fix description error in CONTRIBUTING.md (#11538)

Fix text error in CONTRIBUTING.md.

Updated instructions for running format tests.

(cherry picked from commit 8929caece6)

Co-authored-by: IamLunchbox <56757745+IamLunchbox@users.noreply.github.com>
2026-02-25 06:53:14 +01:00
Felix Fontein
434f7ce55b The next expected release will be 12.5.0. 2026-02-23 18:38:55 +01:00
Felix Fontein
f88b8c85d7 Release 12.4.0. 2026-02-23 17:50:05 +01:00
patchback[bot]
6385fbe038 [PR #11534/e118b23b backport][stable-12] Simplify and extend from_ini tests (#11535)
Simplify and extend from_ini tests (#11534)

Simplify and extend from_ini tests.

(cherry picked from commit e118b23ba0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-23 06:30:35 +01:00
patchback[bot]
4b6cd41512 [PR #11462/ce7cb4e9 backport][stable-12] New module icinga2_downtime (#11532)
New module icinga2_downtime (#11462)

* feat: Icinga 2 downtime module added allowing to schedule and remove downtimes through its REST API.



* ensure compatibility with ModuleTestCase

feat: errors raised from MH now contain the changed flag
ref: move module exit out of the decorated run method



* revised module

ref: module refactored using StateModuleHelper now
ref: suggested changes by reviewer added



* revert change regarding changed flag in MH



* refactoring and set changed flag explicitly on error



* Check whether there was a state change on module failure removed.



* ref: test cases migrated to the new feature that allows passing through exceptions



* Update plugins/module_utils/icinga2.py



* Update plugins/module_utils/icinga2.py



* Update plugins/modules/icinga2_downtime.py



* ref: make module helper private



* fix: ensure that all non-null values are added to the request otherwise a `false` value is dropped



* ref: module description extended with the note that check mode is not supported



* Update plugins/modules/icinga2_downtime.py



* fix: documentation updated



* ref: documentation updated
ref: doc fragment added



* Update plugins/doc_fragments/icinga2_api.py



* ref: doc fragment renamed to `_icinga2_api.py`



* ref: maintainer to doc fragment in BOTMETA.yml added



* Update plugins/modules/icinga2_downtime.py



* Update plugins/modules/icinga2_downtime.py



* Update plugins/modules/icinga2_downtime.py



---------





(cherry picked from commit ce7cb4e914)

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <cfiehe@users.noreply.github.com>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-02-23 06:17:51 +01:00
patchback[bot]
8c429ac69d [PR #11485/cb91ff42 backport][stable-12] Fix: avoid deprecated callback. (#11531)
Fix: avoid deprecated callback. (#11485)

* Fix: avoid deprecated callback.

* addition of changelog

* Improve changelog fragment.

---------



(cherry picked from commit cb91ff424f)

Co-authored-by: Tom Uijldert <155556120+TomUijldert@users.noreply.github.com>
Co-authored-by: tom uijldert <tom.uijldert@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-23 06:17:28 +01:00
patchback[bot]
30eb35cb95 [PR #11512/aec0e61b backport][stable-12] adds parameter delimiters to from_ini filter (#11533)
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



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



* adds input validation

* adss check for delimiters not None

* adds missing import

* removes the negation

* adds suggestions from russoz

* adds ruff format suggestion

---------


(cherry picked from commit aec0e61ba1)

Co-authored-by: Robert Sander <github@gurubert.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-23 06:17:00 +01:00
Felix Fontein
33f3e7172b Prepare 12.4.0. 2026-02-22 16:39:25 +01:00
patchback[bot]
c2751dd6f5 [PR #11513/0e184d24 backport][stable-12] add support for localizationTexts in keycloak_realm.py (#11530)
add support for localizationTexts in keycloak_realm.py (#11513)

* add support for localizationTexts in keycloak_realm.py

* add changelog fragment

* change version added to next minor release

* Update changelogs/fragments/11513-keycloak-realm-localizationTexts-support.yml



* Update plugins/modules/keycloak_realm.py



---------


(cherry picked from commit 0e184d24cf)

Co-authored-by: nwintering <33374766+nwintering@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-02-21 23:07:08 +01:00
patchback[bot]
d3dd685ad4 [PR #11515/7cd75945 backport][stable-12] #11502 Fix mapping of config of keycloak_user_federation (#11529)
#11502 Fix mapping of config of keycloak_user_federation (#11515)

* #11502 Fix mapping of config

Fix mapping of config

Fix diff for mappers

* Fix formatting with nox

* Update changelogs/fragments/11502-keycloak-config-mapper.yaml



* Remove duplicate comment
https://github.com/ansible-collections/community.general/pull/11515#discussion_r2821444756

---------


(cherry picked from commit 7cd75945b2)

Co-authored-by: mixman68 <greg.djg13@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-21 12:11:19 +01:00
patchback[bot]
696b6e737a [PR #11523/1ae058db backport][stable-12] reduce collection build time with build_ignore (#11528)
reduce collection build time with build_ignore (#11523)

* reduce build time with build_ignore



* just ignore .nox



---------


(cherry picked from commit 1ae058db63)

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2026-02-21 11:43:25 +01:00
patchback[bot]
45d16053ee [PR #10306/38f93c80 backport][stable-12] New Callback plugin: loganalytics_ingestion adding Azure Log Analytics Ingestion (#11527)
New Callback plugin: `loganalytics_ingestion` adding Azure Log Analytics Ingestion (#10306)

* Add Azure Log Analytics Ingestion API plugin

The Ingestion API allows sending data to a Log Analytics workspace in
Azure Monitor.

* Fix LogAnalytics Ingestion shebang

* Fix Log Analytics Ingestion pep8 tests

* Fix Log Analytics Ingestion pylint tests

* Fix Log Analytics Ingestion import tests

* Fix Log Analytics Ingestion pylint test

* Add Log Analytics Ingestion auth timeout

Previous behavior was to use the 'request' module's default timeout;
this makes auth timeout value consistent with the task submission
timeout value.

* Display Log Analytics Ingestion event data as JSON

Previous behavior was to display the data as a Python dictionary.
The new behavior makes it easier to generate a sample JSON file in order
to import into Azure when creating the table.

* Add Azure Log Analytics Ingestion timeout param

This parameter controls how long the plugin will wait for an HTTP response
from the Azure Log Analytics API before considering the request a failure.
Previous behavior was hardcoded to 2 seconds.

* Fix Azure Log Ingestion unit test

The class instantiation was missing an additional argument that was added
in a previous patch; add it.  Converting to JSON also caused the Mock
TaskResult object to throw a serialization error; override the function
for JSON conversion to just return bogus data instead.

* Fix loganalytics_ingestion linter errors

* Fix LogAnalytics Ingestion env vars

Prefix the LogAnalytics Ingestion plugin's environment variable names
with 'ANSIBLE_' in order to align with plugin best practices.

* Remove LogAnalytics 'requests' dep from docs

The LogAnalytics callback plugin does not actually require 'requests',
so remove it from the documented dependencies.

* Refactor LogAnalytics Ingestion to use URL utils

This replaces the previous behavior of depending on the external
'requests' library.

* Simplify LogAnalytics Ingestion token valid check



* Remove LogAnalytics Ingestion extra arg validation

Argument validation should be handled by ansible-core, so remove the
extra argument validation in the plugin itself.

* Update LogAnalytics Ingestion version added

* Remove LogAnalytics Ingestion coding marker

The marker is no longer needed as Python2 is no longer supported.

* Fix some LogAnalytics Ingestion grammar errors

* Refactor LogAnalytics Ingestion plugin messages

Consistently use "plugin" instead of module, and refer to the module by
its FQCN instead of its prose name.

* Remove LogAnalytics Ingestion extra logic

A few unused vars were being set; stop setting them.

* Fix LogAnalytics Ingestion nox sanity tests

* Fix LogAnalytics Ingestion unit tests

The refactor to move away from the 'requests' dependency to use
module_utils broke the plugin's unit tests; re-write the plugin's unit
tests for module_utils.

* Add nox formatting to LogAnalytics Ingestion

* Fix Log Analytics Ingestion urllib import

Remove the compatibility import via 'six' for 'urllib' since Python 2
support is no longer supported.

* Bump LogAnalytics Ingestion plugin version added

* Remove LogAnalytics Ingestion required: false docs

Required being false is the default, so no need to explicitly add it.

* Simplify LogAnalytics Ingestion role name logic

* Clean LogAnalytics Ingestion redundant comments

* Clean LogAnalytics Ingestion unit test code

Rename all Mock objects to use snake_case and consistently use '_mock'
as a suffix instead of sometimes using it as a prefix and sometimes
using it as a suffix.

* Refactor LogAnalytics Ingestion unit tests

Move all of the tests outside of the 'setUp' method.

* Refactor LogAnalytics Ingestion test

Add a test to validate that part of the contents sent match what was
supposed to be sent.

* Refactor LogAnalytics Ingestion test

Make the names consistent again.

* Add LogAnalytics Ingestion sample data docs

* Apply suggestions from code review



---------


(cherry picked from commit 38f93c80f1)

Co-authored-by: wtcline-intc <wade.cline@intel.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-21 11:43:16 +01:00
patchback[bot]
1d4fd21702 [PR #11471/34938ca1 backport][stable-12] keycloak_user_rolemapping: handle None response for client role lookup (#11522)
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



---------


(cherry picked from commit 34938ca1ef)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 20:50:15 +01:00
patchback[bot]
bfcdeeab91 [PR #11468/80d21f2a backport][stable-12] keycloak_realm_key: add full support for all Keycloak key providers (#11519)
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

(cherry picked from commit 80d21f2a0d)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
2026-02-18 18:36:48 +01:00
patchback[bot]
5dcb3b8f59 [PR #10841/986118c0 backport][stable-12] keycloak_realm_localization: new module - realm localization control (#11517)
keycloak_realm_localization: new module - realm localization control (#10841)

* add support for management of keycloak localizations

* unit test for keycloak localization support

* keycloak_realm_localization botmeta record

* rev: improvements after code review

(cherry picked from commit 986118c0af)

Co-authored-by: Jakub Danek <danekja@users.noreply.github.com>
2026-02-18 07:44:44 +01:00
patchback[bot]
42c20a754b [PR #11488/5e0fd120 backport][stable-12] ModuleHelper: ensure compatibility with ModuleTestCase (#11518)
ModuleHelper: ensure compatibility with `ModuleTestCase` (#11488)

* ModuleHelper: ensure compatibility with `ModuleTestCase`.

This change allows to configure the `module_fails_on_exception` decorator by passing a tuple of exception types that should not be handled by the decorator itself. In the context of `ModuleTestCase`, use `(AnsibleExitJson, AnsibleFailJson)` to let them pass through the decorator without modification.



* Another approach allowing user-defined exception types to pass through the decorator. When the decorator should have no arguments at all, we must hard code the name of the attribute that is looked up on self.



* Approach that removes decorator parametrization and relies on an object/class variable named `unhandled_exceptions`.



* context manager implemented that allows to pass through some exception types



* Update changelogs/fragments/11488-mh-ensure-compatibiliy-with-module-tests.yml



* Exception placeholder added



---------




(cherry picked from commit 5e0fd1201c)

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <cfiehe@users.noreply.github.com>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 07:26:47 +01:00
patchback[bot]
75b6b4d792 [PR #11461/4bbedfd7 backport][stable-12] nsupdate: fix missing keyring initialization without TSIG auth (#11516)
nsupdate: fix missing keyring initialization without TSIG auth (#11461)

* nsupdate: fix missing keyring initialization without TSIG auth

* Update changelogs/fragments/fix-nsupdate-keyring.yml



---------


(cherry picked from commit 4bbedfd7df)

Co-authored-by: Pascal <pascal.guinet@free.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 06:57:33 +01:00
patchback[bot]
a0c4308bed [PR #11503/85a0deee backport][stable-12] keycloak module utils: group search optimization (#11511)
keycloak module utils: group search optimization (#11503)

* Updated get_group_by_name with a query based lookup for improved speed

* Add changelog fragment for keycloak group search optimization

* Address review feedback: update changelog text and reformat code with ruff

* improved changelog fragment

* Update changelogs/fragments/11503-keycloak-group-search-optimization.yml



---------


(cherry picked from commit 85a0deeeba)

Co-authored-by: Andreas Wegmann <andreas.we9mann@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-14 21:14:52 +01:00
patchback[bot]
6437fe15c8 [PR #11486/c05c3133 backport][stable-12] seport: Add support for dccp and sctp protocols (#11509)
seport: Add support for dccp and sctp protocols (#11486)

Support for dccp and sctp protocols were added to SELinux userspace
python libraries in 3.0 version release in November 2019.

(cherry picked from commit c05c31334b)

Co-authored-by: Petr Lautrbach <lautrbach@redhat.com>
2026-02-14 21:14:44 +01:00
patchback[bot]
baddfa5a80 [PR #11501/ed7ccbe3 backport][stable-12] maven_artifact: resolve SNAPSHOT to latest using snapshot metadata block (#11508)
maven_artifact: resolve SNAPSHOT to latest using snapshot metadata block (#11501)

* fix(maven_artifact): resolve SNAPSHOT to latest using snapshot metadata block

Prefer the <snapshot> block (timestamp + buildNumber) from maven-metadata.xml
which always points to the latest build, instead of scanning <snapshotVersions>
and returning on the first match. Repositories like GitHub Packages keep all
historical entries in <snapshotVersions> (oldest first), causing the module to
resolve to the oldest snapshot instead of the latest.

Fixes #5117
Fixes #11489

* fix(maven_artifact): address review feedback

- Check both timestamp and buildNumber before using snapshot block,
  preventing IndexError when buildNumber is missing
- Remove unreliable snapshotVersions scanning fallback; use literal
  -SNAPSHOT version for non-unique snapshot repos instead
- Add tests for incomplete snapshot block and non-SNAPSHOT versions

* fix(maven_artifact): restore snapshotVersions scanning with last-match

Restore <snapshotVersions> scanning as primary resolution (needed for
per-extension accuracy per MNG-5459), but collect the last match instead
of returning on the first. Fall back to <snapshot> block when no
<snapshotVersions> match is found, then to literal -SNAPSHOT version.

* docs: update changelog fragment to match final implementation

* fix(maven_artifact): use updated timestamp for snapshot resolution

Use the <updated> attribute to select the newest snapshotVersion entry
instead of relying on list order. This works independently of how the
repository manager sorts entries in maven-metadata.xml.

Also fix test docstring and update changelog fragment per reviewer
feedback.

* test(maven_artifact): shuffle entries to verify updated timestamp sorting

Reorder snapshotVersion entries so the newest JAR is in the middle,
not at the end. This ensures the test actually validates that resolution
uses the <updated> timestamp rather than relying on list position.

(cherry picked from commit ed7ccbe3d4)

Co-authored-by: Adam R. <ariwk@protonmail.com>
2026-02-14 21:14:36 +01:00
patchback[bot]
b7d1483a08 [PR #11500/c9313af9 backport][stable-12] keycloak_identity_provider: add claims example for oidc-advanced-group-idp-mapper (#11507)
keycloak_identity_provider: add claims example for oidc-advanced-group-idp-mapper (#11500)

Add claims example for oidc-advanced-group-idp-mapper

For me it wasn't clear how to create claims using oidc-advanced-group-idp-mapper, perhaps other people can benefit from the following example.

(cherry picked from commit c9313af971)

Co-authored-by: David Filipe <68902816+daveopz@users.noreply.github.com>
2026-02-14 21:14:17 +01:00
patchback[bot]
b87121e1eb [PR #11504/8729f563 backport][stable-12] Update check_availability_service to return data instead of boolean (#11510)
Update check_availability_service to return data instead of boolean (#11504)

* Update check_availability_service to return data instead of boolean

* Add changelog fragment

(cherry picked from commit 8729f563b3)

Co-authored-by: Scott Seekamp <13857911+sseekamp@users.noreply.github.com>
2026-02-14 21:14:07 +01:00
patchback[bot]
cb17703c36 [PR #11495/88adca3f backport][stable-12] python_requirements_info: use importlib.metadata when available (#11496)
python_requirements_info: use importlib.metadata when available (#11495)

Use importlib.metadata when available.

(cherry picked from commit 88adca3fb4)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-11 07:12:04 +01:00
patchback[bot]
05d457dca7 [PR #11484/63ddca7f backport][stable-12] supervisorctl: remove unstable tag from integration tests (#11494)
supervisorctl: remove unstable tag from integration tests (#11484)

(cherry picked from commit 63ddca7f21)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-02-10 21:51:31 +01:00
patchback[bot]
7fce59fbc6 [PR #11479/476f2bf6 backport][stable-12] Integration tests: replace ansible_xxx with ansible_facts.xxx (#11480)
Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)

Replace ansible_xxx with ansible_facts.xxx.

(cherry picked from commit 476f2bf641)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-07 18:43:49 +01:00
patchback[bot]
de6967d3ff [PR #11473/df6d6269 backport][stable-12] keycloak_client: add valid_post_logout_redirect_uris and backchannel_logout_url (#11475)
keycloak_client: add valid_post_logout_redirect_uris and backchannel_logout_url (#11473)

* feat(keycloak_client): add valid_post_logout_redirect_uris and backchannel_logout_url

Add two new convenience parameters that map to client attributes:

- valid_post_logout_redirect_uris: sets post.logout.redirect.uris
  attribute (list items joined with ##)
- backchannel_logout_url: sets backchannel.logout.url attribute

These fields are not top-level in the Keycloak REST API but are stored
as client attributes. The new parameters provide a user-friendly
interface without requiring users to know the internal attribute names
and ##-separator format.

Fixes #6812, fixes #4892

* consolidate changelog and add PR link per review feedback

(cherry picked from commit df6d6269a6)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
2026-02-07 16:34:46 +01:00
patchback[bot]
bbb9b03b5e [PR #11464/8b0ce3e2 backport][stable-12] community.general.copr: clarify includepkgs/excludepkgs (#11476)
community.general.copr: clarify includepkgs/excludepkgs (#11464)

At first glance, includepkgs seems to be something that would install
the package name from the given copr repo.  This isn't helped by the
example that says "Install caddy" which very much looks like it is
installing the package from the repo.  Not only did I, a human,
hallucinate this behaviour, so did a large search engine's AI
responses to related queries.

In fact these are labels to vary what packages DNF sees.  Clarify this
by using wording and examples closer to the upstream documentation [1]

[1] https://dnf.readthedocs.io/en/latest/conf_ref.html

(cherry picked from commit 8b0ce3e28f)

Co-authored-by: Ian Wienand <ian@wienand.org>
2026-02-07 16:34:38 +01:00
patchback[bot]
a0d6487f6d [PR #11455/af4dbafe backport][stable-12] keycloak_client: fix diff for keycloak client auth flow overrides (#11477)
keycloak_client: fix diff for keycloak client auth flow overrides (#11455)

* 11430: fix diff for keycloak client auth flow overrides

* 11430: add changelog fragment

* 11430: move util function merge_settings_without_absent_nulls to the util functions file _keycloak_utils

* 11443: code cleanup

---------


(cherry picked from commit af4dbafe86)

Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
2026-02-07 16:34:29 +01:00
patchback[bot]
88bfb6dda3 [PR #11470/10681731 backport][stable-12] keycloak_realm_key: handle missing config fields for default keys (#11478)
keycloak_realm_key: handle missing config fields for default keys (#11470)

* fix(keycloak_realm_key): handle missing config fields for default keys

Keycloak API may not return 'active', 'enabled', or 'algorithm' fields
in the config response for default/auto-generated realm keys. This caused
a KeyError when the module tried to compare these fields during state
detection.

Use .get() with the expected value as default to handle missing fields
gracefully, treating them as unchanged if not present in the API response.

Fixes: #11459

* add PR link to changelog entry per review feedback

(cherry picked from commit 106817316d)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
2026-02-07 16:34:22 +01:00
patchback[bot]
d637db7623 [PR #11472/c41de53d backport][stable-12] keycloak: URL-encode query parameters for usernames with special characters (#11474)
keycloak: URL-encode query parameters for usernames with special characters (#11472)

* fix(keycloak): URL-encode query params for usernames with special chars

get_user_by_username() concatenates the username directly into the URL
query string. When the username contains a +, it is interpreted as a
space by the server, returning no match and causing a TypeError.

Use urllib.parse.quote() (already imported) for the username parameter.
Also replace three fragile .replace(' ', '%20') calls in the authz
search methods with proper quote() calls.

Fixes #10305

* Update changelogs/fragments/keycloak-url-encode-query-params.yml



---------


(cherry picked from commit c41de53dbb)

Co-authored-by: Ivan Kokalovic <67540157+koke1997@users.noreply.github.com>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-02-06 20:36:02 +01:00
patchback[bot]
2198588afa [PR #11454/b236772e backport][stable-12] keycloak_client: remove id's as change from diff for protocol mappers (#11469)
keycloak_client: remove id's as change from diff for protocol mappers (#11454)

* 11453 remove id's as change from diff for protocol mappers

* Update changelogs/fragments/11453-keycloak-client-protocol-mapper-ids.yml



---------


(cherry picked from commit b236772e57)

Co-authored-by: Simon Moosbrugger <707958+simonmoosbrugger@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-05 17:29:29 +01:00
Felix Fontein
9d6db6002c Add latest commit to .git-blame-ignore-revs.
(cherry picked from commit bce87a2a77)
2026-02-04 09:04:37 +01:00
patchback[bot]
dd9c86dfc0 [PR #11465/24098cd6 backport][stable-12] Reformat code (#11466)
Reformat code (#11465)

Reformat code.

(cherry picked from commit 24098cd638)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-04 09:04:00 +01:00
patchback[bot]
a266ba1d6e [PR #11457/95b24ac3 backport][stable-12] jboss: deprecation (#11458)
jboss: deprecation (#11457)

(cherry picked from commit 95b24ac3fe)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-01-31 10:03:36 +01:00
Felix Fontein
4167d8ebeb The next expected release will be 12.4.0. 2026-01-26 19:00:03 +01:00
Felix Fontein
e9064bbf97 Release 12.3.0. 2026-01-26 18:23:14 +01:00
patchback[bot]
79a5e6745b [PR #11444/ccf61224 backport][stable-12] keycloak_client: 11443: Fix false change detection for null client attributes (#11451)
keycloak_client: 11443: Fix false change detection for null client attributes (#11444)

* 11443: fix diff for keycloak_client module for non existing client attributes

* 11443: code cleanup

* 11443: add changelog fragment

* Adjust changelog fragment.

---------



(cherry picked from commit ccf61224f1)

Co-authored-by: thomasbargetz <thomas.bargetz@gmail.com>
Co-authored-by: Thomas Bargetz <thomas.bargetz@rise-world.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-26 17:43:17 +01:00
patchback[bot]
b5d57a35d6 [PR #11442/72220a2b backport][stable-12] fix gem module compatibility with ruby-4-rubygems (#11452)
fix gem module compatibility with ruby-4-rubygems (#11442)

* fix gem module compatibility with ruby-4-rubygems

rubygem's `query` command has recently been removed, see ruby/rubygems#9083.
address this by using the `list` command instead.

resolves #11397

* add changelog

* Adjust changelog fragment.

---------


(cherry picked from commit 72220a2b15)

Co-authored-by: glaszig <mail+github@glasz.org>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-26 17:43:07 +01:00
patchback[bot]
44dfe9e1ab [PR #11440/53e1e86b backport][stable-12] Logstash plugin version fix (#11450)
Logstash plugin version fix (#11440)

* logstash_plugin: fix argument order when using version parameter

* logstash_plugin: add integration tests

* logstash_plugin: add changelog fragment

(cherry picked from commit 53e1e86bcc)

Co-authored-by: Nicolas Boutet <amd3002@gmail.com>
2026-01-26 06:29:35 +01:00
patchback[bot]
4d05149b6c [PR #11368/aada8647 backport][stable-12] Adding 'project' parameter to Scaleway IP module. (#11447)
Adding 'project' parameter to Scaleway IP module. (#11368)

* Adding 'project' parameter to Scaleway IP module.

* Adding changelog fragment.

* Incrementing version.



* Updating docs to show both org and project ID options.

* Moving deprecated example to the end.

---------


(cherry picked from commit aada864718)

Co-authored-by: Greg Harvey <greg.harvey@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-25 21:05:27 +00:00
patchback[bot]
31bab91c31 [PR #11366/c0df3664 backport][stable-12] Adding 'project' parameter support for the Scaleway SG module. (#11448)
Adding 'project' parameter support for the Scaleway SG module. (#11366)

* Adding 'project' parameter support for the Scaleway SG module.

* Adding changelog fragment.

* Fixing documentation, organization is deprecated (although still available).

* Updating docs to show both org and project ID options.

* Incrementing version.



* Moving deprecated example to the end.

---------


(cherry picked from commit c0df366471)

Co-authored-by: Greg Harvey <greg.harvey@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-25 21:05:10 +00:00
patchback[bot]
ccdf82f163 [PR #11445/f9334656 backport][stable-12] Cleanup (#11446)
Cleanup (#11445)

* Correctly position BOTMETA entry.

* Standardize to 'import typing as t'.

* Remove platform attribute.

(cherry picked from commit f933465658)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-25 18:56:23 +01:00
patchback[bot]
1670f8693a [PR #11322/7a18af80 backport][stable-12] Handle @Redfish.Settings when setting ComputerSystem boot attributes (#11441)
Handle @Redfish.Settings  when setting ComputerSystem boot attributes (#11322)

* set_boot_override function now uses Redfish Settings URI if available in ComputerSystem resource

* Follows code formatting rules

* Add changelogs fragments file

* Update changelogs/fragments/11322-handle-redfish-settings-in-setbootoverride.yml



* Explicit rewriting as a workaround to keep the "good" path clean.

* Adjust changelog fragment.

---------




(cherry picked from commit 7a18af80ce)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-23 06:44:37 +01:00
patchback[bot]
d58777ff5e [PR #11423/864695f8 backport][stable-12] Add to_toml filter (#11438)
Add `to_toml` filter (#11423)

* Add to_toml filter

This is based heavily on the to_yaml filter, but
with a pared-down feature set.

* Protect import

* Don't quote datetime as a string

* Use Ansible error types

* Import correct error types

* Don't use AnsibleTypeError

It doesn't seem to be available on older Ansible
core versions.

* Fix antsibull-nox errors

* Install dependencies for to_toml integration test



* Reduce author list to main contributor



* Update version added for to_toml



* Use AnsibleError for missing import



* Use AnsibleFilterError for runtime type check



* Move common code to plugin_utils/_tags.py

* Mark module util as private



* Update BOTMETA for to_toml



* Fix typo

* Correct version number



* Use to_text for to_toml dict key conversions



* Add tomlkit requirement to docs



* Add missing import

* Add aliases for for to_toml integration test

---------


(cherry picked from commit 864695f898)

Co-authored-by: Matt Williams <matt@milliams.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-22 07:40:51 +01:00
patchback[bot]
68f2433577 [PR #11425/9fcd9338 backport][stable-12] nsupdate: add server FQDN and GSS-TSIG support (#11439)
nsupdate: add server FQDN and GSS-TSIG support (#11425)

* nsupdate: support server FQDN

Right now, the server has to be specified as an IPv4/IPv6 address. This
adds support for specifing the server as a FQDN as well.

* nsupdate: support GSS-TSIG/Kerberos

Add support for GSS-TSIG (Kerberos) keys to nsupdate. This makes life
easier when working with Windows DNS servers or Bind in a Kerberos
environment.

Inspiration taken from here:
https://github.com/rthalley/dnspython/pull/530#issuecomment-1363265732

Closes: #5730

* nsupdate: introduce query helper function

This simplifies the code by moving the protocol checks, etc, into a
single place.

* nsupdate: try all server IP addresses

Change resolve_server() to generate a list of IPv[46] addresses, then
try all of them in a round-robin fashion in query().

* nsupdate: some more cleanups

As suggested in the PR review.

* nsupdate: apply suggestions from code review



---------


(cherry picked from commit 9fcd9338b1)

Co-authored-by: David Härdeman <david@hardeman.nu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-22 07:38:12 +01:00
Felix Fontein
0f6dfd1ebb Prepare 12.3.0. 2026-01-20 22:42:03 +01:00
patchback[bot]
43f0152969 [PR #11421/9611dc25 backport][stable-12] time-command.py: make sure seconds is an int (#11436)
time-command.py: make sure seconds is an int (#11421)

Make sure seconds is an int.

(cherry picked from commit 9611dc258a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-20 22:41:12 +01:00
patchback[bot]
68bd8babf7 [PR #11114/a8378a4e backport][stable-12] nmcli idempotency connection check (#11437)
nmcli idempotency connection check (#11114)

* nmcli idempotency connection check

* Changelog fragment and ruff reformat

* Fix : change error handling

* Remove odd conditions

* Refactor nmcli: fix error handling and remove redundant logic

* Fix code format

* Fix error message to handle

(cherry picked from commit a8378a4eb0)

Co-authored-by: Seddik Alaoui Ismaili <32570331+saibug@users.noreply.github.com>
2026-01-20 22:21:14 +01:00
patchback[bot]
ca805badc0 [PR #11413/4b0aeede backport][stable-12] feat(nmcli): Add support for IPv6 routing rules (#11432)
feat(nmcli): Add support for IPv6 routing rules (#11413)

* feat(nmcli): Add support for IPv6 routing rules

Closes #7094



* Add changelog fragment



* Fixing doc



* Add issue link to changelog fragment



* Fix version



---------




(cherry picked from commit 4b0aeede69)

Signed-off-by: Rémy Jacquin <remy@remyj.fr>
Co-authored-by: Rémy Jacquin <1536771+remyj38@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-01-16 21:32:52 +01:00
patchback[bot]
5b571fd53f [PR #11308/4b67afc2 backport][stable-12] Add option for wsl_shell_type, protect wsl.exe arguments if SSH shell is Powershell (#11433)
Add option for wsl_shell_type, protect wsl.exe arguments if SSH shell is Powershell (#11308)

* feat(wsl): add option for wsl_shell_type, protect wsl arguments if SSH shell is Powershell

* docs(wsl): add changelog fragment

* docs(wsl): fix changelog fragment syntax, add issue link



* feat(wsl): improve new option documentation



* refactor(wsl): put integrasion test flag into a variable for convenience

* feat(wsl): rename option to wsl_remote_ssh_shell_type

* feat(wsl): escape "%" if shell is cmd, raise AnsibleError if powershell

* test(wsl): fix unit tests for wsl

- remove redundant check - moved to a separate function
- fix check for cmd escaping of "%"
- fix formatting / whitespace

* test(wsl): fix expected error message

* test(wsl): fix test - position of stop-parsing token changed



---------


(cherry picked from commit 4b67afc2b0)

Co-authored-by: fizmat <fizmat.r66@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-16 21:26:29 +01:00
patchback[bot]
68b2385efd [PR #11427/0a702167 backport][stable-12] Update ignore.txt (#11429)
Update ignore.txt (#11427)

Update ignore.txt.

(cherry picked from commit 0a70216763)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-15 22:17:43 +01:00
Felix Fontein
b5c965939f Make sure stable-12 CI runs in cron.
(cherry picked from commit 28b16eab66)
2026-01-11 00:43:09 +01:00
patchback[bot]
136c7debe3 [PR #11417/a689bb8e backport][stable-12] CI: Arch Linux switched to Python 3.14 (#11420)
CI: Arch Linux switched to Python 3.14 (#11417)

Arch Linux switched to Python 3.14.

(cherry picked from commit a689bb8e8d)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-11 00:42:54 +01:00
patchback[bot]
5d16a88298 [PR #11347/e790b950 backport][stable-12] incus connection: fix regex (#11415)
* incus connection: fix regex (#11347)

* incus connection: fix regex

* updates

* Apply suggestions from code review

* expand regexp capture

* add changelog frag

* Update plugins/connection/incus.py

* split arguments after command option

* Update plugins/connection/incus.py

* remove *() and split from the last command

* add tests, make small adjustments

* remove redundant strip()

* add more tests

* adjusted changelog fragment

(cherry picked from commit e790b95067)

* Order imports.

(cherry picked from commit 76d51db8d0)

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-09 21:22:29 +01:00
Felix Fontein
02ed21b2a6 [stable-12] Configure sorting imports in CI and formatting (#11414)
Configure sorting imports in CI and formatting (#11410)

* Add reformat commit to .git-blame-ignore-revs.

* Make ruff also check the import order.

* Add ruff check --fix for imports to the nox formatting session.

(cherry picked from commit 91efa27cb9)
2026-01-09 19:41:54 +00:00
patchback[bot]
b769b0bc01 [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409)
Sort imports with ruff check --fix (#11400)

Sort imports with ruff check --fix.

(cherry picked from commit 236b9c0e04)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-09 19:36:52 +01:00
patchback[bot]
ebaf2e71d5 [PR #11401/0e6ba072 backport][stable-12] Update CI pipelines (#11405)
Update CI pipelines (#11401)

Update CI pipelines:
- Fedora 42 -> 43 for devel
- RHEL 10.0 -> 10.1 for all ansible-core branches
- FreeBSD 13.5 -> 15.0 for devel
- Alpine 3.22 -> 3.23 for devel

(cherry picked from commit 0e6ba07261)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-08 12:28:46 +01:00
patchback[bot]
e3535de323 [PR #11396/c8356981 backport][stable-12] move imports from functions to the top of the file (#11399)
move imports from functions to the top of the file (#11396)

* move imports from functions to the top of the file

* add changelog frag

* Apply suggestions from code review



---------


(cherry picked from commit c8356981bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-07 21:27:49 +01:00
patchback[bot]
6169699b24 [PR #11388/defd1560 backport][stable-12] pmem: remove redundant use of regexp (#11398)
pmem: remove redundant use of regexp (#11388)

* pmem: remove redundant use of regexp

* add changelog frag

* add bugfixes extry

* Update plugins/modules/pmem.py



* Update plugins/modules/pmem.py



---------


(cherry picked from commit defd15609c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-07 20:50:56 +01:00
patchback[bot]
e714d15891 [PR #11390/996b7469 backport][stable-12] slackpkg: simplify function query_package() (#11395)
slackpkg: simplify function `query_package()` (#11390)

* slackpkg: simplify function query_package()

* add changelog frag

(cherry picked from commit 996b7469e5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-01-06 18:46:27 +01:00
patchback[bot]
dda90768f5 [PR #11391/b67c94fc backport][stable-12] fix ruff cases UP024,UP041 (#11394)
fix ruff cases UP024,UP041 (#11391)

* fix ruff cases UP024,UP041

* add changelog frag

(cherry picked from commit b67c94fc3f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2026-01-06 18:18:08 +01:00
patchback[bot]
cd548f779a [PR #11385/d1352702 backport][stable-12] CI: Let the Python formatters and linters apply to all files in the collection (#11386)
CI: Let the Python formatters and linters apply to all files in the collection (#11385)

Let the Python formatters and linters apply to all files in the collection.

(cherry picked from commit d1352702f9)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-06 17:02:36 +01:00
patchback[bot]
c1ba162ec0 [PR #11387/d4089ca2 backport][stable-12] Update RHEL 9.x to 9.7 in CI (#11389)
Update RHEL 9.x to 9.7 in CI (#11387)

* Update RHEL 9.x to 9.7 in CI.

* Add skips.

(cherry picked from commit d4089ca29a)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-06 17:02:28 +01:00
patchback[bot]
2d99eb92de [PR #11376/75234597 backport][stable-12] Support diff mode for netcup-dns module (#11378)
Support diff mode for netcup-dns module (#11376)

* support diff mode for netcup-dns module

* Fix issue with yaml encoding after testing

* Add changelog fragment

* Fixed: proper and robust yaml import

* Remove need for yaml import

* Show whole zone in diff for context

* Update changelogs/fragments/11376-netcup-dns-diff-mode.yml



* Update plugins/modules/netcup_dns.py



---------


(cherry picked from commit 75234597bc)

Co-authored-by: mqus <8398165+mqus@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-05 18:58:17 +01:00
patchback[bot]
e0bd7e334e [PR #11379/b3dc06a7 backport][stable-12] Clean up other Python files (#11382)
Clean up other Python files (#11379)

* Address issues found by ruff check.

* Make mypy happy; remove some Python 2 compat code.

* Also declare port1.

(cherry picked from commit b3dc06a7dd)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-05 18:57:50 +01:00
Felix Fontein
1d09a36e0f Fix version number.
(cherry picked from commit 00d2785794)
2026-01-05 18:57:41 +01:00
patchback[bot]
bb6d5fb735 [PR #11377/c00fb4fb backport][stable-12] cloudflare_dns: also allow 128 as a value for flag (#11383)
cloudflare_dns: also allow 128 as a value for flag (#11377)

* Also allow 128 as a value for flag.

* Forgot to add changelog fragment.

(cherry picked from commit c00fb4fb5c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-05 18:57:22 +01:00
patchback[bot]
8242f6fa46 [PR #11301/13035e2a backport][stable-12] Add support for multiple managers to get_manager_attributes command in idrac_redfish_info module (#11375)
Add support for multiple managers to get_manager_attributes command in idrac_redfish_info module (#11301)

* Update get_manager_attributes method to support systems with multiple managers present

Fixes https://github.com/ansible-collections/community.general/issues/11294

* Add changelog fragment
Pre-define reponse for get_manager_attributes method

* Update changelogs/fragments/11301-idrac-info-multi-manager.yml

Update per suggestion!



* Update plugins/modules/idrac_redfish_info.py
Remove extra manager quantity check



---------


(cherry picked from commit 13035e2a2c)

Co-authored-by: Scott Seekamp <13857911+sseekamp@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-02 19:29:33 +01:00
patchback[bot]
88eee5fbb4 [PR #11357/ddf05104 backport][stable-12] Add missing integration test aliases files (#11372)
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.

(cherry picked from commit ddf05104f3)

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-01-02 15:03:07 +01:00
patchback[bot]
5945c56b4c [PR #11369/20ba59cc backport][stable-12] Added "See Also" section (#11374)
Added "See Also" section (#11369)

* Added "See Also" section

* Corrected seealso documentation

* Update ini_file.py

Removed seealso descriptions

* Update to_ini.py

Removed seealso descriptions

* Update from_ini.py

Removed seealso descriptions

(cherry picked from commit 20ba59cce6)

Co-authored-by: daomah <129229601+daomah@users.noreply.github.com>
2026-01-02 15:02:56 +01:00
patchback[bot]
4514e271af [PR #11346/61d794f1 backport][stable-12] incus conn plugin: improve readability (was ruff: set target-python 3.7) (#11353)
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



* Update plugins/connection/incus.py

* Update plugins/connection/incus.py



---------


(cherry picked from commit 61d794f171)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-12-31 08:40:42 +01:00
patchback[bot]
f49c5f79a7 [PR #11343/e8f2b135 backport][stable-12] batch 3 - update Python idiom to 3.7 using pyupgrade (#11352)
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

(cherry picked from commit e8f2b135ba)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 22:43:24 +01:00
patchback[bot]
2d07481e64 [PR #11341/5b5f7e9e backport][stable-12] batch 1 - update Python idiom to 3.7 using pyupgrade (#11349)
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

(cherry picked from commit 5b5f7e9e64)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 16:47:11 +01:00
patchback[bot]
41f815be57 [PR #11344/543329ce backport][stable-12] batch 4 - update Python idiom to 3.7 using pyupgrade (#11350)
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

(cherry picked from commit 543329cecb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 16:31:29 +01:00
patchback[bot]
8d4e702d89 [PR #11340/a0d3bac8 backport][stable-12] cronvar: simplify exception raise - remove import sys (#11348)
cronvar: simplify exception raise - remove import sys (#11340)

* cronvar: simplify exception raise - remove import sys

* add changelog frag

(cherry picked from commit a0d3bac88c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 16:20:46 +01:00
patchback[bot]
303bac630a [PR #11342/266d9d3f backport][stable-12] batch 2 - update Python idiom to 3.7 using pyupgrade (#11345)
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

(cherry picked from commit 266d9d3fb0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2025-12-30 16:00:22 +01:00
Felix Fontein
213dc22217 The next expected release will be 12.3.0. 2025-12-29 15:27:28 +01:00
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
1408 changed files with 32099 additions and 10373 deletions

View File

@@ -29,6 +29,7 @@ schedules:
always: true
branches:
include:
- stable-12
- stable-11
- cron: 0 11 * * 0
displayName: Weekly (old stable branches)
@@ -69,6 +70,19 @@ stages:
- test: 2
- test: 3
- test: 4
- stage: Sanity_2_21
displayName: Sanity 2.21
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: 2.21/sanity/{0}
targets:
- test: 1
- test: 2
- test: 3
- test: 4
- stage: Sanity_2_20
displayName: Sanity 2.20
dependsOn: []
@@ -95,19 +109,6 @@ stages:
- test: 2
- test: 3
- test: 4
- stage: Sanity_2_18
displayName: Sanity 2.18
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Test {0}
testFormat: 2.18/sanity/{0}
targets:
- test: 1
- test: 2
- test: 3
- test: 4
### Units
- stage: Units_devel
displayName: Units devel
@@ -124,6 +125,19 @@ stages:
- test: '3.12'
- test: '3.13'
- test: '3.14'
- test: '3.15'
- stage: Units_2_21
displayName: Units 2.21
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.21/units/{0}/1
targets:
- test: 3.9
- test: "3.12"
- test: "3.14"
- stage: Units_2_20
displayName: Units 2.20
dependsOn: []
@@ -148,18 +162,6 @@ stages:
- test: 3.8
- test: "3.11"
- test: "3.13"
- stage: Units_2_18
displayName: Units 2.18
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: Python {0}
testFormat: 2.18/units/{0}/1
targets:
- test: 3.8
- test: "3.11"
- test: "3.13"
## Remote
- stage: Remote_devel_extra_vms
@@ -170,10 +172,10 @@ stages:
parameters:
testFormat: devel/{0}
targets:
- name: Alpine 3.22
test: alpine/3.22
# - name: Fedora 42
# test: fedora/42
- name: Alpine 3.23
test: alpine/3.23
# - name: Fedora 44
# test: fedora/44
- name: Ubuntu 22.04
test: ubuntu/22.04
- name: Ubuntu 24.04
@@ -188,16 +190,36 @@ stages:
parameters:
testFormat: devel/{0}
targets:
- name: macOS 15.3
test: macos/15.3
- name: RHEL 10.0
test: rhel/10.0
- name: RHEL 9.6
test: rhel/9.6
- name: FreeBSD 14.3
test: freebsd/14.3
- name: FreeBSD 13.5
test: freebsd/13.5
- name: macOS 26.3
test: macos/26.3
- name: RHEL 10.1
test: rhel/10.1
- name: RHEL 9.7
test: rhel/9.7
# TODO: enable this ASAP!
# - name: FreeBSD 15.0
# test: freebsd/15.0
# TODO: enable this ASAP!
# - name: FreeBSD 14.4
# test: freebsd/14.4
groups:
- 1
- 2
- 3
- stage: Remote_2_21
displayName: Remote 2.21
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.21/{0}
targets:
# - name: macOS 26.3
# test: macos/26.3
- name: RHEL 10.1
test: rhel/10.1
# - name: RHEL 9.7
# test: rhel/9.7
groups:
- 1
- 2
@@ -210,8 +232,10 @@ stages:
parameters:
testFormat: 2.20/{0}
targets:
- name: RHEL 10.0
test: rhel/10.0
- name: macOS 15.3
test: macos/15.3
- name: RHEL 10.1
test: rhel/10.1
- name: FreeBSD 14.3
test: freebsd/14.3
groups:
@@ -226,34 +250,14 @@ stages:
parameters:
testFormat: 2.19/{0}
targets:
- name: RHEL 9.5
test: rhel/9.5
- name: RHEL 10.0
test: rhel/10.0
- name: RHEL 10.1
test: rhel/10.1
- name: FreeBSD 14.2
test: freebsd/14.2
groups:
- 1
- 2
- 3
- stage: Remote_2_18
displayName: Remote 2.18
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.18/{0}
targets:
- name: macOS 14.3
test: macos/14.3
- name: RHEL 9.4
test: rhel/9.4
- name: FreeBSD 14.1
test: freebsd/14.1
groups:
- 1
- 2
- 3
### Docker
- stage: Docker_devel
@@ -264,10 +268,10 @@ stages:
parameters:
testFormat: devel/linux/{0}
targets:
- name: Fedora 42
test: fedora42
- name: Alpine 3.22
test: alpine322
- name: Fedora 44
test: fedora44
- name: Alpine 3.23
test: alpine323
- name: Ubuntu 22.04
test: ubuntu2204
- name: Ubuntu 24.04
@@ -276,6 +280,26 @@ stages:
- 1
- 2
- 3
- stage: Docker_2_21
displayName: Docker 2.21
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.21/linux/{0}
targets:
- name: Fedora 43
test: fedora43
# - name: Alpine 3.23
# test: alpine323
# - name: Ubuntu 22.04
# test: ubuntu2204
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 1
- 2
- 3
- stage: Docker_2_20
displayName: Docker 2.20
dependsOn: []
@@ -308,24 +332,6 @@ stages:
- 1
- 2
- 3
- stage: Docker_2_18
displayName: Docker 2.18
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: 2.18/linux/{0}
targets:
- name: Fedora 40
test: fedora40
- name: Alpine 3.20
test: alpine320
- name: Ubuntu 24.04
test: ubuntu2404
groups:
- 1
- 2
- 3
### Community Docker
- stage: Docker_community_devel
@@ -343,7 +349,7 @@ stages:
- name: Debian 13 Trixie
test: debian-13-trixie/3.13
- name: ArchLinux
test: archlinux/3.13
test: archlinux/3.14
groups:
- 1
- 2
@@ -361,6 +367,18 @@ stages:
# testFormat: devel/generic/{0}/1
# targets:
# - test: '3.9'
# - test: '3.13'
# - test: '3.15'
# - stage: Generic_2_21
# displayName: Generic 2.21
# dependsOn: []
# jobs:
# - template: templates/matrix.yml
# parameters:
# nameFormat: Python {0}
# testFormat: 2.21/generic/{0}/1
# targets:
# - test: '3.9'
# - test: '3.12'
# - test: '3.14'
# - stage: Generic_2_20
@@ -384,44 +402,33 @@ stages:
# testFormat: 2.19/generic/{0}/1
# targets:
# - test: '3.9'
# - test: '3.13'
# - stage: Generic_2_18
# displayName: Generic 2.18
# dependsOn: []
# jobs:
# - template: templates/matrix.yml
# parameters:
# nameFormat: Python {0}
# testFormat: 2.18/generic/{0}/1
# targets:
# - test: '3.8'
# - test: '3.13'
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity_devel
- Sanity_2_21
- Sanity_2_20
- Sanity_2_19
- Sanity_2_18
- Units_devel
- Units_2_21
- Units_2_20
- Units_2_19
- Units_2_18
- Remote_devel_extra_vms
- Remote_devel
- Remote_2_21
- Remote_2_20
- Remote_2_19
- Remote_2_18
- Docker_devel
- Docker_2_21
- Docker_2_20
- Docker_2_19
- Docker_2_18
- Docker_community_devel
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - Generic_devel
# - Generic_2_21
# - Generic_2_20
# - Generic_2_19
# - Generic_2_18
jobs:
- template: templates/coverage.yml

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 = f"Coverage {attempt} {label}"
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)
print('"%s" -> "%s"' % (source_path, destination_path))
destination_path = os.path.join(destination_directory, source_file + "." + label)
print(f'"{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(f"Coverage file count: {count}")
print(f"##vso[task.setVariable variable=coverageFileCount]{count}")
print(f"##vso[task.setVariable variable=outputPath]{output_path}")
if __name__ == '__main__':
if __name__ == "__main__":
main()

View File

@@ -15,7 +15,6 @@ import pathlib
import shutil
import subprocess
import tempfile
import typing as t
import urllib.request
@@ -23,7 +22,7 @@ import urllib.request
class CoverageFile:
name: str
path: pathlib.Path
flags: t.List[str]
flags: list[str]
@dataclasses.dataclass(frozen=True)
@@ -34,8 +33,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()
@@ -46,32 +45,36 @@ def parse_args() -> Args:
return Args(**kwargs)
def process_files(directory: pathlib.Path) -> t.Tuple[CoverageFile, ...]:
def process_files(directory: pathlib.Path) -> 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))
return tuple(processed)
def upload_files(codecov_bin: pathlib.Path, files: t.Tuple[CoverageFile, ...], dry_run: bool = False) -> None:
def upload_files(codecov_bin: pathlib.Path, files: tuple[CoverageFile, ...], dry_run: bool = False) -> None:
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 +82,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 +95,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))
seconds = int(time.time() - start)
sys.stdout.write(f"{seconds // 60:02}:{seconds % 60:02} {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

17
.devcontainer/setup.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/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
set -x
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,6 @@ eaa5e07b2866e05b6c7b5628ca92e9cb1142d008
# Code reformatting
340ff8586d4f1cb6a0f3c934eb42589bcc29c0ea
e530d2906a1f61df89861286ac57c951a247f32c
b769b0bc01520d12699d3911e1fc290b813cde40
dd9c86dfc094131f223ffb59e5a3d9f2dfc5875d

103
.github/BOTMETA.yml vendored
View File

@@ -65,6 +65,9 @@ files:
$callbacks/log_plays.py: {}
$callbacks/loganalytics.py:
maintainers: zhcli
$callbacks/loganalytics_ingestion.py:
ignore: zhcli
maintainers: pboushy vsh47 wtcline-intc
$callbacks/logdna.py: {}
$callbacks/logentries.py: {}
$callbacks/logstash.py:
@@ -133,6 +136,8 @@ files:
$doc_fragments/hwc.py:
labels: hwc
maintainers: $team_huawei
$doc_fragments/_icinga2_api.py:
maintainers: cfiehe
$doc_fragments/nomad.py:
maintainers: chris93111 apecnascimento
$doc_fragments/pipx.py:
@@ -216,6 +221,10 @@ files:
maintainers: resmo
$filters/to_time_unit.yml:
maintainers: resmo
$filters/to_toml.py:
maintainers: milliams
$filters/to_toml.yml:
maintainers: milliams
$filters/to_weeks.yml:
maintainers: resmo
$filters/to_yaml.py:
@@ -303,7 +312,7 @@ files:
$lookups/lmdb_kv.py:
maintainers: jpmens
$lookups/merge_variables.py:
maintainers: rlenferink m-a-r-k-e alpex8
maintainers: rlenferink m-a-r-k-e alpex8 cfiehe
$lookups/onepass:
labels: onepassword
maintainers: samdoran
@@ -358,6 +367,8 @@ files:
keywords: cloud huawei hwc
labels: huawei hwc_utils networking
maintainers: $team_huawei
$module_utils/_icinga2.py:
maintainers: cfiehe
$module_utils/identity/keycloak/keycloak.py:
maintainers: $team_keycloak
$module_utils/identity/keycloak/keycloak_clientsecret.py:
@@ -368,6 +379,13 @@ files:
$module_utils/jenkins.py:
labels: jenkins
maintainers: russoz
$module_utils/_crypt.py:
maintainers: russoz
$module_utils/_lxc.py:
maintainers: russoz
$module_utils/_lvm.py:
labels: lvm
maintainers: russoz
$module_utils/manageiq.py:
labels: manageiq
maintainers: $team_manageiq
@@ -592,6 +610,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:
@@ -627,6 +647,10 @@ files:
maintainers: adrianmoisey
$modules/github_repo.py:
maintainers: atorrescogollo
$modules/github_secrets.py:
maintainers: konstruktoid
$modules/github_secrets_info.py:
maintainers: konstruktoid
$modules/gitlab_:
keywords: gitlab source_control
maintainers: $team_gitlab
@@ -642,10 +666,10 @@ files:
maintainers: zvaraondrej
$modules/gitlab_milestone.py:
maintainers: gpongelli
$modules/gitlab_project_variable.py:
maintainers: markuman
$modules/gitlab_instance_variable.py:
maintainers: benibr
$modules/gitlab_project_variable.py:
maintainers: markuman
$modules/gitlab_runner.py:
maintainers: SamyCoenen
$modules/gitlab_user.py:
@@ -705,6 +729,8 @@ files:
maintainers: $team_huawei huaweicloud
$modules/ibm_sa_:
maintainers: tzure
$modules/icinga2_downtime.py:
maintainers: cfiehe
$modules/icinga2_feature.py:
maintainers: nerzhul
$modules/icinga2_host.py:
@@ -743,6 +769,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
@@ -750,14 +778,14 @@ files:
maintainers: abakanovskii
$modules/ipa_dnsrecord.py:
maintainers: $team_ipa jwbernin
$modules/ipbase_info.py:
maintainers: dominikkukacka
$modules/ipa_pwpolicy.py:
maintainers: adralioh
$modules/ipa_service.py:
maintainers: cprh
$modules/ipa_vault.py:
maintainers: jparrill
$modules/ipbase_info.py:
maintainers: dominikkukacka
$modules/ipify_facts.py:
maintainers: resmo
$modules/ipinfoio_facts.py:
@@ -817,16 +845,22 @@ files:
maintainers: elfelip Gaetan2907
$modules/keycloak_authentication_required_actions.py:
maintainers: Skrekulko
$modules/keycloak_authentication_v2.py:
maintainers: thomasbargetz
$modules/keycloak_authz_authorization_scope.py:
maintainers: mattock
$modules/keycloak_authz_permission.py:
maintainers: mattock
$modules/keycloak_authz_custom_policy.py:
maintainers: mattock
$modules/keycloak_authz_permission.py:
maintainers: mattock
$modules/keycloak_authz_permission_info.py:
maintainers: mattock
$modules/keycloak_client.py:
maintainers: koke1997
$modules/keycloak_client_rolemapping.py:
maintainers: Gaetan2907
$modules/keycloak_client_rolescope.py:
maintainers: desand01
$modules/keycloak_clientscope.py:
maintainers: Gaetan2907
$modules/keycloak_clientscope_type.py:
@@ -837,6 +871,8 @@ files:
maintainers: fynncfchen johncant
$modules/keycloak_component.py:
maintainers: fivetide
$modules/keycloak_component_info.py:
maintainers: desand01
$modules/keycloak_group.py:
maintainers: adamgoossens
$modules/keycloak_identity_provider.py:
@@ -846,25 +882,23 @@ files:
$modules/keycloak_realm_info.py:
maintainers: fynncfchen
$modules/keycloak_realm_key.py:
maintainers: mattock
maintainers: mattock koke1997
$modules/keycloak_realm_localization.py:
maintainers: danekja
$modules/keycloak_realm_rolemapping.py:
maintainers: agross mhuysamen Gaetan2907
$modules/keycloak_role.py:
maintainers: laurpaum
$modules/keycloak_user.py:
maintainers: elfelip
$modules/keycloak_user_federation.py:
maintainers: laurpaum
$modules/keycloak_userprofile.py:
maintainers: yeoldegrove
$modules/keycloak_component_info.py:
maintainers: desand01
$modules/keycloak_client_rolescope.py:
maintainers: desand01
$modules/keycloak_user_rolemapping.py:
maintainers: bratwurzt
$modules/keycloak_realm_rolemapping.py:
maintainers: agross mhuysamen Gaetan2907
$modules/keycloak_user_execute_actions_email.py:
maintainers: mariusbertram
$modules/keycloak_user_federation.py:
maintainers: laurpaum
$modules/keycloak_user_rolemapping.py:
maintainers: bratwurzt koke1997
$modules/keycloak_userprofile.py:
maintainers: yeoldegrove
$modules/keyring.py:
maintainers: ahussey-redhat
$modules/keyring_info.py:
@@ -907,6 +941,8 @@ files:
labels: logentries
$modules/logentries_msg.py:
maintainers: jcftang
$modules/logrotate.py:
maintainers: a-gabidullin
$modules/logstash_plugin.py:
maintainers: nerzhul
$modules/lvg.py:
@@ -929,6 +965,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
@@ -1305,8 +1345,11 @@ files:
$modules/snap_alias.py:
labels: snap
maintainers: russoz
$modules/snap_connect.py:
labels: snap
maintainers: russoz
$modules/snmp_facts.py:
maintainers: ogenstad ujwalkomarla
maintainers: ogenstad ujwalkomarla lalten
$modules/solaris_zone.py:
keywords: beadm dladm illumos ipadm nexenta omnios openindiana pfexec smartos solaris sunos zfs zpool
labels: solaris
@@ -1323,6 +1366,8 @@ files:
maintainers: farhan7500 gautamphegde
$modules/ssh_config.py:
maintainers: gaqzi Akasurde
$modules/sssd_info.py:
maintainers: a-gabidullin
$modules/stacki_host.py:
labels: stacki_host
maintainers: bsanders bbyhuy
@@ -1479,22 +1524,24 @@ files:
ignore: matze
labels: zypper
maintainers: $team_suse
$plugin_utils/ansible_type.py:
maintainers: vbotka
$modules/zypper_repository_info.py:
labels: zypper
maintainers: $team_suse TobiasZeuch181
$plugin_utils/ansible_type.py:
maintainers: vbotka
$plugin_utils/keys_filter.py:
maintainers: vbotka
$plugin_utils/unsafe.py:
maintainers: felixfontein
$plugin_utils/_tags.py:
maintainers: felixfontein
$tests/a_module.py:
maintainers: felixfontein
$tests/ansible_type.py:
maintainers: vbotka
$tests/fqdn_valid.py:
maintainers: vbotka
#########################
#########################
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:
@@ -1533,6 +1580,8 @@ files:
maintainers: russoz
docs/docsite/rst/guide_deps.rst:
maintainers: russoz
docs/docsite/rst/guide_ee.rst:
maintainers: russoz
docs/docsite/rst/guide_iocage.rst:
maintainers: russoz felixfontein
docs/docsite/rst/guide_iocage_inventory.rst:
@@ -1563,7 +1612,7 @@ files:
maintainers: russoz
docs/docsite/rst/test_guide.rst:
maintainers: felixfontein
#########################
#########################
tests/:
labels: tests
tests/integration:
@@ -1590,7 +1639,7 @@ macros:
plugin_utils: plugins/plugin_utils
tests: plugins/test
team_ansible_core:
team_aix: MorrisA bcoca d-little flynn1973 gforster kairoaraujo marvin-sinister mator molekuul ramooncamacho wtcross
team_aix: MorrisA bcoca d-little flynn1973 gforster kairoaraujo marvin-sinister molekuul ramooncamacho wtcross
team_bsd: JoergFiedler MacLemon bcoca dch jasperla mekanix opoplawski overhacked tuxillo
team_consul: sgargan apollo13 Ilgmi
team_cyberark_conjur: jvanderhoof ryanprior
@@ -1611,7 +1660,7 @@ macros:
team_redfish: mraineri tomasg2012 xmadsen renxulei rajeevkallur bhavya06 jyundt
team_rhsm: cnsnyder ptoscano
team_scaleway: remyleone abarbare
team_solaris: bcoca fishman jasperla jpdasma mator scathatheworm troy2914 xen0l
team_solaris: bcoca fishman jasperla jpdasma scathatheworm troy2914 xen0l
team_suse: commel evrardjp lrupp AnderEnder alxgu andytom sealor
team_virt: joshainglis karmab Thulium-Drake Ajpantuso
team_wdc: mikemoerk

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

@@ -30,6 +30,7 @@ jobs:
matrix:
ansible:
- '2.17'
- '2.18'
runs-on: ubuntu-latest
steps:
- name: Perform sanity testing
@@ -63,6 +64,12 @@ jobs:
python: '3.10'
- ansible: '2.17'
python: '3.12'
- ansible: '2.18'
python: '3.8'
- ansible: '2.18'
python: '3.11'
- ansible: '2.18'
python: '3.13'
steps:
- name: >-
@@ -144,6 +151,52 @@ jobs:
# docker: default
# python: '3.12'
# target: azp/generic/1/
# 2.18
- ansible: '2.18'
docker: fedora40
python: ''
target: azp/posix/1/
- ansible: '2.18'
docker: fedora40
python: ''
target: azp/posix/2/
- ansible: '2.18'
docker: fedora40
python: ''
target: azp/posix/3/
- ansible: '2.18'
docker: ubuntu2404
python: ''
target: azp/posix/1/
- ansible: '2.18'
docker: ubuntu2404
python: ''
target: azp/posix/2/
- ansible: '2.18'
docker: ubuntu2404
python: ''
target: azp/posix/3/
- ansible: '2.18'
docker: alpine320
python: ''
target: azp/posix/1/
- ansible: '2.18'
docker: alpine320
python: ''
target: azp/posix/2/
- ansible: '2.18'
docker: alpine320
python: ''
target: azp/posix/3/
# Right now all generic tests are disabled. Uncomment when at least one of them is re-enabled.
# - ansible: '2.18'
# docker: default
# python: '3.8'
# target: azp/generic/1/
# - ansible: '2.18'
# docker: default
# python: '3.13'
# target: azp/generic/1/
steps:
- name: >-

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

View File

@@ -14,6 +14,8 @@ warn_redundant_casts = True
# warn_return_any = True
warn_unreachable = True
exclude = tests/integration/targets/django_.*/files/.*
[mypy-ansible.*]
# ansible-core has partial typing information
follow_untyped_imports = True
@@ -24,6 +26,10 @@ follow_untyped_imports = True
# 3. That have no types and type stubs.
[mypy-aerospike.*]
ignore_missing_imports = True
[mypy-antsibull_nox.*]
ignore_missing_imports = True
[mypy-asyncore.*]
ignore_missing_imports = True
[mypy-boto3.*]
ignore_missing_imports = True
[mypy-bs4.*]
@@ -38,6 +44,8 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-crypt.*]
ignore_missing_imports = True
[mypy-daemon.*]
ignore_missing_imports = True
[mypy-datadog.*]
ignore_missing_imports = True
[mypy-dbus.*]
@@ -62,6 +70,8 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-github3.*]
ignore_missing_imports = True
[mypy-gssapi.*]
ignore_missing_imports = True
[mypy-hashids.*]
ignore_missing_imports = True
[mypy-heroku3.*]
@@ -122,6 +132,10 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-nomad.*]
ignore_missing_imports = True
[mypy-nopackagewiththisname.*]
ignore_missing_imports = True
[mypy-nox.*]
ignore_missing_imports = True
[mypy-oci.*]
ignore_missing_imports = True
[mypy-oneandone.*]
@@ -144,6 +158,8 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-pingdom.*]
ignore_missing_imports = True
[mypy-pkg_resources.*]
ignore_missing_imports = True
[mypy-portage.*]
ignore_missing_imports = True
[mypy-potatoes_that_will_never_be_there.*]
@@ -174,6 +190,8 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-rpm.*]
ignore_missing_imports = True
[mypy-ruamel.yaml.*]
ignore_missing_imports = True
[mypy-salt.*]
ignore_missing_imports = True
[mypy-selinux.*]
@@ -186,6 +204,10 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-sha.*]
ignore_missing_imports = True
[mypy-smtpd.*]
ignore_missing_imports = True
[mypy-smtpd_tls.*]
ignore_missing_imports = True
[mypy-SoftLayer.*]
ignore_missing_imports = True
[mypy-spotinst_sdk.*]
@@ -198,10 +220,14 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-thycotic.*]
ignore_missing_imports = True
[mypy-tomlkit.*]
ignore_missing_imports = True
[mypy-univention.*]
ignore_missing_imports = True
[mypy-vexatapi.*]
ignore_missing_imports = True
[mypy-voluptuous.*]
ignore_missing_imports = True
[mypy-websocket.*]
ignore_missing_imports = True
[mypy-XenAPI.*]

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.15.9
hooks:
# Run the linter.
- id: ruff-check
# Run the formatter.
- id: ruff-format

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

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,38 +20,43 @@ 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
The following commands show how to run ansible-test sanity tests:
The following commands show how to run ruff format:
```.bash
# Run all configured formatters:
@@ -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,13 +33,13 @@ 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
Tested with the current ansible-core 2.17, ansible-core 2.18, ansible-core 2.19, ansible-core 2.20 releases and the current development version of ansible-core. Ansible-core versions before 2.17.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
Tested with the current ansible-core 2.17, ansible-core 2.18, ansible-core 2.19, ansible-core 2.20, ansible-core 2.21 releases and the current development version of ansible-core. Ansible-core versions before 2.17.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases.
## External requirements
@@ -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

@@ -20,8 +20,15 @@ stable_branches = [ "stable-*" ]
[sessions]
[sessions.lint]
code_files = ["."] # consider all Python files in the collection
run_isort = false
run_black = false
run_ruff_autofix = true
ruff_autofix_config = "ruff.toml"
ruff_autofix_select = [
"I",
"RUF022",
]
run_ruff_check = true
ruff_check_config = "ruff.toml"
run_ruff_format = true

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
bugfixes:
- scaleway_image_info, scaleway_ip_info, scaleway_organization_info, scaleway_security_group_info, scaleway_server_info, scaleway_snapshot_info, scaleway_volume_info - fix ``NoneType`` error when the Scaleway API returns an empty or non-JSON response body (https://github.com/ansible-collections/community.general/issues/11361, https://github.com/ansible-collections/community.general/pull/11918).

View File

@@ -0,0 +1,2 @@
minor_changes:
- "mattermost, rocketchat, slack - update default ``icon_url`` to ansible favicon (https://github.com/ansible-collections/community.general/pull/11909)."

View File

@@ -0,0 +1 @@
release_summary: Regular bugfix release.

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

@@ -8,6 +8,9 @@ sections:
toctree:
- filter_guide
- test_guide
- title: Deployment Guides
toctree:
- guide_ee
- title: Technology Guides
toctree:
- guide_alicloud

View File

@@ -6,11 +6,11 @@
import sys
from io import StringIO
from ruamel.yaml import YAML
from ruamel.yaml import YAML # type: ignore[import-not-found]
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

@@ -0,0 +1,114 @@
..
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
.. _ansible_collections.community.general.docsite.guide_ee:
Execution Environment Guide
===========================
`Ansible Execution Environments <https://docs.ansible.com/projects/ansible/latest/getting_started_ee/index.html>`_
(EEs) are container images that bundle ansible-core, collections, and their Python and system dependencies.
They are the standard runtime for Red Hat Ansible Automation Platform and AWX, replacing the older virtualenv model.
They can also be used outside of RHAAP and AWX by using `ansible-navigator <https://docs.ansible.com/projects/navigator/>`__, or by using ansible-runner directly.
What runs in the EE
^^^^^^^^^^^^^^^^^^^
Only **controller-side plugins** run inside the EE. Their Python and system dependencies must be installed there.
This includes: lookup plugins, inventory plugins, callback plugins, connection plugins, become plugins, and filter plugins.
Modules run on the managed nodes and are transferred there at runtime — their dependencies must be present on the
target, not in the EE.
.. note::
Modules delegated to ``localhost`` (for example, those that interact with a remote API) are an exception:
they run on the controller and their dependencies must therefore be available in the EE.
Why community.general does not provide EE metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``community.general`` ships dozens of controller-side plugins covering a very broad range of technologies.
Bundling the dependencies for all of them into a single EE image would almost certainly create irreconcilable
conflicts — both within the collection and with other collections or tools (such as ``ansible-lint``) that
share the same image.
For that reason, ``community.general`` does **not** provide Python or system package dependency metadata.
Users are expected to build purpose-built, minimal EEs containing only the dependencies
required by the specific plugins they actually use.
Finding the dependencies you need
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Every plugin that has external dependencies documents them in its ``requirements`` field.
You can inspect those with ``ansible-doc``:
.. code-block:: shell
$ ansible-doc -t lookup community.general.some_lookup | grep -A 10 "REQUIREMENTS"
Or browse the plugin's documentation page on `docs.ansible.com <https://docs.ansible.com/ansible/latest/collections/community/general/>`_.
For example, a lookup plugin that wraps an external service might list:
.. code-block:: yaml
requirements:
- some-python-library >= 1.2
An inventory plugin backed by a REST API might list:
.. code-block:: yaml
requirements:
- requests
- some-sdk
These are the packages you need to add to your EE.
Building a minimal EE with ansible-builder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`ansible-builder <https://docs.ansible.com/projects/builder/en/latest/>`_ is the standard tool for creating EEs.
Install it with:
.. code-block:: shell
$ pip install ansible-builder
Create an ``execution-environment.yml`` **in your own project** — not inside ``community.general``
that includes only the dependencies needed for the plugins you use:
.. code-block:: yaml
version: 3
dependencies:
galaxy:
collections:
- name: community.general
python:
- some-python-library>=1.2
- requests
system:
- libxml2-devel [platform:rpm]
images:
base_image:
name: ghcr.io/ansible/community-ee-base:latest
Then build the image:
.. code-block:: shell
$ ansible-builder build -t my-custom-ee:latest
.. seealso::
- `ansible-builder documentation <https://docs.ansible.com/projects/builder/en/latest/>`_
- `Building EEs with ansible-builder <https://ansible-builder.readthedocs.io/en/latest/definition/>`_
- `Issue #2968 — original request for EE requirements support <https://github.com/ansible-collections/community.general/issues/2968>`_
- `Issue #4512 — design discussion for EE support in community.general <https://github.com/ansible-collections/community.general/issues/4512>`_

View File

@@ -12,7 +12,7 @@ The inventory plugin :ansplugin:`community.general.iocage#inventory` gets the in
See:
* `iocage - A FreeBSD Jail Manager <https://iocage.readthedocs.io/en/latest>`_
* `iocage - A FreeBSD Jail Manager <https://freebsd.github.io/iocage/>`_
* `man iocage <https://man.freebsd.org/cgi/man.cgi?query=iocage>`_
* `Jails and Containers <https://docs.freebsd.org/en/books/handbook/jails>`_

View File

@@ -20,7 +20,7 @@ As root at the iocage host, create three VNET jails with a DHCP interface from t
shell> iocage create --template ansible_client --name srv_3 bpf=1 dhcp=1 vnet=1
srv_3 successfully created!
See: `Configuring a VNET Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-vnet-jail>`_.
See: `Configuring VNET <https://freebsd.github.io/iocage/networking.html#vimage-vnet>`_.
As admin at the controller, list the jails:
@@ -115,7 +115,7 @@ Optionally, create shared IP jails:
| None | srv_3 | off | down | jail | 14.2-RELEASE-p3 | em0|10.1.0.103/24 | - | ansible_client | no |
+------+-------+------+-------+------+-----------------+-------------------+-----+----------------+----------+
See: `Configuring a Shared IP Jail <https://iocage.readthedocs.io/en/latest/networking.html#configuring-a-shared-ip-jail>`_
See: `Configuring a Shared IP Jail <https://freebsd.github.io/iocage/networking.html#shared-ip>`_
If iocage needs environment variable(s), use the option :ansopt:`community.general.iocage#inventory:env`. For example,

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.6.1
readme: README.md
authors:
- Ansible (https://github.com/ansible)
@@ -16,6 +16,8 @@ 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
build_ignore:
- .nox

View File

@@ -21,6 +21,7 @@ action_groups:
keycloak:
- keycloak_authentication
- keycloak_authentication_required_actions
- keycloak_authentication_v2
- keycloak_authz_authorization_scope
- keycloak_authz_custom_policy
- keycloak_authz_permission
@@ -40,6 +41,7 @@ action_groups:
- keycloak_realm
- keycloak_realm_key
- keycloak_realm_keys_metadata_info
- keycloak_realm_localization
- keycloak_realm_rolemapping
- keycloak_role
- keycloak_user
@@ -370,6 +372,26 @@ plugin_routing:
tombstone:
removal_version: 3.0.0
warning_text: Use community.general.hpilo_info instead.
aix_devices:
deprecation:
removal_version: 15.0.0
warning_text: Use ibm.power_aix.devices instead. The C(ibm.power_aix) collection is actively maintained by IBM.
aix_filesystem:
deprecation:
removal_version: 15.0.0
warning_text: Use ibm.power_aix.filesystem instead. The C(ibm.power_aix) collection is actively maintained by IBM.
aix_inittab:
deprecation:
removal_version: 15.0.0
warning_text: Use ibm.power_aix.inittab instead. The C(ibm.power_aix) collection is actively maintained by IBM.
aix_lvg:
deprecation:
removal_version: 15.0.0
warning_text: Use ibm.power_aix.lvg instead. The C(ibm.power_aix) collection is actively maintained by IBM.
aix_lvol:
deprecation:
removal_version: 15.0.0
warning_text: Use ibm.power_aix.lvol instead. The C(ibm.power_aix) collection is actively maintained by IBM.
idrac_firmware:
redirect: dellemc.openmanage.idrac_firmware
idrac_redfish_facts:
@@ -378,6 +400,10 @@ plugin_routing:
warning_text: Use community.general.idrac_redfish_info instead.
idrac_server_config_profile:
redirect: dellemc.openmanage.idrac_server_config_profile
jboss:
deprecation:
removal_version: 14.0.0
warning_text: Use role middleware_automation.wildfly.wildfly_app_deploy instead.
jenkins_job_facts:
tombstone:
removal_version: 3.0.0
@@ -398,6 +424,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 +863,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 +1063,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 +1176,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 +1200,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 +1235,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

@@ -9,14 +9,14 @@
import os
import sys
import nox
import nox # type: ignore[import-not-found]
# Whether the noxfile is running in CI:
IN_CI = os.environ.get("CI") == "true"
try:
import antsibull_nox
import antsibull_nox # type: ignore[import-not-found]
except ImportError:
print("You need to install antsibull-nox in the same Python environment as nox.")
sys.exit(1)

View File

@@ -5,11 +5,12 @@
from __future__ import annotations
import time
import typing as t
from ansible.plugins.action import ActionBase
from ansible.errors import AnsibleActionFail, AnsibleConnectionFailure
from ansible.utils.vars import merge_hash
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
from ansible.utils.vars import merge_hash
display = Display()
@@ -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

@@ -6,20 +6,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.errors import AnsibleConnectionFailure, AnsibleError
from ansible.module_utils.common.collections import is_string
from ansible.module_utils.common.text.converters import to_native, to_text
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 +65,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 +89,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 +114,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 +127,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 +149,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 +157,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 +179,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 +187,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

@@ -82,9 +82,26 @@ options:
- name: ansible_doas_prompt_l10n
env:
- name: ANSIBLE_DOAS_PROMPT_L10N
allow_pipelining:
description:
- When set to V(true), do allow pipelining with ansible-core 2.19+.
- This should only be used when doas is configured to not ask for a password (C(nopass)).
type: boolean
default: false
version_added: 12.4.0
ini:
- section: doas_become_plugin
key: allow_pipelining
vars:
- name: ansible_doas_allow_pipelining
env:
- name: ANSIBLE_DOAS_ALLOW_PIPELINING
notes:
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
- This become plugin does not work when connection pipelining is enabled
and doas requests a password.
With ansible-core 2.19+, using this plugin automatically disables pipelining,
unless O(allow_pipelining=true) is explicitly set by the user.
On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
"""
import re
@@ -101,8 +118,11 @@ class BecomeModule(BecomeBase):
missing = ("Authorization required",)
# See https://github.com/ansible-collections/community.general/issues/9977,
# https://github.com/ansible/ansible/pull/78111
pipelining = False
# https://github.com/ansible/ansible/pull/78111,
# https://github.com/ansible-collections/community.general/issues/11411
@property
def pipelining(self) -> bool: # type: ignore[override]
return self.get_option("allow_pipelining")
def check_password_prompt(self, b_output):
"""checks if the expected password prompt exists in b_output"""

View File

@@ -92,9 +92,8 @@ EXAMPLES = r"""
from re import compile as re_compile
from ansible.plugins.become import BecomeBase
from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.become import BecomeBase
ansi_color_codes = re_compile(to_bytes(r"\x1B\[[0-9;]+m"))
@@ -125,7 +124,10 @@ class BecomeModule(BecomeBase):
flags = self.get_option("become_flags")
user = self.get_option("become_user")
return f"{become} -q shell {flags} {user}@ {self._build_success_command(cmd, shell)}"
# SYSTEMD_COLORS=0 stops machinectl from appending ANSI reset
# sequences (ESC[0m, ESC[J) after the child exits, which would
# otherwise land after the module JSON and break result parsing.
return f"SYSTEMD_COLORS=0 {become} -q shell {flags} {user}@ {self._build_success_command(cmd, shell)}"
def check_success(self, b_output):
b_output = self.remove_ansi_codes(b_output)

View File

@@ -59,6 +59,7 @@ notes:
"""
from shlex import quote as shlex_quote
from ansible.plugins.become import BecomeBase

View File

@@ -4,7 +4,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: run0
short_description: Systemd's run0
@@ -61,6 +60,8 @@ options:
type: string
notes:
- This plugin only works when a C(polkit) rule is in place.
- This become plugin does not work when connection pipelining is enabled. With ansible-core 2.19+, using it automatically
disables pipelining. On ansible-core 2.18 and before, pipelining must explicitly be disabled by the user.
"""
EXAMPLES = r"""
@@ -78,8 +79,8 @@ EXAMPLES = r"""
from re import compile as re_compile
from ansible.plugins.become import BecomeBase
from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.become import BecomeBase
ansi_color_codes = re_compile(to_bytes(r"\x1B\[[0-9;]+m"))
@@ -92,6 +93,10 @@ class BecomeModule(BecomeBase):
success = ("==== AUTHENTICATION COMPLETE ====",)
require_tty = True # see https://github.com/ansible-collections/community.general/issues/6932
# See https://github.com/ansible/ansible/issues/81254,
# https://github.com/ansible/ansible/pull/78111
pipelining = False
@staticmethod
def remove_ansi_codes(line):
return ansi_color_codes.sub(b"", line)
@@ -106,7 +111,11 @@ class BecomeModule(BecomeBase):
flags = self.get_option("become_flags")
user = self.get_option("become_user")
return f"{become} --user={user} {flags} {self._build_success_command(cmd, shell)}"
# SYSTEMD_COLORS=0 stops run0 from emitting terminal control
# sequences (window title OSC, ANSI reset) around the child
# command, which would otherwise corrupt the module JSON and
# break result parsing.
return f"SYSTEMD_COLORS=0 {become} --user={user} {flags} {self._build_success_command(cmd, shell)}"
def check_success(self, b_output):
b_output = self.remove_ansi_codes(b_output)

View File

@@ -49,11 +49,11 @@ options:
import collections
import os
import time
from multiprocessing import Lock
from collections.abc import MutableSet
from itertools import chain
from multiprocessing import Lock
from ansible.errors import AnsibleError
from collections.abc import MutableSet
from ansible.plugins.cache import BaseCacheModule
from ansible.utils.display import Display

View File

@@ -66,17 +66,17 @@ options:
section: defaults
"""
import json
import re
import time
import json
from ansible.errors import AnsibleError
from ansible.parsing.ajson import AnsibleJSONEncoder, AnsibleJSONDecoder
from ansible.parsing.ajson import AnsibleJSONDecoder, AnsibleJSONEncoder
from ansible.plugins.cache import BaseCacheModule
from ansible.utils.display import Display
try:
from redis import StrictRedis, VERSION
from redis import VERSION, StrictRedis
HAS_REDIS = True
except ImportError:
@@ -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

@@ -46,9 +46,8 @@ options:
import os
import yaml
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.parsing.yaml.loader import AnsibleLoader
from ansible.plugins.cache import BaseFileCacheModule
@@ -58,7 +57,7 @@ class CacheModule(BaseFileCacheModule):
"""
def _load(self, filepath):
with open(os.path.abspath(filepath), "r", encoding="utf-8") as f:
with open(os.path.abspath(filepath), encoding="utf-8") as f:
return AnsibleLoader(f).get_single_data()
def _dump(self, value, filepath):

View File

@@ -41,8 +41,8 @@ options:
key: cur_mem_file
"""
import time
import threading
import time
from ansible.plugins.callback import CallbackBase

View File

@@ -23,9 +23,9 @@ requirements:
"""
from ansible import constants as C
from ansible.playbook.task_include import TaskInclude
from ansible.plugins.callback import CallbackBase
from ansible.utils.color import colorize, hostcolor
from ansible.playbook.task_include import TaskInclude
class CallbackModule(CallbackBase):
@@ -157,6 +157,8 @@ class CallbackModule(CallbackBase):
msg = f"changed: {self._host_counter}/{self._host_total} [{result._host.get_name()}]"
color = C.COLOR_CHANGED
else:
if not self._plugin_options.get("display_ok_hosts", True):
return
if delegated_vars:
msg = f"ok: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> {delegated_vars['ansible_host']}]"
else:

View File

@@ -27,13 +27,13 @@ try:
except ImportError:
pass
import sys
from collections.abc import MutableMapping, MutableSequence
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
from ansible.utils.color import colorize, hostcolor
from ansible.utils.display import Display
import sys
display = Display()

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:
@@ -778,10 +778,11 @@ playbook.yml: >-
import sys
from contextlib import contextmanager
from ansible.module_utils.common.text.converters import to_text
from ansible.plugins.callback.default import CallbackModule as Default
from ansible.template import Templar
from ansible.vars.manager import VariableManager
from ansible.plugins.callback.default import CallbackModule as Default
from ansible.module_utils.common.text.converters import to_text
try:
from ansible.template import trust_as_template # noqa: F401, pylint: disable=unused-import

View File

@@ -81,7 +81,6 @@ import getpass
import socket
import time
import uuid
from collections import OrderedDict
from contextlib import closing
from os.path import basename
@@ -92,7 +91,7 @@ from ansible.plugins.callback import CallbackBase
ELASTIC_LIBRARY_IMPORT_ERROR: ImportError | None
try:
from elasticapm import Client, capture_span, trace_parent_from_string, instrument, label
from elasticapm import Client, capture_span, instrument, label, trace_parent_from_string
except ImportError as imp_exc:
ELASTIC_LIBRARY_IMPORT_ERROR = imp_exc
else:
@@ -145,7 +144,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 +200,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 +223,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

@@ -27,16 +27,15 @@ options:
key: log_folder
"""
import json
import os
import time
import json
from ansible.utils.path import makedirs_safe
from ansible.module_utils.common.text.converters import to_bytes
from collections.abc import MutableMapping
from ansible.module_utils.common.text.converters import to_bytes
from ansible.parsing.ajson import AnsibleJSONEncoder
from ansible.plugins.callback import CallbackBase
from ansible.utils.path import makedirs_safe
# NOTE: in Ansible 1.2 or later general logging is available without
# this plugin, just set ANSIBLE_LOG_PATH as an environment variable

View File

@@ -51,14 +51,13 @@ examples: |-
shared_key = dZD0kCbKl3ehZG6LHFMuhtE0yHiFCmetzFMc2u+roXIUQuatqU924SsAAAAPemhjbGlAemhjbGktTUJQAQIDBA==
"""
import base64
import getpass
import hashlib
import hmac
import base64
import json
import uuid
import socket
import getpass
import uuid
from os.path import basename
from ansible.module_utils.ansible_release import __version__ as ansible_version

View File

@@ -0,0 +1,342 @@
#!/usr/bin/env python
# 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
from __future__ import annotations
DOCUMENTATION = """
name: loganalytics_ingestion
type: notification
short_description: Posts task results to an Azure Log Analytics workspace using the new Logs Ingestion API
author:
- Wade Cline (@wtcline-intc) <wade.cline@intel.com>
- Sriramoju Vishal Bharath (@vsh47) <sriramoju.vishal.bharath@intel.com>
- Cyrus Li (@zhcli) <cyrus1006@gmail.com>
description:
- This callback plugin will post task results in JSON format to an Azure Log Analytics workspace using the new Logs Ingestion API.
version_added: "12.4.0"
requirements:
- The callback plugin has been enabled.
- An Azure Log Analytics workspace has been established.
- A Data Collection Rule (DCR) and custom table are created.
options:
dce_url:
description: URL of the Data Collection Endpoint (DCE) for Azure Logs Ingestion API.
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_DCE_URL
ini:
- section: callback_loganalytics
key: dce_url
dcr_id:
description: Data Collection Rule (DCR) ID for the Azure Log Ingestion API.
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_DCR_ID
ini:
- section: callback_loganalytics
key: dcr_id
disable_attempts:
description:
- When O(disable_on_failure=true), number of plugin failures that must occur before the plugin is disabled.
- This helps prevent outright plugin failure from a single, transient network issue.
type: int
default: 3
env:
- name: ANSIBLE_LOGANALYTICS_DISABLE_ATTEMPTS
ini:
- section: callback_loganalytics
key: disable_attempts
disable_on_failure:
description: Stop trying to send data on plugin failure.
type: bool
default: true
env:
- name: ANSIBLE_LOGANALYTICS_DISABLE_ON_FAILURE
ini:
- section: callback_loganalytics
key: disable_on_failure
client_id:
description: Client ID of the Azure App registration for OAuth2 authentication ("Modern Authentication").
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_CLIENT_ID
ini:
- section: callback_loganalytics
key: client_id
client_secret:
description: Client Secret of the Azure App registration.
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_CLIENT_SECRET
ini:
- section: callback_loganalytics
key: client_secret
include_content:
description: Send the content to the Azure Log Analytics workspace.
type: bool
default: false
env:
- name: ANSIBLE_LOGANALYTICS_INCLUDE_CONTENT
ini:
- section: callback_loganalytics
key: include_content
include_task_args:
description: Send the task args to the Azure Log Analytics workspace.
type: bool
default: false
env:
- name: ANSIBLE_LOGANALYTICS_INCLUDE_TASK_ARGS
ini:
- section: callback_loganalytics
key: include_task_args
stream_name:
description: The name of the stream used to send the logs to the Azure Log Analytics workspace.
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_STREAM_NAME
ini:
- section: callback_loganalytics
key: stream_name
tenant_id:
description: Tenant ID for the Azure Active Directory.
type: str
required: true
env:
- name: ANSIBLE_LOGANALYTICS_TENANT_ID
ini:
- section: callback_loganalytics
key: tenant_id
timeout:
description: Timeout for the HTTP requests to the Azure Log Analytics API.
type: int
default: 2
env:
- name: ANSIBLE_LOGANALYTICS_TIMEOUT
ini:
- section: callback_loganalytics
key: timeout
seealso:
- name: Logs Ingestion API
description: Overview of Logs Ingestion API in Azure Monitor
link: https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview
notes:
- Triple verbosity logging (C(-vvv)) can be used to generate JSON sample data for creating the table schema in Azure Log Analytics.
Search for the string C(Event Data:) in the output in order to locate the data sample.
"""
EXAMPLES = """
examples: |
Enable the plugin in ansible.cfg:
[defaults]
callback_enabled = community.general.loganalytics_ingestion
Set the environment variables:
export ANSIBLE_LOGANALYTICS_DCE_URL=https://my-dce.ingest.monitor.azure.com
export ANSIBLE_LOGANALYTICS_DCR_ID=dcr-xxxxxx
export ANSIBLE_LOGANALYTICS_CLIENT_ID=xxxxxxxx
export ANSIBLE_LOGANALYTICS_CLIENT_SECRET=xxxxxxxx
export ANSIBLE_LOGANALYTICS_TENANT_ID=xxxxxxxx
export ANSIBLE_LOGANALYTICS_STREAM_NAME=Custom-MyTable
"""
import getpass
import json
import socket
import uuid
from datetime import datetime, timedelta, timezone
from os.path import basename
from urllib.parse import urlencode
from ansible.module_utils.urls import open_url
from ansible.plugins.callback import CallbackBase
from ansible.utils.display import Display
display = Display()
class AzureLogAnalyticsIngestionSource:
def __init__(
self,
dce_url,
dcr_id,
disable_attempts,
disable_on_failure,
client_id,
client_secret,
tenant_id,
stream_name,
include_task_args,
include_content,
timeout,
fqcn,
):
self.dce_url = dce_url
self.dcr_id = dcr_id
self.disabled = False
self.disable_attempts = disable_attempts
self.disable_on_failure = disable_on_failure
self.client_id = client_id
self.client_secret = client_secret
self.failures = 0
self.tenant_id = tenant_id
self.stream_name = stream_name
self.include_task_args = include_task_args
self.include_content = include_content
self.token_expiration_time = None
self.session = str(uuid.uuid4())
self.host = socket.gethostname()
self.user = getpass.getuser()
self.timeout = timeout
self.fqcn = fqcn
self.bearer_token = self.get_bearer_token()
# OAuth2 authentication method to get a Bearer token
# This replaces the shared_key authentication mechanism
def get_bearer_token(self):
url = f"https://login.microsoftonline.com/{self.tenant_id}/oauth2/v2.0/token"
headers = {"Content-Type": "application/x-www-form-urlencoded"}
data = urlencode(
{
"grant_type": "client_credentials",
"client_id": self.client_id,
"client_secret": self.client_secret,
# The scope value comes from https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview#headers
# and https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#the-default-scope
"scope": "https://monitor.azure.com/.default",
}
)
response = open_url(url, data=data, force=True, headers=headers, method="POST", timeout=self.timeout)
j = json.loads(response.read().decode("utf-8"))
self.token_expiration_time = datetime.now() + timedelta(seconds=j.get("expires_in"))
return j.get("access_token")
def is_token_valid(self):
return datetime.now() + timedelta(seconds=10) < self.token_expiration_time
# Method to send event data to the Azure Logs Ingestion API
# This replaces the legacy API call and now uses the Logs Ingestion API endpoint
def send_event(self, event_data):
if not self.is_token_valid():
self.bearer_token = self.get_bearer_token()
ingestion_url = (
f"{self.dce_url}/dataCollectionRules/{self.dcr_id}/streams/{self.stream_name}?api-version=2023-01-01"
)
headers = {"Authorization": f"Bearer {self.bearer_token}", "Content-Type": "application/json"}
open_url(ingestion_url, data=json.dumps(event_data), headers=headers, method="POST", timeout=self.timeout)
def _rfc1123date(self):
return datetime.now(timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")
# This method wraps the private method with the appropriate error handling.
def send_to_loganalytics(self, playbook_name, result, state):
if self.disabled:
return
try:
self._send_to_loganalytics(playbook_name, result, state)
except Exception as e:
display.warning(f"{self.fqcn} callback plugin failure: {e}.")
if self.disable_on_failure:
self.failures += 1
if self.failures >= self.disable_attempts:
display.warning(
f"{self.fqcn} callback plugin failures exceed maximum of '{self.disable_attempts}'! Disabling plugin!"
)
self.disabled = True
else:
display.v(f"{self.fqcn} callback plugin failure {self.failures}/{self.disable_attempts}")
def _send_to_loganalytics(self, playbook_name, result, state):
ansible_role = str(result._task._role) if result._task._role else None
# Include/Exclude task args
if not self.include_task_args:
result._task_fields.pop("args", None)
# Include/Exclude content
if not self.include_content:
result._result.pop("content", None)
# Build the event data
event_data = [
{
"TimeGenerated": self._rfc1123date(),
"Host": result._host.name,
"User": self.user,
"Playbook": playbook_name,
"Role": ansible_role,
"TaskName": result._task.get_name(),
"Task": result._task_fields,
"Action": result._task_fields["action"],
"State": state,
"Result": result._result,
"Session": self.session,
}
]
# The data displayed here can be used as a sample file in order to create the table's schema.
display.vvv(f"Event Data: {json.dumps(event_data)}")
self.send_event(event_data)
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = "notification"
CALLBACK_NAME = "loganalytics_ingestion"
CALLBACK_NEEDS_ENABLED = True
def __init__(self, display=None):
super().__init__(display=display)
self.start_datetimes = {}
self.playbook_name = None
self.azure_loganalytics = None
self.fqcn = f"community.general.{self.CALLBACK_NAME}"
def set_options(self, task_keys=None, var_options=None, direct=None):
super().set_options(task_keys=task_keys, var_options=var_options, direct=direct)
# Set options for the new Azure Logs Ingestion API configuration
self.client_id = self.get_option("client_id")
self.client_secret = self.get_option("client_secret")
self.dce_url = self.get_option("dce_url")
self.dcr_id = self.get_option("dcr_id")
self.disable_attempts = self.get_option("disable_attempts")
self.disable_on_failure = self.get_option("disable_on_failure")
self.include_content = self.get_option("include_content")
self.include_task_args = self.get_option("include_task_args")
self.stream_name = self.get_option("stream_name")
self.tenant_id = self.get_option("tenant_id")
self.timeout = self.get_option("timeout")
# Initialize the AzureLogAnalyticsIngestionSource with the new settings
self.azure_loganalytics = AzureLogAnalyticsIngestionSource(
self.dce_url,
self.dcr_id,
self.disable_attempts,
self.disable_on_failure,
self.client_id,
self.client_secret,
self.tenant_id,
self.stream_name,
self.include_task_args,
self.include_content,
self.timeout,
self.fqcn,
)
def v2_playbook_on_start(self, playbook):
self.playbook_name = basename(playbook._file_name)
# Build event data and send it to the Logs Ingestion API
def v2_runner_on_failed(self, result, **kwargs):
self.azure_loganalytics.send_to_loganalytics(self.playbook_name, result, "FAILED")
def v2_runner_on_ok(self, result, **kwargs):
self.azure_loganalytics.send_to_loganalytics(self.playbook_name, result, "OK")

View File

@@ -55,12 +55,13 @@ options:
default: ansible
"""
import logging
import json
import logging
import socket
from uuid import getnode
from ansible.plugins.callback import CallbackBase
from ansible.parsing.ajson import AnsibleJSONEncoder
from ansible.plugins.callback import CallbackBase
try:
from logdna import LogDNAHandler

View File

@@ -96,8 +96,8 @@ examples: >-
"""
import os
import socket
import random
import socket
import time
import uuid
@@ -178,7 +178,7 @@ class PlainTextSocketAppender:
while True:
try:
self._conn.send(to_bytes(multiline, errors="surrogate_or_strict"))
except socket.error:
except OSError:
self.reopen_connection()
continue
break
@@ -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

@@ -94,12 +94,13 @@ ansible.cfg: |
}
"""
import os
import json
from ansible import context
import logging
import os
import socket
import uuid
import logging
from ansible import context
try:
import logstash

View File

@@ -79,10 +79,10 @@ options:
version_added: 8.2.0
"""
import email.utils
import json
import os
import re
import email.utils
import smtplib
from ansible.module_utils.common.text.converters import to_bytes

View File

@@ -148,15 +148,15 @@ from ansible.plugins.callback import CallbackBase
OTEL_LIBRARY_IMPORT_ERROR: ImportError | None
try:
from opentelemetry import trace
from opentelemetry.trace import SpanKind
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter as GRPCOTLPSpanExporter
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter as HTTPOTLPSpanExporter
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
from opentelemetry.trace.status import Status, StatusCode
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, SimpleSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
from opentelemetry.trace import SpanKind
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
from opentelemetry.trace.status import Status, StatusCode
except ImportError as imp_exc:
OTEL_LIBRARY_IMPORT_ERROR = imp_exc
else:
@@ -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

@@ -22,7 +22,7 @@ ansible.cfg: |-
callbacks_enabled=community.general.print_task
"""
from yaml import load, dump
from yaml import dump, load
try:
from yaml import CSafeDumper as SafeDumper

View File

@@ -18,9 +18,9 @@ description:
- This plugin uses C(say) or C(espeak) to "speak" about play events.
"""
import os
import platform
import subprocess
import os
from ansible.module_utils.common.process import get_bin_path
from ansible.plugins.callback import CallbackBase

View File

@@ -39,9 +39,8 @@ EXAMPLES = r"""
import difflib
from ansible import constants as C
from ansible.plugins.callback import CallbackBase
from ansible.module_utils.common.text.converters import to_text
from ansible.plugins.callback import CallbackBase
DONT_COLORIZE = False
COLORS = {

View File

@@ -83,11 +83,10 @@ examples: >-
authtoken = f23blad6-5965-4537-bf69-5b5a545blabla88
"""
import json
import uuid
import socket
import getpass
import json
import socket
import uuid
from os.path import basename
from ansible.module_utils.ansible_release import __version__ as ansible_version
@@ -255,7 +254,7 @@ class CallbackModule(CallbackBase):
self._runtime(result),
)
def runner_on_async_failed(self, result, **kwargs):
def v2_runner_on_async_failed(self, result, **kwargs):
self.splunk.send_event(
self.url,
self.authtoken,

View File

@@ -40,11 +40,10 @@ examples: |-
url = https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/R8moSv1d8EW9LAUFZJ6dbxCFxwLH6kfCdcBfddlfxCbLuL-BN5twcTpMk__pYy_cDmp==
"""
import json
import uuid
import socket
import getpass
import json
import socket
import uuid
from os.path import basename
from ansible.module_utils.ansible_release import __version__ as ansible_version

View File

@@ -56,7 +56,6 @@ options:
import logging
import logging.handlers
import socket
from ansible.plugins.callback import CallbackBase
@@ -129,7 +128,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

@@ -5,7 +5,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: timestamp
type: stdout
@@ -49,12 +48,13 @@ extends_documentation_fragment:
"""
import sys
import types
from datetime import datetime
from ansible.module_utils.common.text.converters import to_text
from ansible.plugins.callback.default import CallbackModule as Default
from ansible.utils.display import get_text_width
from ansible.module_utils.common.text.converters import to_text
from datetime import datetime
import types
import sys
# Store whether the zoneinfo module is available
_ZONEINFO_AVAILABLE = sys.version_info >= (3, 9)
@@ -89,7 +89,7 @@ def banner(self, msg, color=None, cows=True):
msg = msg.strip()
try:
star_len = self.columns - get_text_width(msg) - timestamp_len
except EnvironmentError:
except OSError:
star_len = self.columns - len(msg) - timestamp_len
if star_len <= 3:
star_len = 3
@@ -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

@@ -20,11 +20,12 @@ requirements:
"""
from os.path import basename
from ansible import constants as C
from ansible import context
from ansible.module_utils.common.text.converters import to_text
from ansible.utils.color import colorize, hostcolor
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
from ansible.utils.color import colorize, hostcolor
class CallbackModule(CallbackModule_default):

View File

@@ -80,7 +80,7 @@ from ansible.errors import AnsibleError
from ansible.module_utils.basic import is_executable
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.connection import ConnectionBase, BUFSIZE
from ansible.plugins.connection import BUFSIZE, ConnectionBase
from ansible.utils.display import Display
display = Display()
@@ -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 OSError 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

@@ -35,8 +35,8 @@ except ImportError:
pass
import os
import tempfile
import shutil
import tempfile
from ansible.errors import AnsibleError
from ansible.plugins.connection import ConnectionBase

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,9 +78,10 @@ options:
"""
import os
from subprocess import call, Popen, PIPE
import re
from subprocess import PIPE, Popen, call
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
from ansible.errors import AnsibleConnectionFailure, AnsibleError, AnsibleFileNotFound
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes, to_text
from ansible.plugins.connection import ConnectionBase
@@ -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)?)"?\s+(?P<args>.*)(?P<command>-c(?:ommand)?)\s+(?P<post_args>.*(\n.*)*)',
re.IGNORECASE,
)
self.cmd_regex_pattern = re.compile(
r'^"?(?P<executable>(?:[a-z]:\\)?[a-z0-9 ()\\.]*cmd(?:\.exe)?)"?\s+(?P<args>.*)(?P<command>/c)\s+(?P<post_args>.*)',
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()
@@ -110,24 +131,55 @@ class Connection(ConnectionBase):
def _build_command(self, cmd) -> list[str]:
"""build the command to execute on the incus host"""
# Force pseudo-terminal allocation if the active become plugin
# requires one (e.g. community.general.machinectl), otherwise the
# become helper runs without a controlling tty and silently fails.
require_tty = self.become is not None and getattr(self.become, "require_tty", False)
exec_cmd: list[str] = [
self._incus_cmd,
"--project",
self.get_option("project"),
"exec",
*(["-T"] if getattr(self._shell, "_IS_WINDOWS", False) else []),
*(["-t"] if require_tty and not 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):
regex_pattern = self.powershell_regex_pattern
elif regex_match := self.cmd_regex_pattern.match(cmd):
regex_pattern = self.cmd_regex_pattern
exec_cmd.extend([self.get_option("executable"), "-c", cmd])
if regex_match:
self._display.vvvvvv(
f'Found keyword: "{regex_match.group("command")}" based on regex: {regex_pattern.pattern}',
host=self._instance(),
)
# To avoid splitting on a space contained in the path, set the executable as the first argument.
exec_cmd.append(regex_match.group("executable"))
if args := regex_match.group("args"):
exec_cmd.extend(args.strip().split(" "))
# Set the command argument depending on cmd or powershell and the rest of it
exec_cmd.append(regex_match.group("command"))
if post_args := regex_match.group("post_args"):
exec_cmd.append(post_args.strip())
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 +252,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

@@ -33,11 +33,12 @@ options:
import subprocess
from ansible_collections.community.general.plugins.connection.jail import Connection as Jail
from ansible.module_utils.common.text.converters import to_native
from ansible.errors import AnsibleError
from ansible.module_utils.common.text.converters import to_native
from ansible.utils.display import Display
from ansible_collections.community.general.plugins.connection.jail import Connection as Jail
display = Display()

View File

@@ -42,7 +42,7 @@ from shlex import quote as shlex_quote
from ansible.errors import AnsibleError
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
from ansible.plugins.connection import ConnectionBase, BUFSIZE
from ansible.plugins.connection import BUFSIZE, ConnectionBase
from ansible.utils.display import Display
display = Display()
@@ -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 OSError 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

@@ -31,12 +31,12 @@ options:
- name: ansible_lxc_executable
"""
import errno
import fcntl
import os
import select
import shutil
import traceback
import select
import fcntl
import errno
HAS_LIBLXC = False
try:
@@ -94,7 +94,7 @@ class Connection(ConnectionBase):
while len(read_fds) > 0 or len(write_fds) > 0:
try:
ready_reads, ready_writes, dummy = select.select(read_fds, write_fds, [])
except select.error as e:
except OSError as e:
if e.args[0] == errno.EINTR:
continue
raise
@@ -173,9 +173,9 @@ class Connection(ConnectionBase):
raise errors.AnsibleFileNotFound(msg)
try:
src_file = open(in_path, "rb")
except IOError:
except OSError 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 OSError 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 OSError 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 OSError 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

@@ -74,9 +74,9 @@ options:
"""
import os
from subprocess import Popen, PIPE
from subprocess import PIPE, Popen
from ansible.errors import AnsibleError, AnsibleConnectionFailure, AnsibleFileNotFound
from ansible.errors import AnsibleConnectionFailure, AnsibleError, AnsibleFileNotFound
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes, to_text
from ansible.plugins.connection import ConnectionBase
@@ -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

@@ -9,7 +9,6 @@
from __future__ import annotations
DOCUMENTATION = r"""
name: qubes
short_description: Interact with an existing QubesOS AppVM
@@ -40,9 +39,9 @@ options:
import subprocess
from ansible.errors import AnsibleConnectionFailure
from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.connection import ConnectionBase, ensure_connect
from ansible.errors import AnsibleConnectionFailure
from ansible.utils.display import Display
display = Display()

View File

@@ -16,8 +16,8 @@ description:
- This allows you to use existing Saltstack infrastructure to connect to targets.
"""
import os
import base64
import os
from ansible import errors
from ansible.plugins.connection import ConnectionBase

View File

@@ -231,6 +231,18 @@ options:
required: true
vars:
- name: wsl_distribution
wsl_remote_ssh_shell_type:
description:
- The shell type expected in the SSH session (not inside the WSL session).
- See also C(ansible_shell_type).
type: string
choices:
- cmd
- powershell
default: cmd
vars:
- name: wsl_remote_ssh_shell_type
version_added: 12.2.0
wsl_user:
description:
- WSL distribution user.
@@ -312,25 +324,25 @@ import io
import os
import pathlib
import shlex
import socket
import tempfile
import traceback
import typing as t
from binascii import hexlify
from subprocess import list2cmdline
from ansible.errors import (
AnsibleAuthenticationFailure,
AnsibleConnectionFailure,
AnsibleError,
)
from ansible_collections.community.general.plugins.module_utils._filelock import FileLock, LockTimeout
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
from ansible.playbook.play_context import PlayContext
from ansible.plugins.connection import ConnectionBase
from ansible.utils.display import Display
from ansible.utils.path import makedirs_safe
from binascii import hexlify
from subprocess import list2cmdline
from ansible_collections.community.general.plugins.module_utils._filelock import FileLock, LockTimeout
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
PARAMIKO_IMPORT_ERR: str | None
try:
@@ -416,7 +428,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 +469,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)
@@ -475,14 +487,14 @@ class Connection(ConnectionBase):
try:
ssh.load_system_host_keys(ssh_known_hosts)
break
except IOError:
except OSError:
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 +530,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
@@ -576,18 +590,32 @@ class Connection(ConnectionBase):
wsl_distribution = self.get_option("wsl_distribution")
become = self.get_option("become")
become_user = self.get_option("become_user")
wsl_remote_ssh_shell_type = self.get_option("wsl_remote_ssh_shell_type")
is_integration_test = os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_WAERI5TEPHEESHA2FAE8")
if "%" in cmd:
if wsl_remote_ssh_shell_type == "powershell":
# there is no universal way to escape '%' here
# if this is raised, add a workaround to allow the specific situation (if possible)
raise AnsibleError("The command contains '%', cannot safely escape it for Powershell")
else:
cmd = cmd.replace("%", "^%")
if become and become_user:
wsl_user = become_user
else:
wsl_user = self.get_option("wsl_user")
args = ["wsl.exe", "--distribution", wsl_distribution]
args = ["wsl.exe"]
if wsl_remote_ssh_shell_type == "powershell" and not is_integration_test:
# Powershell stop-parsing token, treat the rest as arguments to the native command wsl.exe
args.append("--%")
args.extend(["--distribution", wsl_distribution])
if wsl_user:
args.extend(["--user", wsl_user])
args.extend(["--"])
args.extend(shlex.split(cmd))
if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_Waeri5tepheeSha2fae8"):
if is_integration_test:
return shlex.join(args)
return list2cmdline(args) # see https://github.com/python/cpython/blob/3.11/Lib/subprocess.py#L576
else:
return list2cmdline(args) # see https://github.com/python/cpython/blob/3.11/Lib/subprocess.py#L576
def exec_command(self, cmd: str, in_data: bytes | None = None, sudoable: bool = True) -> tuple[int, bytes, bytes]:
"""run a command on inside a WSL distribution"""
@@ -609,18 +637,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 +693,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 TimeoutError 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 +727,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 +746,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 +800,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

@@ -35,7 +35,7 @@ from shlex import quote as shlex_quote
from ansible.errors import AnsibleError
from ansible.module_utils.common.process import get_bin_path
from ansible.module_utils.common.text.converters import to_bytes
from ansible.plugins.connection import ConnectionBase, BUFSIZE
from ansible.plugins.connection import BUFSIZE, ConnectionBase
from ansible.utils.display import Display
display = Display()
@@ -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 OSError 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

@@ -0,0 +1,30 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2026 Christoph Fiehe <christoph.fiehe@gmail.com>
# Note that this doc fragment is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations
class ModuleDocFragment:
# Use together with ansible.builtin.url and icinga2_argument_spec from
# ansible_collections.community.general.plugins.module_utils._icinga2
DOCUMENTATION = r"""
options:
url:
description:
- URL of the Icinga 2 REST API.
type: str
required: true
ca_path:
description:
- CA certificates bundle to use to verify the Icinga 2 server certificate.
type: path
timeout:
description:
- How long to wait for the server to send data before giving up.
type: int
default: 10
"""

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

@@ -2,6 +2,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
from __future__ import annotations
DOCUMENTATION = r"""
name: accumulate
short_description: Produce a list of accumulated sums of the input list contents
@@ -41,8 +43,8 @@ EXAMPLES = r"""
# Produces ['a', 'ab', 'abc']
"""
from itertools import accumulate
from collections.abc import Sequence
from itertools import accumulate
from ansible.errors import AnsibleFilterError

View File

@@ -34,9 +34,10 @@ _value:
type: dictionary
"""
from ansible.errors import AnsibleFilterError
from collections.abc import Sequence
from collections import Counter
from collections.abc import Sequence
from ansible.errors import AnsibleFilterError
def counter(sequence):
@@ -51,7 +52,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

@@ -4,8 +4,8 @@
from __future__ import annotations
from ansible.errors import AnsibleFilterError
from ansible.module_utils.common.text.converters import to_bytes
from ansible.module_utils.common.collections import is_string
from ansible.module_utils.common.text.converters import to_bytes
try:
from zlib import crc32

View File

@@ -80,11 +80,11 @@ _value:
from ansible.errors import AnsibleFilterError
from ansible_collections.community.general.plugins.module_utils.csv import (
CSVError,
CustomDialectFailureError,
DialectNotAvailableError,
initialize_dialect,
read_csv,
CSVError,
DialectNotAvailableError,
CustomDialectFailureError,
)
@@ -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

@@ -16,6 +16,20 @@ options:
description: A string containing an INI document.
type: string
required: true
delimiters:
description: A list of characters used as delimiters in the INI document.
type: list
elements: string
default:
- "="
- ":"
version_added: 12.4.0
seealso:
- plugin: community.general.to_ini
plugin_type: filter
- plugin: ansible.builtin.ini
plugin_type: lookup
- module: community.general.ini_file
"""
EXAMPLES = r"""
@@ -43,17 +57,21 @@ _value:
"""
from io import StringIO
from configparser import ConfigParser
from io import StringIO
from ansible.errors import AnsibleFilterError
from ansible.module_utils.common.collections import is_sequence
class IniParser(ConfigParser):
"""Implements a configparser which is able to return a dict"""
def __init__(self):
super().__init__(interpolation=None)
def __init__(self, delimiters=None):
if delimiters is None:
super().__init__(interpolation=None)
else:
super().__init__(interpolation=None, delimiters=delimiters)
self.optionxform = str
def as_dict(self):
@@ -68,18 +86,26 @@ class IniParser(ConfigParser):
return d
def from_ini(obj):
def from_ini(obj, delimiters=None):
"""Read the given string as INI file and return a dict"""
if not isinstance(obj, str):
raise AnsibleFilterError(f"from_ini requires a str, got {type(obj)}")
if delimiters is not None:
if not is_sequence(delimiters):
raise AnsibleFilterError(f"from_ini's delimiters parameter must be a sequence, got {type(delimiters)}")
delimiters = tuple(delimiters)
if not all(isinstance(elt, str) for elt in delimiters):
raise AnsibleFilterError(
f"from_ini's delimiters parameter must be a sequence of strings, got {delimiters!r}"
)
parser = IniParser()
parser = IniParser(delimiters=delimiters)
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

@@ -52,9 +52,10 @@ _value:
type: dictionary
"""
from ansible.errors import AnsibleFilterError
from collections.abc import Mapping, Sequence
from ansible.errors import AnsibleFilterError
def groupby_as_dict(sequence, attribute):
"""

View File

@@ -8,8 +8,6 @@ from ansible.errors import (
AnsibleError,
AnsibleFilterError,
)
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.common.collections import is_sequence
try:
@@ -34,10 +32,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 +56,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

@@ -74,9 +74,10 @@ _value:
type: any
"""
from ansible.errors import AnsibleError, AnsibleFilterError
import importlib
from ansible.errors import AnsibleError, AnsibleFilterError
try:
import jc
@@ -149,7 +150,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

@@ -6,11 +6,11 @@ from __future__ import annotations
import typing as t
from json import loads
from ansible.errors import AnsibleFilterError
if t.TYPE_CHECKING:
from typing import Any, Callable, Union
from collections.abc import Callable
JSONPATCH_IMPORT_ERROR: ImportError | None
try:
@@ -30,7 +30,7 @@ OPERATIONS_NEEDING_VALUE = ["add", "replace", "test"]
class FilterModule:
"""Filter plugin."""
def check_json_object(self, filter_name: str, object_name: str, inp: Any):
def check_json_object(self, filter_name: str, object_name: str, inp: t.Any):
if isinstance(inp, (str, bytes, bytearray)):
try:
return loads(inp)
@@ -60,12 +60,12 @@ 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,
value: t.Any = None,
**kwargs: dict,
) -> Any:
) -> t.Any:
if not HAS_LIB:
raise AnsibleFilterError(
"You need to install 'jsonpatch' package prior to running 'json_patch' filter"
@@ -105,11 +105,11 @@ 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,
) -> Any:
) -> t.Any:
if not HAS_LIB:
raise AnsibleFilterError(
"You need to install 'jsonpatch' package prior to running 'json_patch_recipe' filter"
@@ -141,8 +141,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(
@@ -159,7 +159,7 @@ class FilterModule:
return result
def filters(self) -> dict[str, Callable[..., Any]]:
def filters(self) -> dict[str, Callable[..., t.Any]]:
"""Map filter plugin names to their functions.
Returns:

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

@@ -194,13 +194,13 @@ _value:
elements: dictionary
"""
from ansible.errors import AnsibleFilterError
from collections.abc import Mapping, Sequence
from ansible.utils.vars import merge_hash
from collections import defaultdict
from collections.abc import Mapping, Sequence
from operator import itemgetter
from ansible.errors import AnsibleFilterError
from ansible.utils.vars import merge_hash
def list_mergeby(x, y, index, recursive=False, list_merge="replace"):
"""Merge 2 lists by attribute 'index'. The function 'merge_hash'

View File

@@ -5,8 +5,8 @@
from __future__ import annotations
import re
from ansible.errors import AnsibleFilterError
from ansible.errors import AnsibleFilterError
UNIT_FACTORS = {
"ms": [],
@@ -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

@@ -16,6 +16,12 @@ options:
description: The dictionary that should be converted to the INI format.
type: dictionary
required: true
seealso:
- plugin: ansible.builtin.ini
plugin_type: lookup
- module: community.general.ini_file
- plugin: community.general.from_ini
plugin_type: filter
"""
EXAMPLES = r"""
@@ -50,6 +56,7 @@ _value:
from collections.abc import Mapping
from configparser import ConfigParser
from io import StringIO
from ansible.errors import AnsibleFilterError
@@ -72,7 +79,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

50
plugins/filter/to_toml.py Normal file
View File

@@ -0,0 +1,50 @@
# Copyright (c) Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
import typing as t
from collections.abc import Mapping
from ansible.module_utils.common.collections import is_sequence
from ansible.module_utils.common.text.converters import to_text
TOMLKIT_IMPORT_ERROR: ImportError | None
try:
from tomlkit import dumps
except ImportError as imp_exc:
TOMLKIT_IMPORT_ERROR = imp_exc
else:
TOMLKIT_IMPORT_ERROR = None
from ansible.errors import AnsibleError, AnsibleFilterError
from ansible_collections.community.general.plugins.plugin_utils._tags import remove_all_tags
def _stringify_keys(value: t.Any) -> t.Any:
"""Recursively convert all keys to strings."""
if isinstance(value, Mapping):
return {to_text(k): _stringify_keys(v) for k, v in value.items()}
if is_sequence(value):
return [_stringify_keys(e) for e in value]
return value
def to_toml(value: t.Mapping, *, redact_sensitive_values: bool = False) -> str:
"""Serialize input as TOML."""
if TOMLKIT_IMPORT_ERROR:
raise AnsibleError("tomlkit must be installed to use this plugin") from TOMLKIT_IMPORT_ERROR
if not isinstance(value, Mapping):
raise AnsibleFilterError("to_toml only accepts dictionaries.")
return dumps(
remove_all_tags(_stringify_keys(value), redact_sensitive_values=redact_sensitive_values),
)
class FilterModule:
def filters(self):
return {
"to_toml": to_toml,
}

View File

@@ -0,0 +1,42 @@
# Copyright (c) Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
DOCUMENTATION:
name: to_toml
author:
- Matt Williams (@milliams)
version_added: 12.3.0
short_description: Convert variable to TOML string
description:
- Converts an Ansible variable into a TOML string representation.
- This filter functions as a wrapper to the L(Python TOML Kit library, https://pypi.org/project/tomlkit/)'s C(tomlkit.dumps) function.
requirements:
- tomlkit
positional: _input
options:
_input:
description:
- A variable or expression that returns a data structure.
type: dict
required: true
redact_sensitive_values:
description:
- If set to V(true), vaulted strings are replaced by V(<redacted>) instead of being decrypted.
- With future ansible-core versions, this can extend to other strings tagged as sensitive.
- B(Note) that with ansible-core 2.18 and before this might not yield the expected result
since these versions of ansible-core strip the vault information away from strings that are
part of more complex data structures specified in C(vars).
type: bool
default: false
EXAMPLES: |
---
# Dump variable in a template to create a TOML document
value: "{{ my_config | community.general.to_toml }}"
RETURN:
_value:
description:
- The TOML serialized string representing the variable structure inputted.
type: string

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