stephrobert.scaleway.instance_server_info module – Gather information about Scaleway Instance servers

Note

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

To use it in a playbook, specify: stephrobert.scaleway.instance_server_info.

New in stephrobert.scaleway 0.1.0

Synopsis

  • Get the details of a specified Instance.

  • List all Instances in a specified Availability Zone, e.g. `fr-par-1`.

Requirements

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

  • scaleway >= 2.9.0

Parameters

Parameter

Comments

access_key

string

Scaleway API access key.

api_allow_insecure

boolean

Allow the API endpoint to be reached without verifying its TLS certificate.

Falls back to the Scaleway configuration file, then to false.

Choices:

  • false

  • true

api_timeout

integer

Seconds allowed for a single API call, connection and read.

Without a limit a silent connection would hang the module forever: the Scaleway SDK issues its requests with no timeout at all.

This bounds a single call, not a whole wait. Modules that can wait for a state bound the overall wait separately.

Default: 60

api_url

string

URL of the Scaleway API endpoint.

Point it at a local emulator to exercise a playbook without credentials.

Falls back to the Scaleway configuration file, then to https://api.scaleway.com. It carries no module default on purpose: a default is never unset, so it would always override the profile.

commercial_type

string

List Instances of this commercial type.

config_file

path

Path to the Scaleway configuration file.

name

string

Filter Instances by name (eg. “server1” will return “server100” and “server1” but not “foo”).

order

string

Define the order of the returned servers.

Choices:

  • "creation_date_desc"

  • "creation_date_asc"

  • "modification_date_desc"

  • "modification_date_asc"

organization

string

List only Instances of this Organization ID.

organization_id

string

Default Organization ID used when an operation does not name one.

private_ip

string

List Instances by private_ip. (IP address)

Deprecated by the Scaleway API contract.

private_network

string

List Instances in this Private Network.

private_networks

string

List Instances from the given Private Networks (use commas to separate them).

private_nic_mac_address

string

List Instances associated with the given private NIC MAC address.

profile

string

Name of the profile to read in the Scaleway configuration file.

project

string

List only Instances of this Project ID.

project_id

string

Default Project ID used when an operation does not name one.

secret_key

string

Scaleway API secret key.

server_id

string

UUID of the Instance you want to get.

servers

string

List Instances from these server ids (use commas to separate them).

state

string

List Instances in this state.

Choices:

  • "running"

  • "stopped"

  • "stopped in place"

  • "starting"

  • "stopping"

  • "locked"

tags

list / elements=string

List Instances with these exact tags (to filter with several tags, use commas to separate them).

user_agent

string

Value of the User-Agent header sent to the API.

with_ip

string

List Instances by IP (both private_ip and public_ip are supported). (IP address)

without_ip

boolean

List Instances that are not attached to a public IP.

Choices:

  • false

  • true

zone

string / required

The zone you want to target

Choices:

  • "fr-par-1"

  • "fr-par-2"

  • "fr-par-3"

  • "nl-ams-1"

  • "nl-ams-2"

  • "nl-ams-3"

  • "pl-waw-1"

  • "pl-waw-2"

  • "pl-waw-3"

  • "it-mil-1"

Attributes

Attribute

Support

Description

check_mode

Support: full

This module only reads, so check mode changes nothing about how it runs.

diff_mode

Support: none

This module changes nothing, so it has no difference to report.

Notes

Note

  • Every option can be set from its environment variable, respectively SCW_PROFILE, SCW_CONFIG_PATH, SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_API_URL, SCW_DEFAULT_ORGANIZATION_ID and SCW_DEFAULT_PROJECT_ID.

  • Module options take precedence over environment variables, which take precedence over the configuration file.

Examples

# This module only reads: it never changes anything, and check mode
# is native.
#
# `server_id` decides which of the two reads runs: given, the
# module returns that one resource; omitted, it lists them all,
# walking every page rather than returning the first one in silence.

- name: Get an Instance
  stephrobert.scaleway.instance_server_info:
    zone: fr-par-1
    server_id: 11111111-2222-3333-4444-555555555555
  register: result
- name: List all Instances
  stephrobert.scaleway.instance_server_info:
    zone: fr-par-1
  register: result
- name: Filter Scaleway Instance servers by tags
  stephrobert.scaleway.instance_server_info:
    zone: fr-par-1
    tags:
    - production
  register: result

Return Values

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

Key

Description

server

dictionary

Get the details of a specified Instance.

Returned: when server_id is provided

admin_password_encrypted_value

string

A base64 encoded string containing the admin password encrypted with the public key pointed to by admin_password_encryption_ssh_key_id. This value is reset when admin_password_encryption_ssh_key_id is set to an empty string.

Returned: when the API returns it

admin_password_encryption_ssh_key_id

string

UUID of the SSH RSA key that will be used to encrypt the initial admin password for OS requiring it. Mandatory for Windows OS. The public_key value of this key is used to encrypt the admin password. When set to an empty string, reset this value and admin_password_encrypted_value to an empty string so a new password may be generated.

Returned: when the API returns it

allowed_actions

list / elements=string

List of allowed actions on the Instance.

Returned: when the API returns it

arch

string

Instance architecture.

Returned: when the API returns it

boot_type

string

Instance boot type.

Returned: when the API returns it

commercial_type

string

Instance commercial type (eg. GP1-M).

Returned: when the API returns it

creation_date

string

Instance creation date. (RFC 3339 format)

Returned: when the API returns it

dns

string

Public DNS of the server.

Returned: when the API returns it

dynamic_ip_required

boolean

True if a dynamic IPv4 is required.

Returned: when the API returns it

enable_ipv6

boolean

True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

end_of_service

boolean

True if the Instance type has reached end of service.

Returned: when the API returns it

filesystems

list / elements=dictionary

List of attached filesystems.

Returned: when the API returns it

hostname

string

Instance host name.

Returned: when the API returns it

id

string

Instance unique ID.

Returned: when the API returns it

image

dictionary

Information about the Instance image.

Returned: when the API returns it

ipv6

dictionary

Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

location

dictionary

Instance location.

Returned: when the API returns it

mac_address

string

The server’s MAC address.

Returned: when the API returns it

maintenances

list / elements=dictionary

Instance planned maintenance.

Returned: when the API returns it

modification_date

string

Instance modification date. (RFC 3339 format)

Returned: when the API returns it

name

string

Instance name.

Returned: when the API returns it

organization

string

Instance Organization ID.

Returned: when the API returns it

placement_group

dictionary

Instance placement group.

Returned: when the API returns it

private_ip

string

Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).

Returned: when the API returns it

private_nics

list / elements=dictionary

Instance private NICs.

Returned: when the API returns it

project

string

Instance Project ID.

Returned: when the API returns it

protected

boolean

Defines whether the Instance protection option is activated.

Returned: when the API returns it

public_ip

dictionary

Information about the public IP (deprecated in favor of `public_ips`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

public_ips

list / elements=dictionary

Information about all the public IPs attached to the server.

Returned: when the API returns it

routed_ip_enabled

boolean

True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.

Deprecated by the Scaleway API contract.

Returned: when the API returns it

security_group

dictionary

Instance security group.

Returned: when the API returns it

state

string

Instance state.

Returned: when the API returns it

state_detail

string

Detailed information about the Instance state.

Returned: when the API returns it

tags

list / elements=string

Tags associated with the Instance.

Returned: when the API returns it

volumes

dictionary

Instance volumes.

Returned: when the API returns it

zone

string

Zone in which the Instance is located.

Returned: when the API returns it

servers

list / elements=dictionary

List all Instances in a specified Availability Zone, e.g. `fr-par-1`.

Returned: when server_id is omitted

admin_password_encrypted_value

string

A base64 encoded string containing the admin password encrypted with the public key pointed to by admin_password_encryption_ssh_key_id. This value is reset when admin_password_encryption_ssh_key_id is set to an empty string.

Returned: when the API returns it

admin_password_encryption_ssh_key_id

string

UUID of the SSH RSA key that will be used to encrypt the initial admin password for OS requiring it. Mandatory for Windows OS. The public_key value of this key is used to encrypt the admin password. When set to an empty string, reset this value and admin_password_encrypted_value to an empty string so a new password may be generated.

Returned: when the API returns it

allowed_actions

list / elements=string

List of allowed actions on the Instance.

Returned: when the API returns it

arch

string

Instance architecture.

Returned: when the API returns it

boot_type

string

Instance boot type.

Returned: when the API returns it

commercial_type

string

Instance commercial type (eg. GP1-M).

Returned: when the API returns it

creation_date

string

Instance creation date. (RFC 3339 format)

Returned: when the API returns it

dns

string

Public DNS of the server.

Returned: when the API returns it

dynamic_ip_required

boolean

True if a dynamic IPv4 is required.

Returned: when the API returns it

enable_ipv6

boolean

True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

end_of_service

boolean

True if the Instance type has reached end of service.

Returned: when the API returns it

filesystems

list / elements=dictionary

List of attached filesystems.

Returned: when the API returns it

hostname

string

Instance host name.

Returned: when the API returns it

id

string

Instance unique ID.

Returned: when the API returns it

image

dictionary

Information about the Instance image.

Returned: when the API returns it

ipv6

dictionary

Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

location

dictionary

Instance location.

Returned: when the API returns it

mac_address

string

The server’s MAC address.

Returned: when the API returns it

maintenances

list / elements=dictionary

Instance planned maintenance.

Returned: when the API returns it

modification_date

string

Instance modification date. (RFC 3339 format)

Returned: when the API returns it

name

string

Instance name.

Returned: when the API returns it

organization

string

Instance Organization ID.

Returned: when the API returns it

placement_group

dictionary

Instance placement group.

Returned: when the API returns it

private_ip

string

Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).

Returned: when the API returns it

private_nics

list / elements=dictionary

Instance private NICs.

Returned: when the API returns it

project

string

Instance Project ID.

Returned: when the API returns it

protected

boolean

Defines whether the Instance protection option is activated.

Returned: when the API returns it

public_ip

dictionary

Information about the public IP (deprecated in favor of `public_ips`).

Deprecated by the Scaleway API contract.

Returned: when the API returns it

public_ips

list / elements=dictionary

Information about all the public IPs attached to the server.

Returned: when the API returns it

routed_ip_enabled

boolean

True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.

Deprecated by the Scaleway API contract.

Returned: when the API returns it

security_group

dictionary

Instance security group.

Returned: when the API returns it

state

string

Instance state.

Returned: when the API returns it

state_detail

string

Detailed information about the Instance state.

Returned: when the API returns it

tags

list / elements=string

Tags associated with the Instance.

Returned: when the API returns it

volumes

dictionary

Instance volumes.

Returned: when the API returns it

zone

string

Zone in which the Instance is located.

Returned: when the API returns it

Authors

  • Stéphane Robert (@stephrobert)