##### 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.

if getattr(o, '__ENCRYPTED__', False):
            
            if self._vault_to_text:
                value = to_text(o, errors='surrogate_or_strict')
            else:
                value = {'__ansible_vault': to_text(o._ciphertext, errors='surrogate_or_strict', nonstring='strict')}
        elif getattr(o, '__UNSAFE__', False):
            
            value = {'__ansible_unsafe': to_text(o, errors='surrogate_or_strict', nonstring='strict')}
        elif isinstance(o, Mapping):
            
            value = dict(o)
        elif isinstance(o, (datetime.date, datetime.datetime)):
            
            value = o.isoformat()
        else:
            
            value = super(AnsibleJSONEncoder, self).default(o)
        return value
    def iterencode(self, o, **kwargs):
        """Custom iterencode, primarily design to handle encoding ``AnsibleUnsafe``
        as the ``AnsibleUnsafe`` subclasses inherit from string types and
        ``json.JSONEncoder`` does not support custom encoders for string types
        """
        if self._preprocess_unsafe:
            o = _preprocess_unsafe_encode(o)
        return super(AnsibleJSONEncoder, self).iterencode(o, **kwargs)