1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 21:29:19 +00:00
This commit is contained in:
Mike Aldred 2026-03-21 17:27:56 +01:00 committed by GitHub
commit 2bc946720c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 13 deletions

View file

@ -46,7 +46,7 @@ options:
become_flags:
description: Options to pass to C(pfexec).
type: string
default: -H -S -n
default: ""
ini:
- section: privilege_escalation
key: become_flags
@ -73,8 +73,11 @@ options:
- section: pfexec_become_plugin
key: password
wrap_exe:
description: Toggle to wrap the command C(pfexec) calls in C(shell -c) or not.
default: false
description:
- Toggle to wrap the command C(pfexec) calls in C(shell -c) or not.
- Unlike C(sudo), C(pfexec) does not interpret shell constructs internally,
so commands containing shell operators must be wrapped in a shell invocation.
default: true
type: bool
ini:
- section: pfexec_become_plugin
@ -103,4 +106,5 @@ class BecomeModule(BecomeBase):
flags = self.get_option("become_flags")
noexe = not self.get_option("wrap_exe")
return f"{exe} {flags} {self._build_success_command(cmd, shell, noexe=noexe)}"
become_cmd = self._build_success_command(cmd, shell, noexe=noexe)
return f"{exe} {flags} {become_cmd}"