rhub.rhub.rhub_api lookup – Interacts with Resource Hub API.

Note

This lookup plugin is part of the rhub.rhub collection.

To install it, use: ansible-galaxy collection install rhub.rhub.

To use it in a playbook, specify: rhub.rhub.rhub_api.

Synopsis

  • Retrieve data from Resource Hub API.

Terms

Parameter

Comments

Terms

string / required

API endpoint path.

Parameters

Parameter

Comments

addr

string

Resource Hub base address.

If not set the environment variable RHUB_API_ADDR will be used.

Configuration:

  • Environment variable: RHUB_API_ADDR

token

string

API auth token.

If not set the environment variable RHUB_API_TOKEN will be used.

Configuration:

  • Environment variable: RHUB_API_TOKEN

Examples

- name: get cluster info
  ansible.builtin.debug:
    msg: "{{ lookup('rhub.rhub.rhub_api', '/v0/lab/cluster/1', addr='https://rhub.stage.example.com/') }}"

Return Value

Key

Description

Return value

list / elements=any

Data returned from the API or problem data (RFC 7807).

Returned: success

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.