mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
make inventory warnings a bit smarter (#46284)
less annoying for common cases add comment for 'tricky' conditional
This commit is contained in:
@@ -807,7 +807,7 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||
no_hosts = False
|
||||
if len(inventory.list_hosts()) == 0:
|
||||
# Empty inventory
|
||||
if C.LOCALHOST_WARNING:
|
||||
if C.LOCALHOST_WARNING and pattern not in C.LOCALHOST:
|
||||
display.warning("provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'")
|
||||
no_hosts = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user