# awx - inventory sources and env variables

**URL:** <https://forum.ansible.com/t/awx-inventory-sources-and-env-variables/37065>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 3, 2022, 3:14pm UTC](https://forum.ansible.com/t/awx-inventory-sources-and-env-variables/37065 "2022-09-03T15:14:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ken\_P](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@Ken\_P](https://forum.ansible.com/u/Ken_P)\
**Post date:** [September 3, 2022, 3:14pm UTC](https://forum.ansible.com/t/awx-inventory-sources-and-env-variables/37065/1 "2022-09-03T15:14:40Z")

</div>

hi, wonder if somebody can point me in right direction.

i am given custom rest end point to read inventory of host and for each tower job submission, i have to pass different filter to same endpoint.

i created inventory script, that can read environment variable for filter value, works fine at cmdline.

To use in tower, i am using inventory sources and env variable option there.

but while making job template launch call via tower rest api, i can not find a way to pass that env variable for filter value - it is not part of payload spec.

i can accomplish this at cmdline, but tower api for launch call is where i am stuck.

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [November 2, 2022, 6:59pm UTC](https://forum.ansible.com/t/awx-inventory-sources-and-env-variables/37065/2 "2022-11-02T18:59:42Z")

</div>

There may be some ways you can accomplish this. One option might be a smart inventory for the job template. Another option might be to have two plays in the job template and let the first play process the inventory and create an in-memory inventory and then have the second play run against the inventory created.

-The AWX Team
