Why am I Getting 'Incorrect Credential' Error While Using AWS Dynamic Inventory in Ansible Tower ?

Solution Verified - Updated -

Issue

While using AWS dynamic inventory in Ansible Tower I am getting an incorrect credential error with the following stack trace:

 1.663 INFO Updating inventory 4: AWS Inventory 1.696 INFO Reading executable JSON source: /var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py 2.108 ERROR Failed to load JSON from: Traceback (most recent call last): File "/usr/bin/tower-manage", line 9, in <module> load_entry_point('ansible-tower==3.1.4', 'console_scripts', 'tower-manage')() File "/lib/python2.7/site-packages/awx/__init__.py", line 105, in manage File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line utility.execute() File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv self.execute(*args, **cmd_options) File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute output = self.handle(*args, **options) File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/base.py", line 661, in handle return self.handle_noargs(**options) File "/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 1290, in handle_noargs File "/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 503, in load_inventory_source File "/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 392, in load File "/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 380, in command_to_json RuntimeError: ['/var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/ec2.py', '--list'] failed (rc=1) with output: ERROR: "Authentication error retrieving ec2 inventory. - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment vars found but may not be correct - No Boto config found at any expected location '/etc/boto.cfg, ~/.boto, ~/.aws/credentials'", while: getting EC2 instances

Environment

  • Ansible Tower >= 3.3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In