Repository: ansible/ansible

Issue:
inventory_ignore_extensions and inventory_ignore_patterns are ignored in 2.4
##### ISSUE TYPE
 - Bug Report


##### ANSIBLE VERSION
```
2.4.0.0
```

Hi

Values of inventory_ignore_extensions and inventory_ignore_patterns from ansible.cfg are replaced by default values.

Cause: INVENTORY_IGNORE_EXTS and INVENTORY_IGNORE_PATTERNS have multiple keys 

INVENTORY_IGNORE_EXTS:
  ini:
  - {key: inventory_ignore_extensions, section: defaults}
  - {key: ignore_extensions, section: inventory}

INVENTORY_IGNORE_PATTERNS:
  ini:
  - {key: inventory_ignore_patterns, section: defaults}
  - {key: ignore_patterns, section: inventory}

but next block of code doesn't have a break in loop if value was found:
```
                    try:  # FIXME: generaelize _loop_entries to allow for files also
                        for ini_entry in defs[config]['ini']:
                            value = get_ini_config_value(self._parser, ini_entry)
                            origin = cfile
                            if value is not None and 'deprecated' in ini_entry:
                                self.DEPRECATED.append(('[%s]%s' % (ini_entry['section'], ini_entry['key']), ini_entry['deprecated']))
                    except Exception as e:
                        sys.stderr.write("Error while loading ini config %s: %s" % (cfile, to_native(e)))
```

ansible 2.4.0.0

Please fix the bug.
Thank you


Discussion:
@lystor Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. 

Here are the items we could not find in your description:
- issue type
- ansible version
- component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: issue_missing_data --->
I can confirm that `inventory_ignore_patterns` from the configuration file is currently ignored.

Resolving patch:
diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py
--- a/lib/ansible/config/manager.py
+++ b/lib/ansible/config/manager.py
@@ -292,12 +292,14 @@ def get_config_value_and_origin(self, config, cfile=None, plugin_type=None, plug
             if ftype and defs[config].get(ftype):
                 if ftype == 'ini':
                     # load from ini config
-                    try:  # FIXME: generaelize _loop_entries to allow for files also
+                    try:  # FIXME: generaelize _loop_entries to allow for files also, most of this code is dupe
                         for ini_entry in defs[config]['ini']:
-                            value = get_ini_config_value(self._parser, ini_entry)
-                            origin = cfile
-                            if value is not None and 'deprecated' in ini_entry:
-                                self.DEPRECATED.append(('[%s]%s' % (ini_entry['section'], ini_entry['key']), ini_entry['deprecated']))
+                            temp_value = get_ini_config_value(self._parser, ini_entry)
+                            if temp_value is not None:
+                                value = temp_value
+                                origin = cfile
+                                if 'deprecated' in ini_entry:
+                                    self.DEPRECATED.append(('[%s]%s' % (ini_entry['section'], ini_entry['key']), ini_entry['deprecated']))
                     except Exception as e:
                         sys.stderr.write("Error while loading ini config %s: %s" % (cfile, to_native(e)))
                 elif ftype == 'yaml':


Test patch: