community.general.cs_zone (0.1.1) — module

Manages zones 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 zones.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a zone is present
  cs_zone:
    name: ch-zrh-ix-01
    dns1: 8.8.8.8
    dns2: 8.8.4.4
    network_type: basic
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a zone is disabled
  cs_zone:
    name: ch-zrh-ix-01
    state: disabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a zone is enabled
  cs_zone:
    name: ch-zrh-ix-01
    state: enabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a zone is absent
  cs_zone:
    name: ch-zrh-ix-01
    state: absent
  delegate_to: localhost

Inputs

    
id:
    description:
    - uuid of the existing zone.
    type: str

dns1:
    description:
    - First DNS for the zone.
    - Required if I(state=present)
    type: str

dns2:
    description:
    - Second DNS for the zone.
    type: str

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

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

domain:
    description:
    - Domain the zone is related to.
    - Zone is a public zone if not set.
    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

dns1_ipv6:
    description:
    - First DNS for IPv6 for the zone.
    type: str

dns2_ipv6:
    description:
    - Second DNS for IPv6 for the zone.
    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

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

network_type:
    choices:
    - Basic
    - Advanced
    default: Basic
    description:
    - Network type of the zone.
    type: str

dhcp_provider:
    description:
    - DHCP provider for the Zone.
    type: str

internal_dns1:
    description:
    - First internal DNS for the zone.
    - If not set I(dns1) will be used on I(state=present).
    type: str

internal_dns2:
    description:
    - Second internal DNS for the zone.
    type: str

network_domain:
    description:
    - Network domain for the zone.
    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_cidr_address:
    description:
    - Guest CIDR address for the zone.
    type: str

local_storage_enabled:
    description:
    - Whether to enable local storage for the zone or not..
    type: bool

securitygroups_enabled:
    description:
    - Whether the zone is security group enabled or not.
    type: bool

Outputs

allocation_state:
  description: State of the zone.
  returned: success
  sample: Enabled
  type: str
dhcp_provider:
  description: DHCP provider for the zone
  returned: success
  sample: VirtualRouter
  type: str
dns1:
  description: First DNS for the zone.
  returned: success
  sample: 8.8.8.8
  type: str
dns1_ipv6:
  description: First IPv6 DNS for the zone.
  returned: success
  sample: 2001:4860:4860::8888
  type: str
dns2:
  description: Second DNS for the zone.
  returned: success
  sample: 8.8.4.4
  type: str
dns2_ipv6:
  description: Second IPv6 DNS for the zone.
  returned: success
  sample: 2001:4860:4860::8844
  type: str
domain:
  description: Domain the zone is related to.
  returned: success
  sample: ROOT
  type: str
guest_cidr_address:
  description: Guest CIDR address for the zone
  returned: success
  sample: 10.1.1.0/24
  type: str
id:
  description: UUID of the zone.
  returned: success
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
  type: str
internal_dns1:
  description: First internal DNS for the zone.
  returned: success
  sample: 8.8.8.8
  type: str
internal_dns2:
  description: Second internal DNS for the zone.
  returned: success
  sample: 8.8.4.4
  type: str
local_storage_enabled:
  description: Local storage offering enabled.
  returned: success
  sample: false
  type: bool
name:
  description: Name of the zone.
  returned: success
  sample: zone01
  type: str
network_domain:
  description: Network domain for the zone.
  returned: success
  sample: example.com
  type: str
network_type:
  description: Network type for the zone.
  returned: success
  sample: basic
  type: str
securitygroups_enabled:
  description: Security groups support is enabled.
  returned: success
  sample: false
  type: bool
tags:
  description: List of resource tags associated with the zone.
  returned: success
  sample:
  - key: foo
    value: bar
  type: dict
zone_token:
  description: Zone token
  returned: success
  sample: ccb0a60c-79c8-3230-ab8b-8bdbe8c45bb7
  type: str