ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.92k stars 3.41k forks source link

When module launches a binary that relies on environment variables, credential variables are not passed to it #1765

Closed megakoresh closed 1 year ago

megakoresh commented 6 years ago
ISSUE TYPE
COMPONENT NAME
SUMMARY

When I use e.g. terraform module with a binary that is downloaded in the same playbook, the credentials I have configured don't get passed to the binary it seems. The same playbook executed on my own machine with the exact same environment variables configured works just fine. In addition dynamic inventory script in AWX that uses the same credentials (OpenStack) also works..

ENVIRONMENT
STEPS TO REPRODUCE
  1. Configure openstack credential type on AWX (Built in are broken, I had to create custom ones for it to work) with the following environment vars:
    OS_USERNAME=user name (can be AD)
    OS_PROJECT_NAME=project name
    OS_USER_DOMAIN_NAME=user domain name
    OS_PROJECT_DOMAIN_NAME=project domain name
    OS_AUTH_URL=openstack auth url
    OS_AUTH_TYPE=password
    OS_IDENTITY_API_VERSION=3
    OS_NO_CACHE=True 
  2. Put in your credentials
  3. Write a playbook that deploys some infra using terraform with the following tasks:
    
    - name: Download terraform
    get_url:
    url: https://releases.hashicorp.com/terraform/{{ terraform_version | default('0.11.7') }}/terraform_{{ terraform_version }}_linux_amd64.zip
    dest: /tmp/terraform-{{terraform_version}}.zip
    when: "'64' in ansible_architecture and 'Linux' == ansible_system and not stat_terraform.stat.exists and install_terraform"

Infra is deployed

ACTUAL RESULTS

provider.openstack: Authentication failed

ADDITIONAL INFORMATION

N/A

megakoresh commented 6 years ago

Anyone managed to repoduce this? Any idea what's going on?

ryanpetrello commented 5 years ago

@megakoresh this ticket is quite old - are you still encountering this on newer versions of AWX?

TheRealHaoLiu commented 1 year ago

close due to age and lack of response