serverscom.sc_api.sc_dedicated_server_reinstall (0.1.0) — module

Reinstall baremetal 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

Reinstall the existing baremetal server. Existing data may be lost in the process. No secure erase or wipe is performed during installation. Some data may be preserved. Reinstallation request may fail for servers with custom hardware configuration (external drive shelves).

Inputs

    
wait:
    default: 86400
    description:
    - Time to wait for server to change status to 'ready'
    - If wait is 0 or absent, task is succeeded sending reuest to API without waiting.
    - When server become 'ready' after reinstallation, it can still be in booting state
      for some time and do not answer ssh/ping request. Use M(serverscom.sc_api.wait_for_connection)
      module to wait the server to become available though ssh.
    - Installation may start few minutes later than request, during this time server is
      responding with 'old' ssh.
    type: int

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

hostname:
    description:
    - Hostname for the server.
    - Module will retrive old server title if not specified.
    - Translates to hostname in API.
    type: str

ssh_keys:
    description:
    - Array of fingerprints of public ssh keys to add for root user.
    - Keys must be registered before use by module M(serverscom.sc_api.sc_ssh_key).
    - Mutually exclusive with I(ssh_key_name).
    - Server is reinstalled with root password only if no I(ssh_keys) or I(ssh_key_name)
      specified.
    elements: str
    type: list

server_id:
    aliases:
    - name
    - id
    description:
    - ID of the server to reinstall.
    required: true
    type: str

user_data:
    description:
    - User data content that will be processed by the cloud-init while server's initialization.
    type: str

ssh_key_name:
    description:
    - Name of a single ssh key to add to root user.
    - Mutually exclusive with I(ssh_keys).
    - Server is reinstalled with root password only if no I(ssh_keys) or I(ssh_key_name)
      specified.
    - Name is used to search fingerprint through ssh keys API requests.
    - Key should be registered.
    - This option is implemented by the module.
    type: str

drives_layout:
    description:
    - Partitioning schema for drives during reinstallation.
    - Mutually exclusive with I(drives_layout_template).
    - Translates to drives["layout"] in API.
    - List of configuration for each raid or a stand-alone drive.
    - At least one layout should be provided.
    - Slot 0 must be used.
    - Partitioning should provide at least '/' (root) and /boot (for Linux) or 'C:' for
      Windows. Only paritioning for dirve 'C:' is supported for Windows.
    elements: dict
    suboptions:
      partitions:
        description:
        - Partition layout for raid or device.
        - Paritioning will be skipped if not specified ('ignore' in API).
        - Old data may be left if no partitioning was performed.
        suboptions:
          fs:
            description:
            - Filesystem to use
            - C(swap) is used for swap.
            type: str
          size:
            description:
            - Size of partition in Mb
            - Value of 0 is used to indicate 'fill mode' (use all available space except
              for other partitions).
            - Only one 'fill mode' partiiton may be present in the layout.
            type: int
          target:
            description:
            - Mountpoint for a partition.
            - C(swap) is used as mount point for swap.
            - At least C(/boot) and C(/) should be created for Linux.
            - C(C:\) should be created for Windows.
            required: true
            type: str
      raid:
        choices:
        - 0
        - 1
        - 5
        - 6
        - 10
        - 50
        - 60
        default: 0
        description:
        - Type of raid.
        - Every raid type (except C(0)) have own requirement for number of used drives
          in I(slot_positions).
        - If raid is None (not specified), raid0 is built.
        - If I(slots_positions) has only one device, it will be used as a device or as
          a raid0 with a single drive depending on hadrware raid capabilities. Systems
          with software raid will use drive 'as is'.
        type: int
      slot_positions:
        description:
        - List of drive slots to use.
        - Count starts from slot 0.
        - Every slot may be used only once in one configration element.
        - Slot count is limited by number of physiscally availble drives in server.
        elements: int
        required: true
        type: list
    type: list

update_interval:
    default: 60
    description:
    - Interval in seconds for requests for server status.
    - Each update request reduces number of available API requests in accordance with
      ratelimit.
    - Minimal value is 10.
    - Ignored if I(wait)=C(0).
    type: int

operating_system_id:
    description:
    - id of the operating system to install on the server.
    - Module will retrive and reuse old operating system if not specified.
    type: int

drives_layout_template:
    choices:
    - raid1-simple
    - raid0-simple
    description:
    - Mutually exclusive with I(drives_layout).
    - Provides a template to use instead of I(drives_layout).
    - C(raid1-simple) uses two first drives to create RAID1, partition /boot (1Gb), swap
      (4Gb) and / (all other space).
    - C(raid0-simple) uses first drive as raid0 (or no raid in case of servers without
      hardware raid), and places /boot, swap and / on this drive.
    - This option is implemented by this module (it generates layout for drives['layout']
      request to API based on built-in template).
    type: str