sitehost.cloud.server (1.2.0) — module

Manage SiteHost servers

Authors: SiteHost Developers (developers@sitehost.co.nz)

Install collection

Install with ansible-galaxy collection install sitehost.cloud:==1.2.0


Add to requirements.yml

  collections:
    - name: sitehost.cloud
      version: 1.2.0

Description

Used for provisioning, deleting, upgrading, starting and stopping servers on your SiteHost account.

Inputs

    
name:
    description:
    - Unique auto generated machine name for server.
    - Used to select a server that is already present.
    type: str

image:
    description:
    - The L(image,https://kb.sitehost.nz/developers/api/images) to use for the new server.
      eg. ubuntu-jammy-pvh.amd64
    type: str

label:
    description:
    - User chosen label of the new server, mutually exclusive to C(name).
    - Please ensure that verbose mode C(-v) is enabled to see the password of the newly
      created server.
    type: str

state:
    choices:
    - present
    - absent
    - started
    - stopped
    - restarted
    default: present
    description:
    - Indicates the desired state of the server.
    - C(present) will either upgrade or create a server; 'label' is required for provisioning
      a server, and use 'name' for upgrading a server.
    - C(absent) will delete the server.
    - C(started) for powering on the server.
    - C(stopped) for powering off the server.
    - C(restarted) for restarting the server.
    type: str

api_key:
    description:
    - Your SiteHost api key L(generated from CP,https://kb.sitehost.nz/developers/api#creating-an-api-key).
    required: true
    type: str

location:
    description:
    - The code for the L(location,https://kb.sitehost.nz/developers/api/locations) to
      provision the new server at. eg. AKLCITY
    type: str

product_code:
    description:
    - The code for the L(server specification,https://kb.sitehost.nz/developers/api/product-codes)
      to use when provisioning the new server. eg. XENLIT
    type: str

api_client_id:
    description:
    - The client id of your SiteHost account.
    required: true
    type: int

Outputs

msg:
  description: Text that indicates the status of the module.
  returned: always
  sample: webserver1 has been deleted
  type: str
server:
  contains:
    label:
      description: User chosen label for the server.
      returned: success
      sample: mywebserver
      type: str
    name:
      description: Unique system generated name for server.
      returned: success
      sample: mywebserv2
      type: str
    password:
      description: Password for the root user, only returned during server creation.
      returned: success
      sample: Up8Da5oE60ns
      type: str
    state:
      description: The state of the server after executing the command.
      return: success
      sample:
      - true
      - false
      - Reboot
      - Deleted
      type: str
  description: The sitehost server being actioned. Note that there is more information
    output on server creation and upgrade.
  returned: success
  type: dict