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
7ae03f83
Commit
7ae03f83
authored
Sep 17, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'amenonsen-addresses' into devel
parents
cc460125
a1fffff9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
14 deletions
+11
-14
lib/ansible/executor/task_executor.py
+1
-1
lib/ansible/inventory/__init__.py
+1
-1
lib/ansible/inventory/host.py
+6
-9
lib/ansible/inventory/ini.py
+2
-2
lib/ansible/vars/hostvars.py
+1
-1
No files found.
lib/ansible/executor/task_executor.py
View file @
7ae03f83
...
@@ -460,7 +460,7 @@ class TaskExecutor:
...
@@ -460,7 +460,7 @@ class TaskExecutor:
# FIXME: calculation of connection params/auth stuff should be done here
# FIXME: calculation of connection params/auth stuff should be done here
if
not
self
.
_play_context
.
remote_addr
:
if
not
self
.
_play_context
.
remote_addr
:
self
.
_play_context
.
remote_addr
=
self
.
_host
.
ipv4_
address
self
.
_play_context
.
remote_addr
=
self
.
_host
.
address
if
self
.
_task
.
delegate_to
is
not
None
:
if
self
.
_task
.
delegate_to
is
not
None
:
self
.
_compute_delegate
(
variables
)
self
.
_compute_delegate
(
variables
)
...
...
lib/ansible/inventory/__init__.py
View file @
7ae03f83
...
@@ -417,7 +417,7 @@ class Inventory(object):
...
@@ -417,7 +417,7 @@ class Inventory(object):
new_host
=
Host
(
pattern
)
new_host
=
Host
(
pattern
)
new_host
.
set_variable
(
"ansible_python_interpreter"
,
sys
.
executable
)
new_host
.
set_variable
(
"ansible_python_interpreter"
,
sys
.
executable
)
new_host
.
set_variable
(
"ansible_connection"
,
"local"
)
new_host
.
set_variable
(
"ansible_connection"
,
"local"
)
new_host
.
ipv4_
address
=
'127.0.0.1'
new_host
.
address
=
'127.0.0.1'
self
.
get_group
(
"ungrouped"
)
.
add_host
(
new_host
)
self
.
get_group
(
"ungrouped"
)
.
add_host
(
new_host
)
return
new_host
return
new_host
...
...
lib/ansible/inventory/host.py
View file @
7ae03f83
...
@@ -46,8 +46,7 @@ class Host:
...
@@ -46,8 +46,7 @@ class Host:
return
dict
(
return
dict
(
name
=
self
.
name
,
name
=
self
.
name
,
vars
=
self
.
vars
.
copy
(),
vars
=
self
.
vars
.
copy
(),
ipv4_address
=
self
.
ipv4_address
,
address
=
self
.
address
,
ipv6_address
=
self
.
ipv6_address
,
gathered_facts
=
self
.
_gathered_facts
,
gathered_facts
=
self
.
_gathered_facts
,
groups
=
groups
,
groups
=
groups
,
)
)
...
@@ -55,10 +54,9 @@ class Host:
...
@@ -55,10 +54,9 @@ class Host:
def
deserialize
(
self
,
data
):
def
deserialize
(
self
,
data
):
self
.
__init__
()
self
.
__init__
()
self
.
name
=
data
.
get
(
'name'
)
self
.
name
=
data
.
get
(
'name'
)
self
.
vars
=
data
.
get
(
'vars'
,
dict
())
self
.
vars
=
data
.
get
(
'vars'
,
dict
())
self
.
ipv4_address
=
data
.
get
(
'ipv4_address'
,
''
)
self
.
address
=
data
.
get
(
'address'
,
''
)
self
.
ipv6_address
=
data
.
get
(
'ipv6_address'
,
''
)
groups
=
data
.
get
(
'groups'
,
[])
groups
=
data
.
get
(
'groups'
,
[])
for
group_data
in
groups
:
for
group_data
in
groups
:
...
@@ -72,11 +70,10 @@ class Host:
...
@@ -72,11 +70,10 @@ class Host:
self
.
vars
=
{}
self
.
vars
=
{}
self
.
groups
=
[]
self
.
groups
=
[]
self
.
ipv4_address
=
name
self
.
address
=
name
self
.
ipv6_address
=
name
if
port
:
if
port
:
self
.
set_variable
(
'ansible_
ssh_
port'
,
int
(
port
))
self
.
set_variable
(
'ansible_port'
,
int
(
port
))
self
.
_gathered_facts
=
False
self
.
_gathered_facts
=
False
...
...
lib/ansible/inventory/ini.py
View file @
7ae03f83
...
@@ -255,8 +255,8 @@ class InventoryParser(object):
...
@@ -255,8 +255,8 @@ class InventoryParser(object):
for
h
in
hosts
:
for
h
in
hosts
:
for
k
in
variables
:
for
k
in
variables
:
h
.
set_variable
(
k
,
variables
[
k
])
h
.
set_variable
(
k
,
variables
[
k
])
if
k
==
'ansible_ssh_host'
:
if
k
in
[
'ansible_host'
,
'ansible_ssh_host'
]
:
h
.
ipv4_
address
=
variables
[
k
]
h
.
address
=
variables
[
k
]
return
hosts
return
hosts
...
...
lib/ansible/vars/hostvars.py
View file @
7ae03f83
...
@@ -62,7 +62,7 @@ class HostVars(collections.Mapping):
...
@@ -62,7 +62,7 @@ class HostVars(collections.Mapping):
new_host
=
Host
(
name
=
'localhost'
)
new_host
=
Host
(
name
=
'localhost'
)
new_host
.
set_variable
(
"ansible_python_interpreter"
,
sys
.
executable
)
new_host
.
set_variable
(
"ansible_python_interpreter"
,
sys
.
executable
)
new_host
.
set_variable
(
"ansible_connection"
,
"local"
)
new_host
.
set_variable
(
"ansible_connection"
,
"local"
)
new_host
.
ipv4_
address
=
'127.0.0.1'
new_host
.
address
=
'127.0.0.1'
hosts
.
append
(
new_host
)
hosts
.
append
(
new_host
)
for
host
in
hosts
:
for
host
in
hosts
:
...
...
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