mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-23 08:40:22 -07:00
make inventory warnings a bit smarter (#46284)
less annoying for common cases add comment for 'tricky' conditional
This commit is contained in:
parent
4961f003e5
commit
903cfa63cb
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue