Overriding log_path for each invocation of ansible-playbook

1,873 views
Skip to first unread message

Tom Bamford

unread,
Dec 27, 2014, 10:50:01 PM12/27/14
to ansible...@googlegroups.com

Hi

I would like to override some configuration value, specifically log_path, for each invocation of ansible-playbook.

I have tried passing extra variables in the form ansible-playbook something.yml -e 'log_path=/some/file' to no effect.

It also seems like only a single config file is used when there are multiple ansible.cfg files in their respective locations (./ansible.cfg, ~/.ansible.cfg, /etc/ansible/ansible.cfg). One is forced to produce an entire config file simply to change a single setting.

Is there a way to arbitrarily override certain config values? Is there is a way to get Ansible to parse all config files and give corresponding precedence to individual settings therein?

Regards
Tom

--
Tom Bamford

@Planet
ATPLANET (Pty) Ltd

Brian Coca

unread,
Dec 29, 2014, 11:21:37 AM12/29/14
to ansible...@googlegroups.com
Configuration is not exposed as variables, so setting a variable named
log_path will not affect the configuration setting. Only one file is
read on a 'first found' basis, they are not merged.

Many configuration options allow for an environment variable override,
for this case use ANSIBLE_LOG_PATH.

--
Brian Coca

Tom Bamford

unread,
Dec 29, 2014, 2:17:26 PM12/29/14
to ansible...@googlegroups.com
Hi Brian

Thank you! This will work nicely.

Regards
Tom



--
Brian Coca

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8%3D3Hqk-yUvea95%3Dvap%2Bg2ZVq5o4EcHwA2e2CzBhiZh7Ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages