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
f16b745f
Commit
f16b745f
authored
Jul 31, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now properly uses default port if defined
parent
496186f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
lib/ansible/inventory/host.py
+1
-2
lib/ansible/inventory/ini.py
+1
-1
lib/ansible/playbook/play_context.py
+4
-0
No files found.
lib/ansible/inventory/host.py
View file @
f16b745f
...
...
@@ -19,7 +19,6 @@
from
__future__
import
(
absolute_import
,
division
,
print_function
)
__metaclass__
=
type
from
ansible
import
constants
as
C
from
ansible.inventory.group
import
Group
from
ansible.utils.vars
import
combine_vars
...
...
@@ -76,7 +75,7 @@ class Host:
self
.
ipv4_address
=
name
self
.
ipv6_address
=
name
if
port
and
port
!=
C
.
DEFAULT_REMOTE_PORT
:
if
port
:
self
.
set_variable
(
'ansible_ssh_port'
,
int
(
port
))
self
.
_gathered_facts
=
False
...
...
lib/ansible/inventory/ini.py
View file @
f16b745f
...
...
@@ -108,7 +108,7 @@ class InventoryParser(object):
if
len
(
tokens
)
==
0
:
continue
hostname
=
tokens
[
0
]
port
=
C
.
DEFAULT_REMOTE_PORT
port
=
None
# Three cases to check:
# 0. A hostname that contains a range pesudo-code and a port
# 1. A hostname that contains just a port
...
...
lib/ansible/playbook/play_context.py
View file @
f16b745f
...
...
@@ -298,6 +298,10 @@ class PlayContext(Base):
if
variable_name
in
variables
:
setattr
(
new_info
,
attr
,
variables
[
variable_name
])
# make sure we get port defaults if needed
if
newinfo
.
port
is
None
and
C
.
DEFAULT_REMOTE_PORT
is
not
None
:
newinfo
.
port
=
int
(
C
.
DEFAULT_REMOTE_PORT
)
# become legacy updates
if
not
new_info
.
become_pass
:
if
new_info
.
become_method
==
'sudo'
and
new_info
.
sudo_pass
:
...
...
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