mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Properly restrict hosts after 9070875
This commit is contained in:
parent
f6245e17c1
commit
a56e1f31fa
1 changed files with 5 additions and 5 deletions
|
@ -239,10 +239,10 @@ class PlayBook(object):
|
||||||
|
|
||||||
# *****************************************************
|
# *****************************************************
|
||||||
|
|
||||||
def _list_available_hosts(self):
|
def _list_available_hosts(self, *args):
|
||||||
''' returns a list of hosts that haven't failed and aren't dark '''
|
''' returns a list of hosts that haven't failed and aren't dark '''
|
||||||
|
|
||||||
return [ h for h in self.inventory.list_hosts() if (h not in self.stats.failures) and (h not in self.stats.dark)]
|
return [ h for h in self.inventory.list_hosts(*args) if (h not in self.stats.failures) and (h not in self.stats.dark)]
|
||||||
|
|
||||||
# *****************************************************
|
# *****************************************************
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ class PlayBook(object):
|
||||||
def _do_setup_step(self, play):
|
def _do_setup_step(self, play):
|
||||||
''' get facts from the remote system '''
|
''' get facts from the remote system '''
|
||||||
|
|
||||||
host_list = self._list_available_hosts()
|
host_list = self._list_available_hosts(play.hosts)
|
||||||
|
|
||||||
if play.gather_facts is False:
|
if play.gather_facts is False:
|
||||||
return {}
|
return {}
|
||||||
|
@ -396,7 +396,7 @@ class PlayBook(object):
|
||||||
|
|
||||||
# now with that data, handle contentional variable file imports!
|
# now with that data, handle contentional variable file imports!
|
||||||
|
|
||||||
all_hosts = self._list_available_hosts()
|
all_hosts = self._list_available_hosts(play.hosts)
|
||||||
play.update_vars_files(all_hosts)
|
play.update_vars_files(all_hosts)
|
||||||
|
|
||||||
serialized_batch = []
|
serialized_batch = []
|
||||||
|
@ -431,7 +431,7 @@ class PlayBook(object):
|
||||||
# just didn't match anything and that's ok
|
# just didn't match anything and that's ok
|
||||||
return False
|
return False
|
||||||
|
|
||||||
host_list = self._list_available_hosts()
|
host_list = self._list_available_hosts(play.hosts)
|
||||||
|
|
||||||
# if no hosts remain, drop out
|
# if no hosts remain, drop out
|
||||||
if not host_list:
|
if not host_list:
|
||||||
|
|
Loading…
Reference in a new issue