# Specifying environment variables (API credentials) for integration test

**URL:** <https://forum.ansible.com/t/specifying-environment-variables-api-credentials-for-integration-test/25114>\
**Category:** Ansible Developer\
**Created:** [July 28, 2017, 10:46am UTC](https://forum.ansible.com/t/specifying-environment-variables-api-credentials-for-integration-test/25114 "2017-07-28T10:46:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Karasek](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tomas\_Karasek](https://forum.ansible.com/u/Tomas_Karasek)\
**Post date:** [July 28, 2017, 10:46am UTC](https://forum.ansible.com/t/specifying-environment-variables-api-credentials-for-integration-test/25114/1 "2017-07-28T10:46:30Z")

</div>

Hi, I am tryign to write integration test for packet\_device module (the module allocates a node in the PAcket host).

I put the module calls and asserts to main.yml to test/integraion/targets/packet\_device/tasks/.

To authenticate in the PAcket API, one needs an API token. The module reads it from environment (also it can be specified by param). I have the proper envvar exported in my shell when I run

$ ansible-test integration --local -v packet\_device

but the Ansible module call doesn’t have it in the environment.

My question:  
What is the proper way to pass API credentials to integration tests? I would really prefer to do it over envvars, but I can put the API token to yaml file.

I see a mention of integration\_config.yml in  
[http://docs.ansible.com/ansible/latest/dev\_guide/testing\_integration.html#configuration](http://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html#configuration)

but that file is not in .gitignore.
