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
d1eaf2db
Commit
d1eaf2db
authored
Jul 04, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default to 'smart' transport, which will use OpenSSH if it can support ControlPersist.
parent
8cc2f1c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
examples/ansible.cfg
+14
-0
lib/ansible/constants.py
+1
-1
lib/ansible/runner/__init__.py
+12
-1
No files found.
examples/ansible.cfg
View file @
d1eaf2db
...
...
@@ -8,9 +8,23 @@
hostfile = /etc/ansible/hosts
<<<<<<< HEAD
# location of ansible library, eliminates need to specify --module-path
library = /usr/share/ansible
=======
hostfile = /etc/ansible/hosts
library = /usr/share/ansible
remote_tmp = $HOME/.ansible/tmp
pattern = *
forks = 5
poll_interval = 15
sudo_user = root
#ask_sudo_pass = True
#ask_pass = True
transport = smart
remote_port = 22
>>>>>>> c55adc9... Default to 'smart' transport, which will use OpenSSH if it can support ControlPersist.
# uncomment this to disable SSH key host checking
#host_key_checking = False
...
...
lib/ansible/constants.py
View file @
d1eaf2db
...
...
@@ -104,7 +104,7 @@ DEFAULT_PRIVATE_KEY_FILE = shell_expand_path(get_config(p, DEFAULTS, 'private_k
DEFAULT_SUDO_USER
=
get_config
(
p
,
DEFAULTS
,
'sudo_user'
,
'ANSIBLE_SUDO_USER'
,
'root'
)
DEFAULT_ASK_SUDO_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_sudo_pass'
,
'ANSIBLE_ASK_SUDO_PASS'
,
False
,
boolean
=
True
)
DEFAULT_REMOTE_PORT
=
int
(
get_config
(
p
,
DEFAULTS
,
'remote_port'
,
'ANSIBLE_REMOTE_PORT'
,
22
))
DEFAULT_TRANSPORT
=
get_config
(
p
,
DEFAULTS
,
'transport'
,
'ANSIBLE_TRANSPORT'
,
'
paramiko
'
)
DEFAULT_TRANSPORT
=
get_config
(
p
,
DEFAULTS
,
'transport'
,
'ANSIBLE_TRANSPORT'
,
'
smart
'
)
DEFAULT_SCP_IF_SSH
=
get_config
(
p
,
'ssh_connection'
,
'scp_if_ssh'
,
'ANSIBLE_SCP_IF_SSH'
,
False
,
boolean
=
True
)
DEFAULT_MANAGED_STR
=
get_config
(
p
,
DEFAULTS
,
'ansible_managed'
,
None
,
'Ansible managed: {file} modified on
%
Y-
%
m-
%
d
%
H:
%
M:
%
S by {uid} on {host}'
)
DEFAULT_SYSLOG_FACILITY
=
get_config
(
p
,
DEFAULTS
,
'syslog_facility'
,
'ANSIBLE_SYSLOG_FACILITY'
,
'LOG_USER'
)
...
...
lib/ansible/runner/__init__.py
View file @
d1eaf2db
...
...
@@ -30,6 +30,7 @@ import base64
import
sys
import
shlex
import
pipes
import
subprocess
import
ansible.constants
as
C
import
ansible.inventory
...
...
@@ -166,9 +167,19 @@ class Runner(object):
self
.
is_playbook
=
is_playbook
self
.
environment
=
environment
self
.
complex_args
=
complex_args
self
.
callbacks
.
runner
=
self
# if the transport is 'smart' see if SSH can support ControlPersist if not use paramiko
# 'smart' is the default since 1.2.1/1.3
if
self
.
transport
==
'smart'
:
cmd
=
subprocess
.
Popen
([
'ssh'
,
'-o'
,
'ControlPersist'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
out
,
err
)
=
cmd
.
communicate
()
if
"Bad configuration option"
in
err
:
self
.
transport
=
"paramiko"
else
:
self
.
transport
=
"ssh"
# misc housekeeping
if
subset
and
self
.
inventory
.
_subset
is
None
:
# don't override subset when passed from playbook
...
...
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