Awx: inventory file variables aren't available in the jobtemplates

Created on 6 Nov 2018  路  6Comments  路  Source: ansible/awx

ISSUE TYPE
  • Bug Report
COMPONENT NAME

  • Ansible
SUMMARY


The inventory file variables aren't available in the jobtemplates.

ENVIRONMENT
  • AWX version: 2.1.0
  • AWX install method: docker on linux
  • Ansible version: 2.7.1 (in container)
  • Operating System: Centos 7
  • Web Browser: Chrome
STEPS TO REPRODUCE

We defined in an inventory file a variable in YAML format:
env: staging
We added the inventory file to a job template, so the variable would be used but while running the job we received an variable is undefined error in the playbook.
As workaround we added the variable to the job template, this made the variable available in the playbook.

needs_info bug

Most helpful comment

@jakemcdermott not sure if this is what @MikeySmet encountered but for me declaring variables in the Inventory as shown below:

screen shot 2018-11-07 at 12 21 09 am

Don't work anymore, those variables are not inherited when you run any job template that uses such inventory. Previous versions are working.

probably related to #2574 #2614

All 6 comments

Hello @MikeySmet

Thanks for creating this issue. Can elaborate on how you added the inventory file to the job template? Did you use a project-based inventory?

Can you provide example project that can be used to reliably reproduce the problem?

@jakemcdermott not sure if this is what @MikeySmet encountered but for me declaring variables in the Inventory as shown below:

screen shot 2018-11-07 at 12 21 09 am

Don't work anymore, those variables are not inherited when you run any job template that uses such inventory. Previous versions are working.

probably related to #2574 #2614

@ryan012880 indeed that's how I declared the variables. It happened after upgrading from version 1.0.8 to 2.1.0.

This is very likely resolved by https://github.com/ansible/awx/pull/2614

We updated the 2.1.0 yesterday and are encountering this exactly. Would you like me to open up a new ticket?

This is resolved by version 2.1.1.

Was this page helpful?
0 / 5 - 0 ratings