mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
add 'localhost_warning' configuration option
Add the 'localhost_warning' configuration option. When set to 'false', this will prevent Ansible from issuing a warning when the inventory is empty and it is using an implicit inventory with only 'localhost'. Closes #17086
This commit is contained in:
committed by
Brian Coca
parent
0cb11c61ac
commit
ebe7666d71
@@ -819,7 +819,8 @@ class CLI(with_metaclass(ABCMeta, object)):
|
||||
no_hosts = False
|
||||
if len(inventory.list_hosts()) == 0:
|
||||
# Empty inventory
|
||||
display.warning("provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'")
|
||||
if C.LOCALHOST_WARNING:
|
||||
display.warning("provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'")
|
||||
no_hosts = True
|
||||
|
||||
inventory.subset(subset)
|
||||
|
||||
Reference in New Issue
Block a user