Q:

Ansible does not recognize default inventory set in config

I can use my Ansible inventory file to ping all hosts if I specify it explicity:
ansible -i mmp_default/mmp_static_default  all -m ping

mmp-websockets002.prod01.company.com | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
mmp-staticweb001.prod01.company.com | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"

But setting it up as a default inventory in my config doesn't work:
ansible all -m ping
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

This is my config:
sudo cat /etc/ansible/ansible.cfg
[defaults]
ansible_managed = This file is managed by Merlin. Do not edit directly.
deprecation_warnings = False
timeout=30
remote_user = centos
private_key_file = /home/centos/AWS.pem

[privilege_escalation]
become=True
become_user=root

[inventory]
## enable inventory plugins, default: 'host_list', 'script', 'yaml', 'ini'
enable_plugins = auto, ini
inventory = /home/centos/R2.4.1/merlin/mmp_default/mmp_static_default

I have my inventory listed as: inventory = /home/centos/R2.4.1/merlin/mmp_default/mmp_static_default
Why doesn't ansible recognize the inventory file I setup in the config?

A:

From the doc, inventory setting should be in defaults section:
[defaults]
...
inventory = /home/centos/R2.4.1/merlin/mmp_default/mmp_static_default
...

[privilege_escalation]
....

