serverscom.sc_api.sc_dedicated_server_info (0.1.0) — module

Information about existing dedicated server

| "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.1.0


Add to requirements.yml

  collections:
    - name: serverscom.sc_api
      version: 0.1.0

Description

Retrive information about existing dedicated baremetal server.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get server info
  serverscom.sc_api.sc_dedicated_server_info:
    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzgxMjEsInR5cGUiOiJVc2VyIiwiYWNjZXNzX2dyYW50X2lkIjoyNjgwNywiZXhwIjoyMjI2OTk3NjMwfQ.rO4nGXNgXggjNmMJBLXovOh1coNrDWl4dGrGFupYXJE'
    id: '0m592Zmn'
  register: srv
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Report server information
  debug:
    msg: 'Server {{ srv.name }} has IP {{ srv.public_ipv4_address }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Wait until server is ready
  serverscom.sc_api.sc_dedicated_server_info:
    token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzgxMjEsInR5cGUiOiJVc2VyIiwiYWNjZXNzX2dyYW50X2lkIjoyNjgwNywiZXhwIjoyMjI2OTk3NjMwfQ.rO4nGXNgXggjNmMJBLXovOh1coNrDWl4dGrGFupYXJE'
    id: '0m592Zmn'
  register: srv
  until: srv.ready
  delay: 30
  retries: 300

Inputs

    
name:
    aliases:
    - id
    description:
    - ID of the server.
    - Translates to server_id in API.
    - If ID is malformed, error 400 is returned.
    required: true
    type: str

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

fail_on_absent:
    default: true
    description:
    - Raise error if server is not found.
    - If set to false, absent (not found) server will have found=false in server info.
    type: bool

Outputs

configuration:
  description:
  - Server configuration
  returned: on success
  type: str
configuration_details:
  contains:
    bandwidth_id:
      description:
      - ID of the bandwidth accounting item associated with server.
      - May be absent.
      type: str
    bandwidth_name:
      description:
      - Name of the bandwidth accounting item associated with server.
      - May be absent.
      type: str
    operating_system_full_name:
      description:
      - Name of the installed OS on the server.
      - May be absent.
      type: str
    operating_system_id:
      description:
      - ID of the installed OS on the server.
      - May be absent.
      type: str
    private_uplink_id:
      description:
      - ID of the server uplink in the private network.
      - May be absent.
      type: str
    private_uplink_name:
      description:
      - Name of the server uplink in the private network.
      - May be absent.
      type: str
    public_uplink_id:
      description:
      - ID of the server uplink in the public network.
      - May be absent.
      type: str
    public_uplink_name:
      description:
      - Name of the server uplink in the public network.
      - May be absent.
      type: str
    ram_size:
      description:
      - server RAM.
      - May be absent.
      type: int
    server_model_id:
      description:
      - Internal ID of the server model.
      - May be absent.
      type: str
  description:
  - Structured server configuration
  returned: on success
  type: complex
created_at:
  description:
  - Date the server object was created in database.
  returned: on success
  type: str
found:
  description:
  - Set to true if server is found.
  - Set to false if server is not found and I(can_be_absent)=C(true)
  returned: on success
  type: bool
id:
  description:
  - ID of the server
  returned: on success
  type: str
lease_start_at:
  description:
  - Date when server lease started.
  - May be absent.
  returned: on success
  type: str
location_code:
  description:
  - Code for location of the server.
  returned: on success
  type: str
location_id:
  description:
  - ID of the location of the server.
  returned: on success
  type: str
operational_status:
  description:
  - Maintanance operations for the server.
  - Value 'normal' is used for the server without any operations.
  - Value 'provisioning' is used for the server under provisioning.
  - Value 'installation' is used for reinstalled/installed server during OS installation
    process.
  - Value 'entering_rescue_mode' is used during reconfiguration of the server for
    the rescue mode.
  - Value 'exiting_rescue_mode' is used during reconfiguration of the server from
    rescue mode to normal.
  - Value 'rescue_mode' is used for server in rescue mode.
  returned: on success
  type: str
power_status:
  description:
  - Power state of the server.
  - Possible values are unknown, powering_on, powering_off, powered_off, powered_on
    (normal mode for working server), power_cycling (sequence of off on operations).
  returned: on success
  type: str
private_ipv4_address:
  description:
  - IPv4 address of the server on the private network.
  - May be absent.
  returned: on success
  type: str
public_ipv4_address:
  description:
  - IPv4 address of the server on the public (internet) network.
  - May be absent.
  returned: on success
  type: str
rack_id:
  description:
  - ID of rack where server is installed.
  - May be null if not supported.
  returned: on success
  type: str
ready:
  description:
  - Synthetic attribute, created by module.
  - Set to true if server is in status=active, power_status=powered_on, operational_status=normal.
  returned: on success
  type: bool
scheduled_release_at:
  description:
  - Date when server lease is planned for termination.
  - May be absent.
  returned: on success
  type: str
status:
  description:
  - Status of server.
  - Values "init" and "pending" are transient.
  - Value "active" is a normal status for a server.
  returned: on success
  type: str
title:
  description:
  - title of server (used as hostname).
  returned: on success
  type: str
type:
  description:
  - always 'dedicated_server'
  returned: on success
  type: str
updated_at:
  description:
  - Last date when the server object was updated.
  returned: on success
  type: str