# How to pass ENVIRONMENT VARIABLES to ansible-test integration --docker

**URL:** <https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141>\
**Category:** Get Help\
**Tags:** netscaler, ansible-test, docker, collections\
**Created:** [January 3, 2024, 6:17pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141 "2024-01-03T18:17:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumanth-lingappa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sumanth-lingappa/32/839_2.png) [@sumanth-lingappa](https://forum.ansible.com/u/sumanth-lingappa)\
**Post date:** [January 3, 2024, 6:17pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/1 "2024-01-03T18:17:23Z")

</div>

**How to pass ENVIRONMENT VARIABLES to ansible-test integration --docker**.

I am writing integration tests for `netscaler.adc` collection.

This collection is a collection of modules to configure the NetScaler ADC via API (each ansible module invokes NetScaler NITRO APIs)

The collection takes API authentication via each task or via environment variables (github link below)

How can I send my environment variables to `ansible-test integration --docker` ?

I have seen `integration_config.yml`. It works but there is no way I can send my credentials securely.

ENV VARS would be best in my case.

Please help.

> <https://github.com/netscaler/ansible-collection-netscaleradc/blob/438a2e50bed62e832a397ee0747c7a0901cab091/playbook_anatomy.md?plain=1#L18>

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 3, 2024, 6:29pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/2 "2024-01-03T18:29:54Z")

</div>

I don’t think you can. `integration_config.yml` is the only way to pass data (and credentials) into the tests.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 3, 2024, 6:56pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/3 "2024-01-03T18:56:13Z")

</div>

(The only exceptions are ‘cloud’ config plugins. These ship with ansible-test and the existing ones can be found here: [ansible/test/lib/ansible\_test/\_internal/commands/integration/cloud at devel · ansible/ansible · GitHub](https://github.com/ansible/ansible/tree/devel/test/lib/ansible_test/_internal/commands/integration/cloud) I’m using quotes for ‘cloud’ since they also set up things not related to clouds. Right now it’s not able to add a new plugin without getting it merged into ansible-core itself, to my knowledge. I hope that eventually changes…)

---

<div class="post-metadata">

**Author:** ![sumanth-lingappa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sumanth-lingappa/32/839_2.png) [@sumanth-lingappa](https://forum.ansible.com/u/sumanth-lingappa)\
**Post date:** [January 4, 2024, 3:04am UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/4 "2024-01-04T03:04:45Z")

</div>

OK. Thank you @felixfontein.

I feel the integration test documentation can be improved to a great extent.

For a beginner like me, more than the documentation, I am looking other collection’s repo and learning

---

<div class="post-metadata">

**Author:** ![valkiriaaquatica](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/valkiriaaquatica/32/1308_2.png) [@valkiriaaquatica](https://forum.ansible.com/u/valkiriaaquatica)\
**Post date:** [April 18, 2024, 9:58pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/5 "2024-04-18T21:58:09Z")

</div>

Hey @sumanth-lingappa just have seen your repo. Do you finally know how to pass variables securily in ansible-test integration? I’ve just tried with ansible-vault which is not compatiable, enviroment variables that do not work and using vars (works but in plain text as in yo example so not good)

Thanks in adevanced!

---

<div class="post-metadata">

**Author:** ![sumanth-lingappa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sumanth-lingappa/32/839_2.png) [@sumanth-lingappa](https://forum.ansible.com/u/sumanth-lingappa)\
**Post date:** [April 30, 2024, 9:20am UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/6 "2024-04-30T09:20:52Z")

</div>

No @valkiriaaquatica, I did not find any way to pass the environment securely. as of now, I am generating `integration_config.yml` at run time before the integration tests.

---

<div class="post-metadata">

**Author:** ![valkiriaaquatica](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/valkiriaaquatica/32/1308_2.png) [@valkiriaaquatica](https://forum.ansible.com/u/valkiriaaquatica)\
**Post date:** [May 12, 2024, 2:36pm UTC](https://forum.ansible.com/t/how-to-pass-environment-variables-to-ansible-test-integration-docker/3141/7 "2024-05-12T14:36:18Z")

</div>

Hi @sumanth-lingappa yes, that’s what I keep doing, constructing enviroment vars as time creation and passing them to the integration\_config.yml.  
Thanks btw!
