Environment Variable Interpolation within PATHs in ansible.cfg

Hi All. Great work with Ansible!!

I’m trying to use ansible.cfg to specify paths to plugins in a controlled manner. The path varies based on the installation, so I’d like to say something like:

filter_plugins = $PLUGIN_PATH/filter_plugins

action_plugins = $PLUGIN_PATH/action_plugins

And then specify PLUGIN_PATH in the environment when launching ansible-playbook.

It’s not working, apparently because some paths in ansible.cfg have shell variable expansion applied, and others do not. I could specify each of ANSIBLE_FILTER_PLUGINS, ANSIBLE_ACTION_PLUGINS etc. independently, but that’s cumbersome.

Is there any reason that environment variables are not consistently expanded for all of these *_PATH entries? Are you open to a PR that consistently applies shell_expand_path() to all of the paths below?

From constants.py:

That’s a really good point and this should definitely be consistent.

Let’s add an expand=True to the get_config method and we can take it.

However note that the ‘v2’ refactoring is still underweigh for core… so you may wish to just file this as a bug report rather than a PR, that way we can make sure it’s applied to v2, since if it’s applied to the old tree, it won’t automatically hop over to the new one.

Thanks Michael.

I filed a bug report on github.