Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EC2 Dynamic Inventory Issue for AWX #2225

Open
1 task done
mxs-weixiong opened this issue Aug 23, 2024 · 1 comment
Open
1 task done

EC2 Dynamic Inventory Issue for AWX #2225

mxs-weixiong opened this issue Aug 23, 2024 · 1 comment
Labels
needs_info This issue requires further information. Please answer any outstanding questions

Comments

@mxs-weixiong
Copy link

mxs-weixiong commented Aug 23, 2024

Summary`

Suddently ec2 dynamic inventory plugin not working. I not sure why as there is no config changes

Issue Type

Bug Report

Component Name

aws_ec2

Ansible Version

ansible-inventory [core 2.15.12]

Collection Versions

none

AWS SDK versions

none

Configuration

---
assume_role_arn: arn:aws:iam::xxxx:role/MXS-Ansible-Cross-Account-Role
hostnames:
  - name: 'private-ip-address'
keyed_groups:
  - key: tags.environment
    separator: ""
  - key: platform_details
    separator: ""
  - key: state.name
    separator: ""
compose:
 ansible_host: private_ip_address

OS / Environment

No response

Steps to Reproduce

Just trying to sync the inventory with ec2

Expected Results

Able to get the list of ec2 instance

Actual Results

ansible-inventory [core 2.15.12]
  config file = None
  configured module search path = ['/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /runner/.ansible/collections:/usr/share/ansible/collections:/usr/share/automation-controller/collections
  executable location = /usr/local/bin/ansible-inventory
  python version = 3.9.19 (main, Jun 11 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True
No config file found; using defaults
redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2
Using inventory plugin 'ansible_collections.amazon.aws.plugins.inventory.aws_ec2' to process inventory source '/runner/inventory/aws_ec2.yml'
[WARNING]:  * Failed to parse /runner/inventory/aws_ec2.yml with auto plugin:
Failed to describe instances: An error occurred (AuthFailure) when calling the
DescribeInstances operation: AWS was not able to validate the provided access
credentials
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/auto.py", line 59, in parse
    plugin.parse(inventory, loader, path, cache=cache)
  File "/usr/share/ansible/collections/ansible_collections/amazon/aws/plugins/inventory/aws_ec2.py", line 816, in parse
    results = self._query(regions, include_filters, exclude_filters, strict_permissions, use_ssm_inventory)
  File "/usr/share/ansible/collections/ansible_collections/amazon/aws/plugins/inventory/aws_ec2.py", line 644, in _query
    for i in self._get_instances_by_region(
  File "/usr/share/ansible/collections/ansible_collections/amazon/aws/plugins/inventory/aws_ec2.py", line 547, in _get_instances_by_region
    self.fail_aws("Failed to describe instances", exception=e)
  File "/usr/share/ansible/collections/ansible_collections/amazon/aws/plugins/plugin_utils/base.py", line 35, in fail_aws
    self._do_fail(f"{message}: {to_native(exception)}")
  File "/usr/share/ansible/collections/ansible_collections/amazon/aws/plugins/plugin_utils/base.py", line 28, in _do_fail
    raise AnsibleError(message)
[WARNING]: Unable to parse /runner/inventory/aws_ec2.yml as an inventory source
ERROR! No inventory was parsed, please check your configuration and options.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@abikouo
Copy link
Contributor

abikouo commented Sep 4, 2024

@mxs-weixiong this seems not related to the inventory plugin

Failed to describe instances: An error occurred (AuthFailure) when calling the
DescribeInstances operation: AWS was not able to validate the provided access

could you please check your credentials? Validate that they have not expired or been revoked?

@abikouo abikouo added needs_info This issue requires further information. Please answer any outstanding questions and removed needs_triage labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_info This issue requires further information. Please answer any outstanding questions
Projects
None yet
Development

No branches or pull requests

2 participants