On Wed, 22 Sept 2021 at 21:34, dulhaver via Ansible Project
<ansible-project@googlegroups.com> wrote:

> I assume the file name (everything preceding the .cfg ending) can be chosen 
> freely and does not require the string 'ansible' being part of it, right? 
> Still, same as you even if I can validate the existence of the ANSIBLE_CONFIG 
> variable it does not show via ansible --version neither.

Well it works fine here, also for a file with the ansible substring:

$ export ANSIBLE_CONFIG=/opt/project.cfg
$ ansible --version | head -2
ansible 2.10.12
  config file = /opt/project.cfg

unset ANSIBLE_CONFIG
$ ansible --version | head -2
ansible 2.10.12
  config file = /Users/dick.visser/.ansible.cfg

> Maybe I get the understanding of hierarchy not quite right? I was thinking 
> that once set the ANSIBLE_CONFIG environment variable would overrule all 
> other (fallback) configuration files. That would make much sense to me but 
> maybe the variable is the least mighty one and not the boss in the ring as I 
> thought?

As the above example shows (and as the docs at
https://docs.ansible.com/ansible/latest/installation_guide/intro_configuration.html#environmental-configuration
state):

"Ansible also allows configuration of settings using environment
variables. If these environment variables are set, they will override
any setting loaded from the configuration file."

So, if this does NOT work for you, then your environment is wrong
(wrong variable name/typo?). Or maybe the way you execute the command
is non standard, shell issues, etc.

-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPjAeY7s%3DzGQKcBJKHJJs1-gGccL77moq2tNXaLBb%2BDOA%40mail.gmail.com.

Reply via email to