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

17 commits

Author SHA1 Message Date
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]
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]
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
Felix Fontein
340ff8586d Reformat everything. 2025-11-01 13:46:53 +01:00
Felix Fontein
8f8a0e1d7c
Fix __future__ imports, __metaclass__ = type, and remove explicit UTF-8 encoding statement for Python files (#10886)
* Adjust all __future__ imports:

for i in $(grep -REl "__future__.*absolute_import" plugins/ tests/); do
  sed -e 's/from __future__ import .*/from __future__ import annotations/g' -i $i;
done

* Remove all UTF-8 encoding specifications for Python source files:

for i in $(grep -REl '[-][*]- coding: utf-8 -[*]-' plugins/ tests/); do
  sed -e '/^# -\*- coding: utf-8 -\*-/d' -i $i;
done

* Remove __metaclass__ = type:

for i in $(grep -REl '__metaclass__ = type' plugins/ tests/); do
  sed -e '/^__metaclass__ = type/d' -i $i;
done
2025-10-10 19:52:04 +02:00
Alexei Znamensky
838cdaab42
lmn*: style adjustments (#9528)
* lmn*: style adjustments

* Apply suggestions from code review

* Apply suggestions from code review

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-07 06:28:00 +01:00
Philippe Duveau
01244237a1
Optimize ldap modules auth note in a doc fragment (#9486)
Optimize ldap auth doc fragment
2024-12-30 23:39:41 +01:00
Alexei Znamensky
cea6eeef37
l*.py: normalize docs (#9390) 2024-12-26 09:12:05 +01:00
Alex
e556abb56b
Many typo fixes (#7429) 2023-10-25 23:01:32 +02:00
Felix Fontein
c694abbdf9
Use semantic markup (modules k-l) (#6678)
* Use semantic markup.

* Use option instead of alias.
2023-06-15 15:47:13 +02:00
Gnonthgol
f3ecf4c7f8
ldap: Add client certificate support (#6668)
* Set up secure ldap server

* ldap: Added client cert options

Shamelessly copied from https://github.com/andrewshulgin/ldap_search

* Added tests for ldap client authentication

* Add changelog fragment

* Make sure the openssl commands work on older versions of openssl

* Apply suggestions from code review

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

* Remove aliases for new arguments

* Add required_together to ldap module declerations

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-15 07:19:29 +02:00
Cédric Servais
5e1e8d06ef
ldap_entry documentation is lacking examples (#5815)
* Add changelog fragment

* Add documentation for possible values of LDAP entry attributes

* Add PR information

* Update plugins/modules/ldap_entry.py

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

* remove changlog

* Update docstring

* Align ldap_attrs doc to ldap_entry module

* Update plugins/modules/ldap_attrs.py

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

* Change formulations.

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-27 20:57:21 +02:00
Felix Fontein
cc3a79bc48
Add attributes to some database modules (#5953)
Add attributes to some database modules.
2023-02-24 09:23:04 +01:00
Alexei Znamensky
97b584e261
Short descriptions (batch1) - massive fix on Capitalization and trailing period (#5503)
* short_description fix batch 1

* Update plugins/modules/ali_instance.py

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

* Update plugins/modules/apt_rpm.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-09 07:18:40 +01:00
Felix Fontein
b531ecdc9b
Unflatmap community.general (#5461)
* Move files.

* Update imports and references.

* Move wrongly placed files.

* Reverse redirects, deprecate long → short name redirects.

* Simplify contribution guidelines for new modules.

* Rewrite BOTMETA.

* Add changelog fragment.

* Fix ignore.txt files.
2022-11-02 20:42:29 +00:00
Felix Fontein
7743ecd776
Replace symlinks with meta/runtime.yml redirects. (#4562) 2022-04-26 20:33:13 +02:00
Brian Coca
8f90360d49
make collection usable with current ansible vers (#9) 2020-03-11 14:10:38 +00:00