Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
1840906f
Commit
1840906f
authored
Sep 03, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12236 from amenonsen/ssh-cpdir
Go back to using ~/.ansible/cp as the ControlPath
parents
e218bf8d
7aa6cd3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
lib/ansible/plugins/connections/ssh.py
+8
-6
No files found.
lib/ansible/plugins/connections/ssh.py
View file @
1840906f
...
@@ -37,6 +37,7 @@ from hashlib import sha1
...
@@ -37,6 +37,7 @@ from hashlib import sha1
from
ansible
import
constants
as
C
from
ansible
import
constants
as
C
from
ansible.errors
import
AnsibleError
,
AnsibleConnectionFailure
,
AnsibleFileNotFound
from
ansible.errors
import
AnsibleError
,
AnsibleConnectionFailure
,
AnsibleFileNotFound
from
ansible.plugins.connections
import
ConnectionBase
from
ansible.plugins.connections
import
ConnectionBase
from
ansible.utils.path
import
unfrackpath
,
makedirs_safe
class
Connection
(
ConnectionBase
):
class
Connection
(
ConnectionBase
):
''' ssh based connections '''
''' ssh based connections '''
...
@@ -49,12 +50,6 @@ class Connection(ConnectionBase):
...
@@ -49,12 +50,6 @@ class Connection(ConnectionBase):
self
.
_common_args
=
[]
self
.
_common_args
=
[]
self
.
HASHED_KEY_MAGIC
=
"|1|"
self
.
HASHED_KEY_MAGIC
=
"|1|"
# FIXME: move the lockfile locations to ActionBase?
#fcntl.lockf(self.runner.process_lockfile, fcntl.LOCK_EX)
#self.cp_dir = utils.prepare_writeable_dir('$HOME/.ansible/cp',mode=0700)
self
.
_cp_dir
=
'/tmp'
#fcntl.lockf(self.runner.process_lockfile, fcntl.LOCK_UN)
super
(
Connection
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
Connection
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
host
=
self
.
_play_context
.
remote_addr
self
.
host
=
self
.
_play_context
.
remote_addr
...
@@ -126,11 +121,18 @@ class Connection(ConnectionBase):
...
@@ -126,11 +121,18 @@ class Connection(ConnectionBase):
cp_path_set
=
True
cp_path_set
=
True
if
cp_in_use
and
not
cp_path_set
:
if
cp_in_use
and
not
cp_path_set
:
self
.
_cp_dir
=
unfrackpath
(
'$HOME/.ansible/cp'
)
args
=
(
"-o"
,
"ControlPath=
\"
{0}
\"
"
.
format
(
args
=
(
"-o"
,
"ControlPath=
\"
{0}
\"
"
.
format
(
C
.
ANSIBLE_SSH_CONTROL_PATH
%
dict
(
directory
=
self
.
_cp_dir
))
C
.
ANSIBLE_SSH_CONTROL_PATH
%
dict
(
directory
=
self
.
_cp_dir
))
)
)
self
.
add_args
(
"found only ControlPersist; added ControlPath"
,
args
)
self
.
add_args
(
"found only ControlPersist; added ControlPath"
,
args
)
# The directory must exist and be writable.
makedirs_safe
(
self
.
_cp_dir
,
0
o700
)
if
not
os
.
access
(
self
.
_cp_dir
,
os
.
W_OK
):
raise
AnsibleError
(
"Cannot write to ControlPath
%
s"
%
self
.
_cp_dir
)
if
not
C
.
HOST_KEY_CHECKING
:
if
not
C
.
HOST_KEY_CHECKING
:
self
.
add_args
(
self
.
add_args
(
"ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled"
,
"ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment