Closed danielmanser closed 3 years ago
Files identified in the description:
plugins/modules/route53.py
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/modules/route53.py)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @jillr @jimbydamonk @markuman @s-hertel @tremble @wimnat click here for bot help
Found out why! This cost me hours, and right after I've posted this bug I realized I was running it with sudo
locally, and root doesn't have the AWS credential file. I've added the become: false
and it is working now:
---
- name: Ensure A record
community.aws.route53:
state: present
zone: mydomain.net
record: lisa.mydomain.net
type: A
ttl: 60
value: 127.0.0.1
wait: no
delegate_to: localhost
become: false
Silly me.
@danielmanser thanks , it helped me with your response!!.
This helped save me hours. Would be nice to include in the README
to make the information more accessible.
@danielmanser Just ran into the same problem. You're a rockstar!
Summary
When I try to run a playbook that has
community.aws.route53
in it, I get an exception from botocore:botocore.exceptions.NoCredentialsError: Unable to locate credentials
, even though I have a correct~/.aws/credentials
file. I think I've configured everything correctly according to the docs.Using boto3 in the same Python environment (pyenv) works perfect, it is able to find my credentials.
Issue Type
Bug Report
Component Name
route53
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
macOS Big Sur 11.5.2 on arm64 (Apple M1 silicon)
Steps to Reproduce
Setup
~/.aws/credentials
~/.boto
roles/route53/tasks/main.yml
Note that I want to run the AWS command locally, hence the
delegate_to
. For simplicity, I've hard-coded the values in themain.yml
file to rule out any other issues (i.e. incorrectvars
).site.yml
inventory/test/hosts.yml
Command used:
ansible-playbook -i inventory/test/hosts.yml site.yml
. This fails with the result listed below.Also, I've ran
boto3
within the same folder and environment, which works:Also, setting the AWS Key ID and Secret Key directly in the role worked.
Expected Results
I expected
community.aws.route53
will use my credentials stored in~/.boto
file, documented here. However, it seems not to find either~/.aws/credentials
,~/.boto
, nor if I set my AWS credentials in environment variables.Actual Results
Code of Conduct