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

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.

1 Like

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

(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 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…)

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

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!

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.

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!