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

text = []
    snippet = "lookup('%s', " % doc.get('plugin', doc.get('name'))
    comment = []
    for o in sorted(doc['options'].keys()):
        opt = doc['options'][o]
        comment.append('# %s(%s): %s' % (o, opt.get('type', 'string'), opt.get('description', '')))
        if o in ('_terms', '_raw', '_list'):
            
            snippet += '< %s >' % (o)
            continue
        required = opt.get('required', False)
        if not isinstance(required, bool):
            raise ValueError("Incorrect value for 'Required', a boolean is needed: %s" % required)
        if required:
            default = '<REQUIRED>'
        else:
            default = opt.get('default', 'None')
        if opt.get('type') in ('string', 'str'):
            snippet += ", %s='%s'" % (o, default)
        else:
            snippet += ', %s=%s' % (o, default)
    snippet += ")"
    if comment:
        text.extend(comment)
        text.append('')
    text.append(snippet)
    return text
def main(args=None):