serverscom.sc_api.sc_cloud_computing_instance_reinstall (0.0.2) — module

Reinstall cloud computing instance

| "added in version" 1.0.0 of serverscom.sc_api"

Authors: George Shuklin (@amarao)

preview | supported by community

Install collection

Install with ansible-galaxy collection install serverscom.sc_api:==0.0.2


Add to requirements.yml

  collections:
    - name: serverscom.sc_api
      version: 0.0.2

Description

Perform rebuild of the instance.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List all flavors
  sc_cloud_computing_instance_info:
    token: '{{ sc_token }}'
    instance_id: M7e5Ba2v
  register: instance
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print information about instance
  debug:
    msg: |
      Instance {{ instance.name }} has IP {{ instance.public_ipv4_address }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Waiting for instance to become ACTIVE
  sc_cloud_computing_instance_info:
    token: '{{ sc_token }}'
    instance_id: M7e5Ba2v
  register: instance
  until: instance.status == 'ACTIVE'
  delay: 10
  retries: 30

Inputs

    
token:
    description:
    - Token to use.
    - You can create token for you account in https://portal.servers.com in Profile ->
      Public API section.
    required: true
    type: str

endpoint:
    default: https://api.servers.com/v1
    description:
    - Endpoint to use to connect to API.
    - Do not change until specifically asked to do otherwise.
    type: str

image_id:
    description:
    - Id of the image.
    - Module will use current image for instance if not specified.
    required: false
    type: str

instance_id:
    description:
    - Id of the instance.
    required: true
    type: str

update_interval:
    default: 5
    description:
    - Polling interval for waiting (both ACTIVE and REBUILDING).
    - Every polling request is reducing API ratelimits.
    required: false
    type: int

wait_for_active:
    default: 300
    description:
    - Time to wait until instance become ACTIVE again.
    - Value C(0) is used to disable wait for ACTIVE status.
    - Does not affect rebuild wait time.
    - If instance is not become active in I(wait) seconds, module fails.
    required: false
    type: int

wait_for_rebuilding:
    default: 60
    description:
    - Time to wait for instance switch to REBUILDING status.
    - Value C(0) is used to disable wait for REBUILDING state.
    - I(wait_for_rebuilding)=C(0) and non-zero I(wait_for_active) is not supported.
    - If both I(wait_for_rebuilding) and I(wait_for_active) set to C(0) module works in
      'fire-and-forget' mode.
    required: false
    type: int

Outputs

api_url:
  description: URL for the failed request
  returned: on failure
  type: str
created_at:
  description:
  - Date of creation of the instance.
  returned: on success
  type: str
flavor_id:
  description:
  - Id of the instance's flavor.
  returned: on success
  type: str
flavor_name:
  description:
  - Human-readable name of the instance's flavor.
  returned: on success
  type: str
gpn_enabled:
  description:
  - Flag is Global Private Network was enabled for instance.
  - Flag may not prepresent private_ipv4_address if private interface was detached
    via Openstack API.
  returned: on success
  type: bool
id:
  description:
  - Id of the instance.
  returned: on success
  type: str
image_id:
  description:
  - Id of the image or snapshot used for instance build/rebuild.
  returned: on success
  type: str
image_name:
  description:
  - Name of the image.
  - May be absent if image was removed.
  returned: on success
  type: str
ipv6_enabled:
  description:
  - Flag if IPv6 was enabled for instance.
  returned: on success
  type: bool
name:
  description:
  - Name of the instance.
  returned: on success
  type: str
openstack_uuid:
  description:
  - UUID of the instance in the Openstack API.
  - May be missing at some stages of lifecycle.
  returned: on success
  type: str
private_ipv4_address:
  description:
  - IPv4 address for instance.
  - May be missing if no private network is connected to the instance.
  returned: on success
  type: str
public_ipv4_address:
  description:
  - IPv4 address for instance.
  - May be missing if public inteface was detached via Openstack API.
  returned: on success
  type: str
public_ipv6_address:
  description:
  - IPv5 address for instance.
  - May be missing if no IPv6 address was ordered or public inteface was detached
    via Openstack API.
  returned: on success
  type: str
region_code:
  description:
  - Human-readable code for region.
  returned: on success
  type: str
region_id:
  description:
  - Id of the region.
  - Same as in I(region_id).
  returned: on success
  type: int
status:
  description:
  - Current status for the instance.
  - ACTIVE - a normal, operational status of a cloud instance.
  - SWITCHED_OFF, SWITCHING_OFF, SWITCHING_ON, REBOOTING - power states for ACTIVE
    instance.
  - PENDING - order for new instance is been processed.
  - CREATING, BUILDING, REBUILDING, PROVISIONING, DELETING and DELETED stages of lifecycle.
  - AWAITING_UPGRADE_CONFIRM - instance is waiting for confirm (instances are autoconfirm
    in 72hr.)
  - UPGRADING, REVERTING_UPGRADE - stages of upgrade lifecycle.
  - CREATING_SNAPSHOT - Instance snapshot is creating.
  - BUSY - Instance is not available for API operations.
  - ERROR - Instance was failed or wasn't created.
  - KEYPAIR_NOT_FOUND - SSH key wasn't found, please check if you are using a correct
    key.
  - QUOTA_EXCEEDED - at creation time, chosen flavor exceeded quota. Please contact
    support for raising quota.
  - RESCUING, RESCUE - states for rescue operation for instance.
  returned: on success
  type: str
status_code:
  description: Status code for the request
  returned: on failure
  type: int
updated_at:
  description:
  - Date of last update for the instance.
  returned: on success
  type: str