mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
allow become methods for Jail connection plugin (#31746)
* allow become methods - i personally tested 'su', 'sudo' and 'doas' * forgot to import constants m(
This commit is contained in:
parent
01e8139d74
commit
1e4c389268
1 changed files with 3 additions and 4 deletions
|
@ -36,6 +36,7 @@ import os
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
import traceback
|
import traceback
|
||||||
|
import ansible.constants as C
|
||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
from ansible.module_utils.six.moves import shlex_quote
|
||||||
|
@ -58,10 +59,8 @@ class Connection(ConnectionBase):
|
||||||
# Pipelining may work. Someone needs to test by setting this to True and
|
# Pipelining may work. Someone needs to test by setting this to True and
|
||||||
# having pipelining=True in their ansible.cfg
|
# having pipelining=True in their ansible.cfg
|
||||||
has_pipelining = True
|
has_pipelining = True
|
||||||
# Some become_methods may work in v2 (sudo works for other chroot-based
|
|
||||||
# plugins while su seems to be failing). If some work, check chroot.py to
|
become_methods = frozenset(C.BECOME_METHODS)
|
||||||
# see how to disable just some methods.
|
|
||||||
become_methods = frozenset()
|
|
||||||
|
|
||||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||||
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue