allow become methods for Jail connection plugin (#31746)

* allow become methods

- i personally tested 'su', 'sudo' and 'doas'

* forgot to import constants m(
pull/39836/head
Stephan Lohse 7 years ago committed by Brian Coca
parent 01e8139d74
commit 1e4c389268

@ -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…
Cancel
Save