[stable-9] [stable-10] Disable pipelining for doas and machinectl on ansible-core 2.19+ (#10537) (#10561) (#10565)

[stable-10] Disable pipelining for doas and machinectl on ansible-core 2.19+ (#10537) (#10561)

Disable pipelining for doas and machinectl on ansible-core 2.19+ (#10537)

Disable pipelining for doas and machinectl.

(cherry picked from commit 9a29622584)
(cherry picked from commit 69563766ec)
This commit is contained in:
Felix Fontein 2025-08-02 18:02:31 +02:00 committed by GitHub
commit f7f5c7f913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -77,6 +77,8 @@ DOCUMENTATION = '''
if the user is allowed to perform the action (take a look at the examples section).
If such a rule is not present the plugin only work if it is used in context with the root user,
because then no further prompt will be shown by machinectl.
- 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'''
@ -109,6 +111,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)