diff options
author | Andrea Tartaglia <me@andreatartaglia.com> | 2016-11-03 22:19:59 +0000 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-11-03 15:19:59 -0700 |
commit | b18263cf3668e2330825c4ae42161e619f81e2e4 (patch) | |
tree | a5b1bc4adf01f4e736d3c3ff7d4ff83e87e04051 /lib/ansible | |
parent | 9547d6b422c8cc6c9a4f0fe6188ad2e4f218b475 (diff) | |
download | ansible-b18263cf3668e2330825c4ae42161e619f81e2e4.tar.gz |
ANSIBLE_SSH_CONTROL_PATH_DIR option added (#18342)
* ANSIBLE_SSH_CONTROL_PATH_DIR option added
This removes the hardcoded value ( $HOME/.ansible/cp ) from ssh.py.
User is able to change the ControlPath directory ( the one that replaces %(directory)s ).
Fixes #18325
* Added config option in ansible.cfg
Diffstat (limited to 'lib/ansible')
-rw-r--r-- | lib/ansible/constants.py | 1 | ||||
-rw-r--r-- | lib/ansible/plugins/connection/ssh.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index c6d90537d6..77b3242312 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -299,6 +299,7 @@ MAX_FILE_SIZE_FOR_DIFF = get_config(p, DEFAULTS, 'max_diff_size', 'ANSIB # CONNECTION RELATED ANSIBLE_SSH_ARGS = get_config(p, 'ssh_connection', 'ssh_args', 'ANSIBLE_SSH_ARGS', '-C -o ControlMaster=auto -o ControlPersist=60s') ANSIBLE_SSH_CONTROL_PATH = get_config(p, 'ssh_connection', 'control_path', 'ANSIBLE_SSH_CONTROL_PATH', u"%(directory)s/ansible-ssh-%%h-%%p-%%r") +ANSIBLE_SSH_CONTROL_PATH_DIR = get_config(p, 'ssh_connection', 'control_path_dir', 'ANSIBLE_SSH_CONTROL_PATH_DIR', u'$HOME/.ansible/cp') ANSIBLE_SSH_PIPELINING = get_config(p, 'ssh_connection', 'pipelining', 'ANSIBLE_SSH_PIPELINING', False, value_type='boolean') ANSIBLE_SSH_RETRIES = get_config(p, 'ssh_connection', 'retries', 'ANSIBLE_SSH_RETRIES', 0, value_type='integer') ANSIBLE_SSH_EXECUTABLE = get_config(p, 'ssh_connection', 'ssh_executable', 'ANSIBLE_SSH_EXECUTABLE', 'ssh') diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index 0c18b983a5..cf6df55439 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -228,7 +228,7 @@ class Connection(ConnectionBase): self._persistent = True if not controlpath: - cpdir = unfrackpath(u'$HOME/.ansible/cp') + cpdir = unfrackpath(C.ANSIBLE_SSH_CONTROL_PATH_DIR) b_cpdir = to_bytes(cpdir, errors='surrogate_or_strict') # The directory must exist and be writable. |