ansible / ansible.builtin / v2.7.16 / lookup / url return contents from URL | "added in version" 1.9 of ansible.builtin" Authors: Brian Coca (@bcoca)ansible.builtin.url (v2.7.16) — lookup
pip
Install with pip install ansible==2.7.16
Returns the content of the URL requested to be used as data in play.
- name: url lookup splits lines by default debug: msg="{{item}}" 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', split_lines=False) }}"
_terms: description: urls to query use_proxy: default: true description: Flag to control if the lookup will observe HTTP proxy environment variables when present. type: boolean split_lines: default: true description: Flag to control if content is returned as a list of lines or as a single text blob type: boolean validate_certs: default: true description: Flag to control SSL certificate validation type: boolean
_list: description: list of list of lines or content of url(s)