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
4c0e6722
Commit
4c0e6722
authored
Feb 22, 2013
by
Patrick Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for connection type in ansible_hosts file
parent
9d594d74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
lib/ansible/runner/__init__.py
+5
-3
lib/ansible/runner/connection.py
+1
-2
No files found.
lib/ansible/runner/__init__.py
View file @
4c0e6722
...
...
@@ -317,7 +317,8 @@ class Runner(object):
''' executes any module one or more times '''
host_variables
=
self
.
inventory
.
get_variables
(
host
)
if
self
.
transport
in
[
'paramiko'
,
'ssh'
]:
host_connection
=
host_variables
.
get
(
'ansible_connection'
,
self
.
transport
)
if
host_connection
in
[
'paramiko'
,
'ssh'
]:
port
=
host_variables
.
get
(
'ansible_ssh_port'
,
self
.
remote_port
)
if
port
is
None
:
port
=
C
.
DEFAULT_REMOTE_PORT
...
...
@@ -423,7 +424,8 @@ class Runner(object):
actual_port
=
port
actual_user
=
inject
.
get
(
'ansible_ssh_user'
,
self
.
remote_user
)
actual_pass
=
inject
.
get
(
'ansible_ssh_pass'
,
self
.
remote_pass
)
if
self
.
transport
in
[
'paramiko'
,
'ssh'
]:
actual_transport
=
inject
.
get
(
'ansible_connection'
,
self
.
transport
)
if
actual_transport
in
[
'paramiko'
,
'ssh'
]:
actual_port
=
inject
.
get
(
'ansible_ssh_port'
,
port
)
# the delegated host may have different SSH port configured, etc
...
...
@@ -463,7 +465,7 @@ class Runner(object):
return
ReturnData
(
host
=
host
,
comm_ok
=
False
,
result
=
result
)
try
:
conn
=
self
.
connector
.
connect
(
actual_host
,
actual_port
,
actual_user
,
actual_pass
)
conn
=
self
.
connector
.
connect
(
actual_host
,
actual_port
,
actual_user
,
actual_pass
,
actual_transport
)
if
delegate_to
or
host
!=
actual_host
:
conn
.
delegate
=
host
...
...
lib/ansible/runner/connection.py
View file @
4c0e6722
...
...
@@ -31,9 +31,8 @@ class Connection(object):
def
__init__
(
self
,
runner
):
self
.
runner
=
runner
def
connect
(
self
,
host
,
port
,
user
,
password
):
def
connect
(
self
,
host
,
port
,
user
,
password
,
transport
):
conn
=
None
transport
=
self
.
runner
.
transport
conn
=
utils
.
plugins
.
connection_loader
.
get
(
transport
,
self
.
runner
,
host
,
port
,
user
=
user
,
password
=
password
)
if
conn
is
None
:
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
...
...
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