ansible / ansible-runner

A tool and python library that helps when interfacing with Ansible directly or as part of another system whether that be through a container image interface, as a standalone tool, or as a Python module that can be imported. The goal is to provide a stable and consistent interface abstraction to Ansible.
Other
969 stars 357 forks source link

RunnerConfig.prepare_env() does not respect the ansible config #1390

Open braindevices opened 3 months ago

braindevices commented 3 months ago

I was very confused became apparently our code just wrap around whatever stdout callback class In theory it should be able to respect whatever stdout callback the user set as default. But in reality, i cannot get it to respect my ansible.cfg We even have get_ansible_config to facilitate this feature.

After reading the code I figured out we actually override the callback via the env variable.

But we only respect the ANSIBLE_STDOUT_CALLBACK from the environment in the prepare_env(), which causes this bug.

I think we should respect the full ansible config stack instead of just the envvar, there are several way to do this:

sivel commented 3 months ago

Basically a duplicate around: