mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 22:30:22 -07:00
Pull persistent connection parameters via get_option (#39367)
* WIP Pull persistent connection parameters via get_option * Fix pep8 * Add use_persistent_connection setting to paramiko_ssh plugin * Add vars section to persistent_command_timeout setting and prevail provider values over config manager * Use persistent_command_timeout on network_cli instead of timeout * Fix unit tests If we don't call loader to get network_cli, then _load_name is never set and we get KeyError. * Pull persistent_command_timeout via config manager for ios connection local * Pull persistent_command_timeout via config manager on connection local
This commit is contained in:
parent
865f2c5990
commit
62e1c14edc
12 changed files with 64 additions and 22 deletions
|
@ -114,8 +114,16 @@ DOCUMENTATION = """
|
|||
version_added: '2.5'
|
||||
- name: ansible_paramiko_host_key_checking
|
||||
version_added: '2.5'
|
||||
use_persistent_connections:
|
||||
description: 'Toggles the use of persistence for connections'
|
||||
type: boolean
|
||||
default: False
|
||||
env:
|
||||
- name: ANSIBLE_USE_PERSISTENT_CONNECTIONS
|
||||
ini:
|
||||
- section: defaults
|
||||
key: use_persistent_connections
|
||||
# TODO:
|
||||
#C.USE_PERSISTENT_CONNECTIONS:
|
||||
#timeout=self._play_context.timeout,
|
||||
"""
|
||||
|
||||
|
@ -188,7 +196,7 @@ class MyAddPolicy(object):
|
|||
fingerprint = hexlify(key.get_fingerprint())
|
||||
ktype = key.get_name()
|
||||
|
||||
if C.USE_PERSISTENT_CONNECTIONS or self.connection.force_persistence:
|
||||
if self.connection.get_option('use_persistent_connections') or self.connection.force_persistence:
|
||||
# don't print the prompt string since the user cannot respond
|
||||
# to the question anyway
|
||||
raise AnsibleError(AUTHENTICITY_MSG[1:92] % (hostname, ktype, fingerprint))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue