community.general.cs_cluster (0.1.1) — module

Manages host clusters on Apache CloudStack based clouds.

Authors: René Moser (@resmo)

stableinterface | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Create, update and remove clusters.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a cluster is present
  cs_cluster:
    name: kvm-cluster-01
    zone: ch-zrh-ix-01
    hypervisor: KVM
    cluster_type: CloudManaged
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a cluster is disabled
  cs_cluster:
    name: kvm-cluster-01
    zone: ch-zrh-ix-01
    state: disabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a cluster is enabled
  cs_cluster:
    name: kvm-cluster-01
    zone: ch-zrh-ix-01
    state: enabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a cluster is absent
  cs_cluster:
    name: kvm-cluster-01
    zone: ch-zrh-ix-01
    state: absent
  delegate_to: localhost

Inputs

    
pod:
    description:
    - Name of the pod in which the cluster belongs to.
    type: str

url:
    description:
    - URL for the cluster
    type: str

name:
    description:
    - name of the cluster.
    required: true
    type: str

zone:
    description:
    - Name of the zone in which the cluster belongs to.
    - If not set, default zone is used.
    type: str

state:
    choices:
    - present
    - absent
    - disabled
    - enabled
    default: present
    description:
    - State of the cluster.
    type: str

api_key:
    description:
    - API key of the CloudStack API.
    - If not given, the C(CLOUDSTACK_KEY) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

api_url:
    description:
    - URL of the CloudStack API e.g. https://cloud.example.com/client/api.
    - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

ovm3_vip:
    description:
    - Ovm3 vip to use for pool (and cluster).
    type: str

password:
    description:
    - Password for the cluster.
    type: str

username:
    description:
    - Username for the cluster.
    type: str

ovm3_pool:
    description:
    - Ovm3 native pooling enabled for cluster.
    type: str

api_region:
    default: cloudstack
    description:
    - Name of the ini section in the C(cloustack.ini) file.
    - If not given, the C(CLOUDSTACK_REGION) env variable is considered.
    type: str

api_secret:
    description:
    - Secret key of the CloudStack API.
    - If not set, the C(CLOUDSTACK_SECRET) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

hypervisor:
    description:
    - Name the hypervisor to be used.
    - Required if I(state=present).
    - Possible values are C(KVM), C(VMware), C(BareMetal), C(XenServer), C(LXC), C(HyperV),
      C(UCS), C(OVM), C(Simulator).
    type: str

api_timeout:
    description:
    - HTTP timeout in seconds.
    - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is 10 seconds if not specified.
    type: int

cluster_type:
    choices:
    - CloudManaged
    - ExternalManaged
    description:
    - Type of the cluster.
    - Required if I(state=present)
    type: str

ovm3_cluster:
    description:
    - Ovm3 native OCFS2 clustering enabled for cluster.
    type: str

vms_password:
    description:
    - Password for the VSM associated with this cluster.
    type: str

vms_username:
    description:
    - Username for the VSM associated with this cluster.
    type: str

vms_ip_address:
    description:
    - IP address of the VSM associated with this cluster.
    type: str

api_http_method:
    choices:
    - get
    - post
    description:
    - HTTP method used to query the API endpoint.
    - If not given, the C(CLOUDSTACK_METHOD) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is C(get) if not specified.
    type: str

guest_vswitch_name:
    description:
    - Name of virtual switch used for guest traffic in the cluster.
    - This would override zone wide traffic label setting.
    type: str

guest_vswitch_type:
    choices:
    - vmwaresvs
    - vmwaredvs
    description:
    - Type of virtual switch used for guest traffic in the cluster.
    - Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware
      distributed vSwitch)
    type: str

public_vswitch_name:
    description:
    - Name of virtual switch used for public traffic in the cluster.
    - This would override zone wide traffic label setting.
    type: str

public_vswitch_type:
    choices:
    - vmwaresvs
    - vmwaredvs
    description:
    - Type of virtual switch used for public traffic in the cluster.
    - Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware
      distributed vSwitch)
    type: str

Outputs

allocation_state:
  description: State of the cluster.
  returned: success
  sample: Enabled
  type: str
cluster_type:
  description: Type of the cluster.
  returned: success
  sample: ExternalManaged
  type: str
cpu_overcommit_ratio:
  description: The CPU overcommit ratio of the cluster.
  returned: success
  sample: 1.0
  type: str
hypervisor:
  description: Hypervisor of the cluster
  returned: success
  sample: VMware
  type: str
id:
  description: UUID of the cluster.
  returned: success
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
  type: str
managed_state:
  description: Whether this cluster is managed by CloudStack.
  returned: success
  sample: Managed
  type: str
memory_overcommit_ratio:
  description: The memory overcommit ratio of the cluster.
  returned: success
  sample: 1.0
  type: str
name:
  description: Name of the cluster.
  returned: success
  sample: cluster01
  type: str
ovm3_vip:
  description: Ovm3 VIP to use for pooling and/or clustering
  returned: success
  sample: 10.10.10.101
  type: str
pod:
  description: Name of pod the cluster is in.
  returned: success
  sample: pod01
  type: str
zone:
  description: Name of zone the cluster is in.
  returned: success
  sample: ch-gva-2
  type: str