community.internal_test_tools._open_url_test_lookup lookup – Test plugin for the open_url test framework (DO NOT USE THIS!)

Note

This lookup plugin is part of the community.internal_test_tools collection (version 0.12.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.internal_test_tools.

To use it in a playbook, specify: community.internal_test_tools._open_url_test_lookup.

New in community.internal_test_tools 0.3.0

Synopsis

  • DO NOT USE THIS!

Terms

Parameter

Comments

Terms

list / elements=string / required

URLs to query.

Keyword parameters

This describes keyword parameters of the lookup. These are the values key1=value1, key2=value2 and so on in the following examples: lookup('community.internal_test_tools._open_url_test_lookup', key1=value1, key2=value2, ...) and query('community.internal_test_tools._open_url_test_lookup', key1=value1, key2=value2, ...)

Parameter

Comments

data

string

Data to send (Base64 encoded).

force_basic_auth

boolean

added in community.internal_test_tools 0.7.0

Force passing Authorization header on the first request when url_username and url_password are used.

Choices:

  • false

  • true

headers

dictionary

HTTP headers.

method

string

HTTP method.

Default: "GET"

timeout

float

added in community.internal_test_tools 0.7.0

Timeout in seconds

url_password

string

added in community.internal_test_tools 0.7.0

The password for use with HTTP Basic Authentication.

url_username

string

added in community.internal_test_tools 0.7.0

The username for use with HTTP Basic Authentication.

Notes

Note

  • When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters: lookup('community.internal_test_tools._open_url_test_lookup', term1, term2, key1=value1, key2=value2) and query('community.internal_test_tools._open_url_test_lookup', term1, term2, key1=value1, key2=value2)

Examples

- name: Do a lookup
  ansible.builtin.debug:
    msg: "{{ lookup('community.internal_test_tools.open_url_test_lookup', 'https://example.com', method='GET', headers={'foo': 'bar'}) }}"

Return Value

Key

Description

Return value

list / elements=dictionary

Results of HTTP calls.

Returned: success

Sample: [{"content": "1.2.3.4", "headers": {}, "status": 200}]

content

string

Content (Base64 encoded).

Returned: success

Sample: "1.2.3.4"

headers

dictionary

Headers.

Returned: success

Sample: {}

status

integer

HTTP status of request.

Returned: success

Sample: 200

Authors

  • Felix Fontein (@felixfontein)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.