##### SUMMARY
While `ansible-config dump` is a very useful tool for determining the configuration used by Ansible at runtime, it does have a major flaw: its output is not machine parseable.

##### ISSUE TYPE
- Feature Idea

##### COMPONENT NAME
ansible-config

##### ADDITIONAL INFORMATION
ansible-config should have an option to dump config in a machine parseable format like JSON or YAML, so it can be consumed by other tools.

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import datetime
from ansible.module_utils._text import to_text
from ansible.module_utils.common._collections_compat import Mapping
from ansible.module_utils.common.collections import is_sequence
def _is_unsafe(value):
    return getattr(value, '__UNSAFE__', False) and not getattr(value, '__ENCRYPTED__', False)
def _is_vault(value):
    return getattr(value, '__ENCRYPTED__', False)
def _preprocess_unsafe_encode(value):
    """Recursively preprocess a data structure converting instances of ``AnsibleUnsafe``
    into their JSON dict representations
    Used in ``AnsibleJSONEncoder.iterencode``
    """
    if _is_unsafe(value):
        value = {'__ansible_unsafe': to_text(value, errors='surrogate_or_strict', nonstring='strict')}
    elif is_sequence(value):
        value = [_preprocess_unsafe_encode(v) for v in value]
    elif isinstance(value, Mapping):
        value = dict((k, _preprocess_unsafe_encode(v)) for k, v in value.items())
    return value
class AnsibleJSONEncoder(json.JSONEncoder):