noderings.cloud.marketplace_offer_info module – Find NodeRings marketplace offers for a plan code in a city

Note

This module is part of the noderings.cloud collection (version 0.2.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 noderings.cloud. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: noderings.cloud.marketplace_offer_info.

New in noderings.cloud 0.1.0

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.9

Parameters

Parameter

Comments

api_retries

integer

How many times a request is retried after rate limiting (HTTP 429) or a gateway error (HTTP 502, 503 or 504).

Orders (virtual machines, game servers, snapshots) are never retried blindly.

Default: 5

api_timeout

integer

Timeout in seconds for a single HTTP request.

Default: 60

api_token

aliases: token

string

A NodeRings service-account token.

Create one in the NodeRings console under Organization > Service accounts.

If not set, the value of the NODERINGS_TOKEN, NODERINGS_API_TOKEN or NR_API_TOKEN environment variable is used.

api_url

string

Base URL of the NodeRings API.

If not set, the value of the NODERINGS_API_URL environment variable is used.

Default: "https://api.noderings.com"

asset_type

string

What is ordered. Only checked when the provider is known (provider_id, storefront_slug, or provider given as an ID or storefront slug).

Choices:

  • "virtual_machine" ← (default)

  • "game_server"

billing_type

string

usage (billed hourly from credit), subscription (billed monthly) or free.

Strongly recommended; without it each provider offers one plan of its choice for the code.

Choices:

  • "usage"

  • "subscription"

  • "free"

city

string / required

City, for example Frankfurt (case-insensitive).

country

string / required

Country, for example Germany (case-insensitive). See noderings.cloud.marketplace_region_info.

fail_if_none

boolean

Fail when no offer matches. With false, offer is empty instead.

Choices:

  • false

  • true ← (default)

organization_id

string

Organization to act in, sent as the X-Organization-ID header.

Defaults to the organization the token belongs to.

If not set, the value of the NODERINGS_ORGANIZATION_ID or NR_ORGANIZATION_ID environment variable is used.

plan_code

string / required

Platform plan code, for example SC-GC-1C-1G-20. See noderings.cloud.marketplace_plan_info.

provider

string

Only offers from this hosting provider, given by its provider ID, its storefront slug (for example acme-hosting) or its name (for example Acme Hosting, in any case).

A name that more than one provider uses fails; give the provider ID or storefront slug then.

Mutually exclusive with provider_id and storefront_slug.

provider_id

string

Only offers from this provider.

require_capabilities

list / elements=string

Only providers whose platform supports all of these, for example guest_firewall, on_demand_backup, snapshots or instant_apps.

Default: []

require_ipv6

boolean

Only offers with IPv6 in the city.

Choices:

  • false ← (default)

  • true

sort

string

price sorts by the compute price (cheapest first), rating by the provider’s rating (best first).

Choices:

  • "price" ← (default)

  • "rating"

storefront_slug

string

Only offers from the provider with this public storefront, for example acme-hosting.

validate_certs

boolean

Whether to validate the API’s TLS certificate.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying the target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • All modules in this collection belong to the noderings.cloud.noderings action group, so connection options can be set once with module_defaults.

Examples

- name: Cheapest hourly 1 vCPU / 1 GB server in Ashburn with a firewall
  noderings.cloud.marketplace_offer_info:
    plan_code: SC-GC-1C-1G-20
    country: United States
    city: Ashburn
    billing_type: usage
    require_capabilities: [guest_firewall]
  register: found

- name: Offers from one provider, by name
  noderings.cloud.marketplace_offer_info:
    plan_code: SC-GC-1C-1G-20
    country: United States
    city: Ashburn
    billing_type: usage
    provider: Acme Hosting
  register: acme

- name: Order exactly that offer
  noderings.cloud.virtual_machine:
    hostname: web-1
    plan_id: "{{ found.offer.plan_id }}"
    region_id: "{{ found.offer.region_id }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

offer

dictionary

The best offer. Empty when none matched and fail_if_none=false.

Returned: always

billing_type

string

usage, subscription or free.

Returned: success

capabilities

list / elements=string

What the provider’s platform supports.

Returned: success

plan_id

string

ID of the provider’s plan for the code.

Returned: success

prices

list / elements=dictionary

Price lines of the plan.

Returned: success

provider_id

string

ID of the hosting provider.

Returned: success

provider_name

string

Name of the hosting provider.

Returned: success

rating

float

Provider rating.

Returned: success

region_id

string

ID of the city at that provider.

Returned: success

offers

list / elements=dictionary

Every matching offer, best first.

Returned: always

Authors

  • Shaygun (@shaygun)