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
503f0625
Commit
503f0625
authored
Sep 18, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ferringb-fixes/configurable-ControlPath' into devel
parents
20708e31
848a9667
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
examples/ansible.cfg
+11
-0
lib/ansible/constants.py
+2
-1
lib/ansible/runner/connection_plugins/ssh.py
+2
-2
No files found.
examples/ansible.cfg
View file @
503f0625
...
@@ -108,6 +108,17 @@ filter_plugins = /usr/share/ansible_plugins/filter_plugins
...
@@ -108,6 +108,17 @@ filter_plugins = /usr/share/ansible_plugins/filter_plugins
# paramiko on older platforms rather than removing it
# paramiko on older platforms rather than removing it
#ssh_args = -o ControlMaster=auto -o ControlPersist=60s
#ssh_args = -o ControlMaster=auto -o ControlPersist=60s
# The path to use for the ControlPath sockets. This defaults to
# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with
# very long hostnames or very long path names (caused by long user names or
# deeply nested home directories) this can exceed the character limit on
# file socket names (108 characters for most platforms). In that case, you
# may wish to shorten the string below.
#
# Example:
# control_path = %(directory)s/%%h-%%r
#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r
# if True, make ansible use scp if the connection type is ssh
# if True, make ansible use scp if the connection type is ssh
# (default is sftp)
# (default is sftp)
#scp_if_ssh = True
#scp_if_ssh = True
...
...
lib/ansible/constants.py
View file @
503f0625
...
@@ -47,7 +47,7 @@ def _get_config(p, section, key, env_var, default, boolean=True):
...
@@ -47,7 +47,7 @@ def _get_config(p, section, key, env_var, default, boolean=True):
return
value
return
value
if
p
is
not
None
:
if
p
is
not
None
:
try
:
try
:
return
p
.
get
(
section
,
key
)
return
p
.
get
(
section
,
key
,
raw
=
True
)
except
:
except
:
return
default
return
default
return
default
return
default
...
@@ -131,6 +131,7 @@ DEFAULT_LOG_PATH = shell_expand_path(get_config(p, DEFAULTS, 'log_
...
@@ -131,6 +131,7 @@ DEFAULT_LOG_PATH = shell_expand_path(get_config(p, DEFAULTS, 'log_
ANSIBLE_NOCOLOR
=
get_config
(
p
,
DEFAULTS
,
'nocolor'
,
'ANSIBLE_NOCOLOR'
,
None
,
boolean
=
True
)
ANSIBLE_NOCOLOR
=
get_config
(
p
,
DEFAULTS
,
'nocolor'
,
'ANSIBLE_NOCOLOR'
,
None
,
boolean
=
True
)
ANSIBLE_NOCOWS
=
get_config
(
p
,
DEFAULTS
,
'nocows'
,
'ANSIBLE_NOCOWS'
,
None
,
boolean
=
True
)
ANSIBLE_NOCOWS
=
get_config
(
p
,
DEFAULTS
,
'nocows'
,
'ANSIBLE_NOCOWS'
,
None
,
boolean
=
True
)
ANSIBLE_SSH_ARGS
=
get_config
(
p
,
'ssh_connection'
,
'ssh_args'
,
'ANSIBLE_SSH_ARGS'
,
None
)
ANSIBLE_SSH_ARGS
=
get_config
(
p
,
'ssh_connection'
,
'ssh_args'
,
'ANSIBLE_SSH_ARGS'
,
None
)
ANSIBLE_SSH_CONTROL_PATH
=
get_config
(
p
,
'ssh_connection'
,
'control_path'
,
'ANSIBLE_SSH_CONTROL_PATH'
,
"
%(directory)
s/ansible-ssh-
%%
h-
%%
p-
%%
r"
)
PARAMIKO_RECORD_HOST_KEYS
=
get_config
(
p
,
'paramiko_connection'
,
'record_host_keys'
,
'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'
,
True
,
boolean
=
True
)
PARAMIKO_RECORD_HOST_KEYS
=
get_config
(
p
,
'paramiko_connection'
,
'record_host_keys'
,
'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'
,
True
,
boolean
=
True
)
ZEROMQ_PORT
=
int
(
get_config
(
p
,
'fireball_connection'
,
'zeromq_port'
,
'ANSIBLE_ZEROMQ_PORT'
,
5099
))
ZEROMQ_PORT
=
int
(
get_config
(
p
,
'fireball_connection'
,
'zeromq_port'
,
'ANSIBLE_ZEROMQ_PORT'
,
5099
))
ACCELERATE_PORT
=
int
(
get_config
(
p
,
'accelerate'
,
'accelerate_port'
,
'ACCELERATE_PORT'
,
5099
))
ACCELERATE_PORT
=
int
(
get_config
(
p
,
'accelerate'
,
'accelerate_port'
,
'ACCELERATE_PORT'
,
5099
))
...
...
lib/ansible/runner/connection_plugins/ssh.py
View file @
503f0625
...
@@ -61,7 +61,7 @@ class Connection(object):
...
@@ -61,7 +61,7 @@ class Connection(object):
else
:
else
:
self
.
common_args
+=
[
"-o"
,
"ControlMaster=auto"
,
self
.
common_args
+=
[
"-o"
,
"ControlMaster=auto"
,
"-o"
,
"ControlPersist=60s"
,
"-o"
,
"ControlPersist=60s"
,
"-o"
,
"ControlPath=
%
s
/ansible-ssh-
%%
h-
%%
p-
%%
r"
%
self
.
cp_dir
]
"-o"
,
"ControlPath=
%
s
"
%
(
C
.
ANSIBLE_SSH_CONTROL_PATH
%
dict
(
directory
=
self
.
cp_dir
))
]
cp_in_use
=
False
cp_in_use
=
False
cp_path_set
=
False
cp_path_set
=
False
...
@@ -72,7 +72,7 @@ class Connection(object):
...
@@ -72,7 +72,7 @@ class Connection(object):
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
.
common_args
+=
[
"-o"
,
"ControlPath=
%
s
/ansible-ssh-
%%
h-
%%
p-
%%
r"
%
self
.
cp_dir
]
self
.
common_args
+=
[
"-o"
,
"ControlPath=
%
s
"
%
(
C
.
ANSIBLE_SSH_CONTROL_PATH
%
dict
(
directory
=
self
.
cp_dir
))
]
if
not
C
.
HOST_KEY_CHECKING
:
if
not
C
.
HOST_KEY_CHECKING
:
self
.
common_args
+=
[
"-o"
,
"StrictHostKeyChecking=no"
]
self
.
common_args
+=
[
"-o"
,
"StrictHostKeyChecking=no"
]
...
...
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