mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
* Restore behavior for detecting only localhost, and no limit match. Fixes #52152 * Add test for non-matching limit
This commit is contained in:
parent
847d089d6b
commit
cdb53ff1a4
5 changed files with 27 additions and 4 deletions
|
@ -99,6 +99,14 @@ class PlaybookCLI(CLI):
|
|||
# create base objects
|
||||
loader, inventory, variable_manager = self._play_prereqs()
|
||||
|
||||
# (which is not returned in list_hosts()) is taken into account for
|
||||
# warning if inventory is empty. But it can't be taken into account for
|
||||
# checking if limit doesn't match any hosts. Instead we don't worry about
|
||||
# limit if only implicit localhost was in inventory to start with.
|
||||
#
|
||||
# Fix this when we rewrite inventory by making localhost a real host (and thus show up in list_hosts())
|
||||
CLI.get_host_list(inventory, context.CLIARGS['subset'])
|
||||
|
||||
# flush fact cache if requested
|
||||
if context.CLIARGS['flush_cache']:
|
||||
self._flush_cache(inventory, variable_manager)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue