diff --git a/lib/ansible/plugins/lookup/url.py b/lib/ansible/plugins/lookup/url.py index ea77aa6a962..936c9537e87 100644 --- a/lib/ansible/plugins/lookup/url.py +++ b/lib/ansible/plugins/lookup/url.py @@ -5,32 +5,36 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ - lookup: url - author: Brian Coca - version_added: "1.9" - short_description: return contents from URL - description: - _terms: - description: urls to query - validate_certs: - description: Flag to control SSL certificate validation - type: boolean - default: True - split_lines: - description: Flag to control if content is returned as a list of lines or as a single text blob - type: boolean - default: True - use_proxy: - description: Flag to control if the lookup will observe HTTP proxy environment variables when present. - type: boolean - default: True +lookup: url +author: Brian Coca (@bcoca) +version_added: "1.9" +short_description: return contents from URL +description: + - Returns the content of the URL requested to be used as data in play. +options: + _terms: + description: urls to query + validate_certs: + description: Flag to control SSL certificate validation + type: boolean + default: True + split_lines: + description: Flag to control if content is returned as a list of lines or as a single text blob + type: boolean + default: True + use_proxy: + description: Flag to control if the lookup will observe HTTP proxy environment variables when present. + type: boolean + default: True """ EXAMPLES = """ - name: url lookup splits lines by default debug: msg="{{item}}" - with_url: - - 'https://github.com/gremlin.keys' + loop: "{{ lookup('url', 'https://github.com/gremlin.keys', wantlist=True) }}" + +- name: display ip ranges + debug: msg="{{ lookup('url', 'https://ip-ranges.amazonaws.com/ip-ranges.json', splitlines=False) }}" """ RETURN = """