mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Config continued (#31024)
* included inventory and callback in new config allow inventory to be configurable updated connection options settings also updated winrm to work with new configs removed now obsolete set_host_overrides added notes for future bcoca, current one is just punting, it's future's problem updated docs per feedback added remove group/host methods to inv data moved fact cache from data to constructed cleaner/better options fix when vars are added extended ignore list to config dicts updated paramiko connection docs removed options from base that paramiko already handles left the look option as it is used by other plugin types resolve delegation updated cache doc options fixed test_script better fragment merge for options fixed proxy command restore ini for proxy normalized options moved pipelining to class updates for host_key_checking restructured mixins * fix typo
This commit is contained in:
parent
46c4f6311a
commit
23b1dbacaf
32 changed files with 667 additions and 366 deletions
|
@ -48,23 +48,18 @@ import json
|
|||
import logging
|
||||
import re
|
||||
import os
|
||||
import signal
|
||||
import socket
|
||||
import traceback
|
||||
|
||||
from collections import Sequence
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleConnectionFailure
|
||||
from ansible.module_utils.six import PY3, BytesIO, binary_type
|
||||
from ansible.module_utils.six import BytesIO, PY3
|
||||
from ansible.module_utils.six.moves import cPickle
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.playbook.play_context import PlayContext
|
||||
from ansible.plugins.loader import cliconf_loader, terminal_loader, connection_loader
|
||||
from ansible.plugins.connection import ConnectionBase
|
||||
from ansible.plugins.connection.local import Connection as LocalConnection
|
||||
from ansible.plugins.connection.paramiko_ssh import Connection as ParamikoSshConnection
|
||||
from ansible.utils.path import unfrackpath, makedirs_safe
|
||||
from ansible.utils.path import unfrackpath
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
|
@ -91,7 +86,8 @@ class Connection(ConnectionBase):
|
|||
self._last_response = None
|
||||
self._history = list()
|
||||
|
||||
self._local = LocalConnection(play_context, new_stdin, *args, **kwargs)
|
||||
self._local = connection_loader.get('local', play_context, '/dev/null')
|
||||
self._local.set_options()
|
||||
|
||||
self._terminal = None
|
||||
self._cliconf = None
|
||||
|
@ -166,10 +162,9 @@ class Connection(ConnectionBase):
|
|||
if self.connected:
|
||||
return
|
||||
|
||||
if self._play_context.password and not self._play_context.private_key_file:
|
||||
C.PARAMIKO_LOOK_FOR_KEYS = False
|
||||
|
||||
ssh = ParamikoSshConnection(self._play_context, '/dev/null')._connect()
|
||||
p = connection_loader.get('paramiko', self._play_context, '/dev/null')
|
||||
p.set_options(direct={'look_for_keys': bool(self._play_context.password and not self._play_context.private_key_file)})
|
||||
ssh = p._connect()
|
||||
self.ssh = ssh.ssh
|
||||
|
||||
display.vvvv('ssh connection done, setting terminal', host=self._play_context.remote_addr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue