-
Notifications
You must be signed in to change notification settings - Fork 392
jinja env lookup within container.yml does not find environment variables #703
Comments
Use of Ansible filters, like |
@chouseknecht - I see. I'm struggling to find a clean way to pass envvars in .. right now, I mangle a
Is there a better way to have |
Within As a simple fix, I guess, we could apply the same to |
@chouseknecht - That would be very practical indeed!! It'd be a big time and complexity saver for us! I had a go at seeing if I could try and make this change myself.
But this doesn't stick and my ability with python is limited. I've given up (for now). |
Is this solved? I'm having a similar issue, trying to use --with-variables on the ansible-container build command with no luck at all. Only documentation seems to be: --with-variables WITH_VARIABLES [WITH_VARIABLES ...] I'm trying to use --with-variables like --extra-vars in ansible-playbook but I'm not sure if I have the syntax correct based on whatever this example is supposed to mean. Anybody have a working example of --with-variables? I just need to pass an os ENV into the ansible-container build. Seems like it shouldn't be this hard. |
This is how I am using ENV vars, hope that helps. |
the form FOO='{{ bar }}' works too |
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
Our on-premise GitLab CI jobs set environment variables that I would like to use within
container.yml
and https://docs.ansible.com/ansible-container/container_yml/template.html#passing-environment-variables notes thatSTEPS TO REPRODUCE
EXPECTED RESULTS
I would have expected
VARFOO
to be looked up bylookup("env", "VARFOO")
and for the environment variable to be set in the container like so.ACTUAL RESULTS
VARFOO
happens to be empty in this caseThe text was updated successfully, but these errors were encountered: