ansible/awx

Add the boto profile concept to AWX

Open

#9,661 opened on Mar 23, 2021

View on GitHub
 (0 comments) (2 reactions) (0 assignees)Python (3,333 forks)batch import
component:apihelp wantedtype:bugtype:enhancement

Repository metrics

Stars
 (13,071 stars)
PR merge metrics
 (Avg merge 24d 6h) (30 merged PRs in 30d)

Description

ISSUE TYPE
  • Bug Report
SUMMARY

I wanted to setup AWX with my project. In my aws_ec2 inventory plugin, I specified a boto_profile var since I have multiple ones configured locally.

Problem is, AWX does not provide a way to specify what boto profile to feed. Instead, it feeds only the env var:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SECURITY_TOKEN

Consequently, the plugin crashes since it does not use the provided env var but wants to read the boto profile.

AWX should have a way to figure out how to provide the boto profile (adding a AWS_PROFILE env var) ?

The workaround for now is to not provide the boto_profile parameter of the aws_ec2 inventory. It implies, on your own machine, that AWS must use the default boto profile, which is not desirable.

ENVIRONMENT
  • AWX version: 17.0.1
  • AWX install method: docker on linux
  • Ansible version: 2.9.17
  • Operating System: Debian 9
  • Web Browser: Chrome
STEPS TO REPRODUCE

Add a boto_profile parameter in the aws_ec2 plugin inventory and do not use the default one. AWX won't be able to find that profile

EXPECTED RESULTS

You playbooks can run

ACTUAL RESULTS

The inventory can't be parsed

    2.372 ERROR    [WARNING]:  * Failed to parse
    2.372 ERROR    /tmp/awx_347_pau03o08/project/inventory/aws_ec2.yml with auto plugin:
    2.372 ERROR    Insufficient credentials found: The config profile (ansible-inventory) could
    2.372 ERROR    not be found
ADDITIONAL INFORMATION

I opened an issue on ansible as well, they told me it would be better to have this in AWX tracking.

Contributor guide