ansible-collections / amazon.aws

Ansible Collection for Amazon AWS
GNU General Public License v3.0
308 stars 337 forks source link

Document common authentication issues #1654

Open tremble opened 1 year ago

tremble commented 1 year ago

It's less common than it used to be, however it looks like folks are still periodically having issues when they try to pull credentials from the credentials file. We now mention the Host vs Controller gotcha in the Notes section of all modules, but we should probably also mention the "become" gotcha (see below). I think it's worth tweaking the Note a little further, but I'm also thinking it might be worth tweaking the the README and the AWS Guide...

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.

Originally posted by @danielmanser in https://github.com/ansible-collections/community.aws/issues/708#issuecomment-917458977

ansibullbot commented 1 year ago

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 1 year ago

@tremble: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md

click here for bot help

rdab commented 8 months ago

It took me days to find out this.

In my case I ran into this error when trying to use the module in AWX. The error it reported was:

fatal: [my_server -> localhost]: FAILED! => {
    "msg": "privilege output closed while waiting for password prompt:\n/bin/sh: line 1: sudo: command not found\n"
}

once I added become: false it worked.

Thanks!