|
|
|
|
@ -44,42 +44,105 @@ options:
|
|
|
|
|
type: boolean
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
default: False
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_force
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_FORCE
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: force
|
|
|
|
|
timeout:
|
|
|
|
|
description: How long to wait for the server to send data before giving up
|
|
|
|
|
type: float
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
default: 10
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_timeout
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_TIMEOUT
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: timeout
|
|
|
|
|
http_agent:
|
|
|
|
|
description: User-Agent to use in the request
|
|
|
|
|
type: string
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_agent
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_AGENT
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: agent
|
|
|
|
|
force_basic_auth:
|
|
|
|
|
description: Force basic authentication
|
|
|
|
|
type: boolean
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
default: False
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_agent
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_AGENT
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: agent
|
|
|
|
|
follow_redirects:
|
|
|
|
|
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
|
|
|
|
|
type: string
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
default: 'urllib2'
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_follow_redirects
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: follow_redirects
|
|
|
|
|
use_gssapi:
|
|
|
|
|
description: Use GSSAPI handler of requests
|
|
|
|
|
type: boolean
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
default: False
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_use_gssapi
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_USE_GSSAPI
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: use_gssapi
|
|
|
|
|
unix_socket:
|
|
|
|
|
description: String of file system path to unix socket file to use when establishing connection to the provided url
|
|
|
|
|
type: string
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_unix_socket
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_UNIX_SOCKET
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: unix_socket
|
|
|
|
|
ca_path:
|
|
|
|
|
description: String of file system path to CA cert bundle to use
|
|
|
|
|
type: string
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_ca_path
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_CA_PATH
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: ca_path
|
|
|
|
|
unredirected_headers:
|
|
|
|
|
description: A list of headers to not attach on a redirected request
|
|
|
|
|
type: list
|
|
|
|
|
version_added: "2.10"
|
|
|
|
|
vars:
|
|
|
|
|
- name: ansible_lookup_url_unredir_headers
|
|
|
|
|
env:
|
|
|
|
|
- name: ANSIBLE_LOOKUP_URL_UNREDIR_HEADERS
|
|
|
|
|
ini:
|
|
|
|
|
- section: url_lookup
|
|
|
|
|
- key: unredirected_headers
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
EXAMPLES = """
|
|
|
|
|
@ -119,7 +182,7 @@ class LookupModule(LookupBase):
|
|
|
|
|
|
|
|
|
|
def run(self, terms, variables=None, **kwargs):
|
|
|
|
|
|
|
|
|
|
self.set_options(direct=kwargs)
|
|
|
|
|
self.set_options(var_options=variables, direct=kwargs)
|
|
|
|
|
|
|
|
|
|
ret = []
|
|
|
|
|
for term in terms:
|
|
|
|
|
|