Is there a reason why ansible.cfg, which is an ini file, isn't merged in
precedence by Ansible when the file is found in different locations, but
instead Ansible uses the first one it finds (in some order)? It's very
useful to have ansible.cfg in the root of your Ansible project because you
can set things like roles_path and library, but it's bad if you need to
configure something differently which depends on the machine where Ansible
will be executed. A good example is the forks, which you want to bump up on
management hosts which have a lot of CPU and RAM, and decrease on smaller
ones.

There isn't a workaround for this currently, because Ansible doesn't do
merging. Is there a reason for it?

What could also be a good solution is to have an .include /etc/ansible.cfg
statement in ansible.cfg, something like systemd has for its unit files,
which would allow you to do something like this in the project ansible.cfg:
.include /etc/ansible/ansible.cfg

[defaults]
library = ./library
roles_path = ./roles

Which would basically mean use whatever it is in /etc/ansible/ansible.cfg
and override library and roles_path.

What do you think about this?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to