rhub.rhub.rhub_api module – Interacts with Resource Hub API.
Note
This module 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
Interacts with Resource Hub API.
Parameters
Parameter |
Comments |
|---|---|
Resource Hub base address. If not set the environment variable |
|
Resource Hub base address. |
|
HTTP API method. Choices:
|
|
API endpoint path. |
|
API auth token. If not set the environment variable |
Examples
- name: get region info
rhub.rhub.rhub_api:
addr: https://rhub.example.com
token: s3cr3t_t0k3n
method: GET
path: /v0/lab/region/1
- name: launch tower template
rhub.rhub.rhub_api:
addr: https://rhub.example.com
token: s3cr3t_t0k3n
method: POST
path: /v0/tower/template/123/launch
body:
extra_vars:
cluster_id: 1
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Response data when request succeeded and API returned data (ie. DELETE doesn’t return any data) Returned: success |
|
Problem data (RFC 7807) Returned: failure |