diff --git a/lib/ansible/plugins/inventory/aws_ec2.py b/lib/ansible/plugins/inventory/aws_ec2.py index 3ac5321c42..ae2ec90308 100644 --- a/lib/ansible/plugins/inventory/aws_ec2.py +++ b/lib/ansible/plugins/inventory/aws_ec2.py @@ -130,6 +130,12 @@ from ansible.module_utils.six import string_types from ansible.module_utils.ec2 import ansible_dict_to_boto3_filter_list, boto3_tag_list_to_ansible_dict from ansible.module_utils.ec2 import camel_dict_to_snake_dict from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable, to_safe_group_name +try: + from __main__ import display +except ImportError: + from ansible.utils.display import Display + display = Display() + try: import boto3 @@ -502,6 +508,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): if super(InventoryModule, self).verify_file(path): if path.endswith('.aws_ec2.yml') or path.endswith('.aws_ec2.yaml'): return True + display.debug("aws_ec2 inventory filename must end with '*.aws_ec2.yml' or '*.aws_ec2.yaml'") return False def _get_query_options(self, config_data):