mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-10 02:09:11 -07:00
Fix become plugins (#50)
* Fix become plugins. * Fix become unit tests to avoid play_context.make_become_cmd. * Remove hack. * Remove explicit defaults. Adjust tests to be more like Ansible itself. * Forgot two lines. * Rewrite tests (again). * Rename play_context -> task, add possibility to pass var_options. * Add var_options variants. * Properly test overwriting.
This commit is contained in:
parent
7d8ca8bdbb
commit
0026c9f5b2
14 changed files with 238 additions and 84 deletions
|
@ -27,6 +27,7 @@ DOCUMENTATION = '''
|
|||
- name: ANSIBLE_PMRUN_EXE
|
||||
become_flags:
|
||||
description: Options to pass to pmrun
|
||||
default: ''
|
||||
ini:
|
||||
- section: privilege_escalation
|
||||
key: become_flags
|
||||
|
@ -70,6 +71,7 @@ class BecomeModule(BecomeBase):
|
|||
if not cmd:
|
||||
return cmd
|
||||
|
||||
become = self.get_option('become_exe') or self.name
|
||||
flags = self.get_option('become_flags') or ''
|
||||
become = self.get_option('become_exe')
|
||||
|
||||
flags = self.get_option('become_flags')
|
||||
return '%s %s %s' % (become, flags, shlex_quote(self._build_success_command(cmd, shell)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue