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
284bd118
Commit
284bd118
authored
Oct 05, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly switch to the default transport when delegating from localhost
parent
97c2b2ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
lib/ansible/playbook/play_context.py
+15
-5
No files found.
lib/ansible/playbook/play_context.py
View file @
284bd118
...
...
@@ -350,11 +350,21 @@ class PlayContext(Base):
elif
new_info
.
become_method
==
'su'
and
new_info
.
su_pass
:
setattr
(
new_info
,
'become_pass'
,
new_info
.
su_pass
)
# finally, in the special instance that the task was specified
# as a local action, override the connection in case it was changed
# during some other step in the process
if
task
.
_local_action
:
# special overrides for the connection setting
if
len
(
delegated_vars
)
>
0
:
# in the event that we were using local before make sure to reset the
# connection type to the default transport for the delegated-to host,
# if not otherwise specified
for
connection_type
in
MAGIC_VARIABLE_MAPPING
.
get
(
'connection'
):
if
connection_type
in
delegated_vars
:
break
else
:
if
getattr
(
new_info
,
'connection'
,
None
)
==
'local'
and
new_info
.
remote_addr
not
in
C
.
LOCALHOST
:
setattr
(
new_info
,
'connection'
,
C
.
DEFAULT_TRANSPORT
)
elif
task
.
_local_action
:
# otherwise, in the special instance that the task was specified
# as a local action, override the connection in case it was changed
# during some other step in the process
setattr
(
new_info
,
'connection'
,
'local'
)
# set no_log to default if it was not previouslly set
...
...
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