community.general.cs_affinitygroup (0.1.1) — module

Manages affinity groups 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 and remove affinity groups.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a affinity group
  cs_affinitygroup:
    name: haproxy
    affinity_type: host anti-affinity
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a affinity group
  cs_affinitygroup:
    name: haproxy
    state: absent
  delegate_to: localhost

Inputs

    
name:
    description:
    - Name of the affinity group.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the affinity group.
    type: str

domain:
    description:
    - Domain the affinity group is related to.
    type: str

account:
    description:
    - Account the affinity group is related to.
    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

project:
    description:
    - Name of the project the affinity group is related to.
    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

poll_async:
    default: true
    description:
    - Poll async jobs until job has finished.
    type: bool

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

description:
    description:
    - Description of the affinity group.
    type: str

affinity_type:
    description:
    - Type of the affinity group. If not specified, first found affinity type is used.
    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

Outputs

account:
  description: Account the affinity group is related to.
  returned: success
  sample: example account
  type: str
affinity_type:
  description: Type of affinity group.
  returned: success
  sample: host anti-affinity
  type: str
description:
  description: Description of affinity group.
  returned: success
  sample: application affinity group
  type: str
domain:
  description: Domain the affinity group is related to.
  returned: success
  sample: example domain
  type: str
id:
  description: UUID of the affinity group.
  returned: success
  sample: 87b1e0ce-4e01-11e4-bb66-0050569e64b8
  type: str
name:
  description: Name of affinity group.
  returned: success
  sample: app
  type: str
project:
  description: Name of project the affinity group is related to.
  returned: success
  sample: Production
  type: str