-
Notifications
You must be signed in to change notification settings - Fork 392
Pass process envvars into conductor/container envs #711
base: develop
Are you sure you want to change the base?
Conversation
It's not apparent immediately why the checks failed -- I'll try and work out why when I get some time. |
I have a concern about this. And, I think my concern is highlighted by your use case. Your example variables, At runtime, however, the user may not want these variables set, or may want them set to a different value. But because they were set on the service container during |
@chouseknecht you are correct. should is the main theme: Each 'phase' (build, run, etc.) may need different env, even inside the same organization/team. Then maybe additional attribute 'phases' or 'steps' should handle each step's env, e.g.:
YaML gets ... ugly. but the above would say that build will override WDYT? |
@chouseknecht, @mvk - Sorry, this skipped my attention and it's been a while since I worked on ansible-container so forgive me if I'm a bit rusty on the details around our use-case. I should just add some background - Ultimately, our use case revolves around doing CI/CD on the same openstack-based cloud platform where tenants can only access webservices in other tenants or on the internet via HTTP_PROXY/HTTPS_PROXY/etc envvars being set - we mostly (but not always) do require these vars to be the same across We really struggled with ansible-container getting this story to work. I recall
We would really like to solve As for the coincidental, I wasn't aware that vars get baked in to the image - I can see why it would be done but to me that sounds off (if you ask for our opinion - we would like for build time info to creep into a container image - so for this alone, I would vote for not automatically setting envvars to the image metadata). |
@shalomb I understand the idea, and the motivation. it's cool.
|
@shalomb about IS your concern about sensitive data you intend to expose as env variable? then use secrets. |
@mvk - I think if
|
@shalomb clearly you were thinking about your specific use case 👍 This is why env is isolated & stanitized, and you are supposed to specify it. Maybe as a workaround, wrap your calls to I'll try to see what's the reason why |
Hey folks - Thank you for your work and interest on this. Your use case makes sense, and I'm grateful for the effort to write and contribute code. However, I don't believe your approach is the right path forward. A couple of notes that might be of use:
Does that make sense? Have I understood your use case and constraints correctly? Thanks! |
@j00bar you are covering my use case, and I will find out how to skin this hairless cat in weird environments with scripting, or vars-files generating. Offtopic Q: why is full ansible-compat templating not available/used in this project? |
Please note my comment on #866 about providing SSH keys to Galaxy. The container.yml is largely templated, with few exceptions, and those exceptions exist mostly for variable precedence reasons. What are you finding isn't templated? |
inside service.environment, vars-files and defaults sections.
ISSUE TYPE
SUMMARY
Allow for environmental variables set in
ansible-containers
's parent process to be used inservice.environment
)ansible-container
workflow.