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
872448e9
Commit
872448e9
authored
Jun 15, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated connection info update_vars to only update if data is not alreayd present
aslo added comment clarifying why we do this
parent
956937b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lib/ansible/executor/connection_info.py
+8
-7
No files found.
lib/ansible/executor/connection_info.py
View file @
872448e9
...
@@ -370,11 +370,12 @@ class ConnectionInformation:
...
@@ -370,11 +370,12 @@ class ConnectionInformation:
def
update_vars
(
self
,
variables
):
def
update_vars
(
self
,
variables
):
'''
'''
Adds 'magic' variables relating to connections to the variable dictionary provided.
Adds 'magic' variables relating to connections to the variable dictionary provided.
In case users need to access from the play, this is a legacy from runner.
'''
'''
#FIXME: is this reversed? why use this and not set_task_and_host_override?
variables
[
'ansible_connection'
]
=
self
.
connection
#FIXME: remove password? possibly add become/sudo settings
variables
[
'ansible_ssh_host'
]
=
self
.
remote_addr
for
special_var
in
[
'ansible_connection'
,
'ansible_ssh_host'
,
'ansible_ssh_pass'
,
'ansible_ssh_port'
,
'ansible_ssh_user'
,
'ansible_ssh_private_key_file'
]:
variables
[
'ansible_ssh_pass'
]
=
self
.
password
if
special_var
not
in
variables
:
variables
[
'ansible_ssh_port'
]
=
self
.
port
for
prop
,
varnames
in
MAGIC_VARIABLE_MAPPING
.
items
():
variables
[
'ansible_ssh_user'
]
=
self
.
remote_user
if
special_var
in
varnames
:
variables
[
'ansible_ssh_private_key_file'
]
=
self
.
private_key_file
variables
[
special_var
]
=
getattr
(
self
,
prop
)
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