stephrobert.scaleway.instance_server module – Manage a Scaleway Instance server
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.
New in stephrobert.scaleway 0.1.0
Synopsis
Update the Instance information, such as name, boot mode, or tags.
The module reads the resource first and writes only the fields that differ, so a second run reports no change.
Requirements
The below requirements are needed on the host that executes this module.
scaleway >= 2.9.0
Parameters
Parameter |
Comments |
|---|---|
Scaleway API access key. |
|
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. To clear this field, write `admin_password_encryption_ssh_key_id: “”`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Allow the API endpoint to be reached without verifying its TLS certificate. Falls back to the Scaleway configuration file, then to Choices:
|
|
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: |
|
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 |
|
Instance boot type. Choices:
|
|
Set the commercial_type for this Instance. Warning: This field has some restrictions: - Cannot be changed if the Instance is not in `stopped` state. - Cannot be changed if the Instance is in a placement group. - Cannot be changed from/to a Windows offer to/from a Linux offer. - Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB). To clear this field, write `commercial_type: “”`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Path to the Scaleway configuration file. |
|
True if a dynamic IPv4 is required. The contract marks this field clearable, but bool has no empty value, so the API cannot clear it. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. Choices:
|
|
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`). Deprecated by the Scaleway API contract. The contract marks this field clearable, but bool has no empty value, so the API cannot clear it. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. Choices:
|
|
Name of the Instance. To clear this field, write `name: “”`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Default Organization ID used when an operation does not name one. |
|
Placement group ID if Instance must be part of a placement group. To clear this field, write `placement_group: “”`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Instance private NICs. To clear this field, write `private_nics: []`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Name of the profile to read in the Scaleway configuration file. |
|
Default Project ID used when an operation does not name one. |
|
True to activate server protection option. The contract marks this field clearable, but bool has no empty value, so the API cannot clear it. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. Choices:
|
|
A list of reserved IP IDs to attach to the Instance. To clear this field, write `public_ips: []`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False). Deprecated by the Scaleway API contract. The contract marks this field clearable, but bool has no empty value, so the API cannot clear it. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. Choices:
|
|
Scaleway API secret key. |
|
Instance security group. |
|
UUID of the Instance. |
|
Tags of the Instance. To clear this field, write `tags: []`; omit the option to leave the current value untouched. Setting it to null is refused: this API reads null as “field not provided” and would change nothing. |
|
Value of the User-Agent header sent to the API. |
|
Instance volumes. |
|
The zone you want to target Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
In check mode the module reads the resource and compares it, then reports what it would write without writing it. |
|
Support: full |
The module reports the fields that differ, read through the same projection the comparison uses. |
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_IDandSCW_DEFAULT_PROJECT_ID.Module options take precedence over environment variables, which take precedence over the configuration file.
Examples
# The module reads the resource, compares, and writes only what
# differs: run it twice and the second run reports no change.
#
# Check mode compares without writing, and `--diff` shows what would
# change. A parameter you do not pass is a parameter the module does
# not touch.
- name: Update a Scaleway Instance server
stephrobert.scaleway.instance_server:
zone: fr-par-1
server_id: 11111111-2222-3333-4444-555555555555
name: my-server
register: result
- name: Preview the change on a Scaleway Instance server without writing
stephrobert.scaleway.instance_server:
zone: fr-par-1
server_id: 11111111-2222-3333-4444-555555555555
name: my-server
register: result
check_mode: true
diff: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Get the details of a specified Instance. Returned: success |
|
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 |
|
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 |
|
List of allowed actions on the Instance. Returned: when the API returns it |
|
Instance architecture. Returned: when the API returns it |
|
Instance boot type. Returned: when the API returns it |
|
Instance commercial type (eg. GP1-M). Returned: when the API returns it |
|
Instance creation date. (RFC 3339 format) Returned: when the API returns it |
|
Public DNS of the server. Returned: when the API returns it |
|
True if a dynamic IPv4 is required. Returned: when the API returns it |
|
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 |
|
True if the Instance type has reached end of service. Returned: when the API returns it |
|
List of attached filesystems. Returned: when the API returns it |
|
Instance host name. Returned: when the API returns it |
|
Instance unique ID. Returned: when the API returns it |
|
Information about the Instance image. Returned: when the API returns it |
|
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`). Deprecated by the Scaleway API contract. Returned: when the API returns it |
|
Instance location. Returned: when the API returns it |
|
The server’s MAC address. Returned: when the API returns it |
|
Instance planned maintenance. Returned: when the API returns it |
|
Instance modification date. (RFC 3339 format) Returned: when the API returns it |
|
Instance name. Returned: when the API returns it |
|
Instance Organization ID. Returned: when the API returns it |
|
Instance placement group. Returned: when the API returns it |
|
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`). Returned: when the API returns it |
|
Instance private NICs. Returned: when the API returns it |
|
Instance Project ID. Returned: when the API returns it |
|
Defines whether the Instance protection option is activated. Returned: when the API returns it |
|
Information about the public IP (deprecated in favor of `public_ips`). Deprecated by the Scaleway API contract. Returned: when the API returns it |
|
Information about all the public IPs attached to the server. Returned: when the API returns it |
|
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 |
|
Instance security group. Returned: when the API returns it |
|
Instance state. Returned: when the API returns it |
|
Detailed information about the Instance state. Returned: when the API returns it |
|
Tags associated with the Instance. Returned: when the API returns it |
|
Instance volumes. Returned: when the API returns it |
|
Zone in which the Instance is located. Returned: when the API returns it |