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.69k stars 3.38k forks source link

Awx not parsing properly a path set in vars #6047

Open alancivita opened 4 years ago

alancivita commented 4 years ago
ISSUE TYPE
COMPONENT NAME
SUMMARY

Awx seems to not parse properly a path set in vars

ENVIRONMENT
STEPS TO REPRODUCE

I have a role to add ssh user keys, basically the role is like this:

the var file is like this: users: home_directory_mask: 27 groups: … … … accounts: … …

when i execute a playbook with that role i'm getting this error:

{ "msg": "An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: /var/lib/awx/projects/_6__alan/environments/test/../shared/public_keys/test-automation.pub", "_ansible_no_log": false } but the file is definitely there and the path is correct; i've double checked on the celery container;

i have an extra variable set on the template for the inventory_dir var: inventory_dir: /var/lib/awx/projects/_6__alan/environments/test

Any tips?

EXPECTED RESULTS
ACTUAL RESULTS
ADDITIONAL INFORMATION
alancivita commented 4 years ago

i've removed the inventory_dir: /var/lib/awx/projects/_6__alan/environments/test extra var to let awx use the /tmp/ version but i'm getting the same error but the file is definitely there

alancivita commented 4 years ago

quick update, to make it work i had to change from

to

so basically i've used playbook_dir ansible variable rather than inventory_dir

any tips?

AlanCoding commented 4 years ago

if you're trying to use inventory_dir, also see https://github.com/ansible/awx/issues/5926