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
90445ee6
Commit
90445ee6
authored
Jun 17, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ::1 where we see 127.0.0.1, for better ipv6 support
Fixes #5764
parent
c3c398cf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lib/ansible/inventory/__init__.py
+4
-4
No files found.
lib/ansible/inventory/__init__.py
View file @
90445ee6
...
@@ -372,7 +372,7 @@ class Inventory(object):
...
@@ -372,7 +372,7 @@ class Inventory(object):
for
host
in
matching_hosts
:
for
host
in
matching_hosts
:
__append_host_to_results
(
host
)
__append_host_to_results
(
host
)
if
pattern
in
[
"localhost"
,
"127.0.0.1"
]
and
len
(
results
)
==
0
:
if
pattern
in
[
"localhost"
,
"127.0.0.1"
,
"::1"
]
and
len
(
results
)
==
0
:
new_host
=
self
.
_create_implicit_localhost
(
pattern
)
new_host
=
self
.
_create_implicit_localhost
(
pattern
)
results
.
append
(
new_host
)
results
.
append
(
new_host
)
return
results
return
results
...
@@ -408,9 +408,9 @@ class Inventory(object):
...
@@ -408,9 +408,9 @@ class Inventory(object):
return
self
.
_hosts_cache
[
hostname
]
return
self
.
_hosts_cache
[
hostname
]
def
_get_host
(
self
,
hostname
):
def
_get_host
(
self
,
hostname
):
if
hostname
in
[
'localhost'
,
'127.0.0.
1'
]:
if
hostname
in
[
'localhost'
,
'127.0.0.1'
,
'::
1'
]:
for
host
in
self
.
get_group
(
'all'
)
.
get_hosts
():
for
host
in
self
.
get_group
(
'all'
)
.
get_hosts
():
if
host
.
name
in
[
'localhost'
,
'127.0.0.1'
]:
if
host
.
name
in
[
'localhost'
,
'127.0.0.1'
,
'::1'
]:
return
host
return
host
return
self
.
_create_implicit_localhost
(
hostname
)
return
self
.
_create_implicit_localhost
(
hostname
)
else
:
else
:
...
@@ -512,7 +512,7 @@ class Inventory(object):
...
@@ -512,7 +512,7 @@ class Inventory(object):
""" return a list of hostnames for a pattern """
""" return a list of hostnames for a pattern """
result
=
[
h
for
h
in
self
.
get_hosts
(
pattern
)
]
result
=
[
h
for
h
in
self
.
get_hosts
(
pattern
)
]
if
len
(
result
)
==
0
and
pattern
in
[
"localhost"
,
"127.0.0.1"
]:
if
len
(
result
)
==
0
and
pattern
in
[
"localhost"
,
"127.0.0.1"
,
"::1"
]:
result
=
[
pattern
]
result
=
[
pattern
]
return
result
return
result
...
...
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