Fix physical_host loading from group/host vars

Commit I76af71ffe19b2a8afb18ed731f1362a4e399c613 broke the ability
to define physical_host in host_vars and group_vars. The physical_host
is only loaded from the ini inventory.

Change-Id: I3798529cf2bf73afbff2d2ef0f3fe17d91123fbc
This commit is contained in:
Logan V 2018-07-12 14:47:35 -05:00
parent c4be217148
commit 3f224cdef7
3 changed files with 6 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class StrategyModule(LINEAR.StrategyModule):
_play_context = copy.deepcopy(play_context)
pha = task_vars['physical_host_addrs'] = dict()
physical_host_item = host.vars.get('physical_host')
physical_host_item = task_vars.get('physical_host')
if physical_host_item:
LINEAR.display.verbose(
u'The "physical_host" variable was found.',

View File

@ -16,3 +16,7 @@
ansible_host: 10.100.100.4
ansible_become: True
ansible_user: root
# Test case to validate I3798529cf2bf73afbff2d2ef0f3fe17d91123fbc
# Ensure physical_host can be defined in group/host vars
physical_host: localhost_alt

View File

@ -9,7 +9,7 @@ container2
[hosts]
localhost_alt
[all_containers]
container3 physical_host=localhost_alt
container3
# This is meant to test If594914df53efacc6d5bba148f4f46280f5a117d
[fake_hosts]