ansible.builtin.cs_network (v2.3.2.0-1) — module

Manages networks on Apache CloudStack based clouds.

| "added in version" 2.0 of ansible.builtin"

Authors: René Moser (@resmo)

stableinterface | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.2.0.post1

Description

Create, update, restart and delete networks.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a network
- local_action:
    module: cs_network
    name: my network
    zone: gva-01
    network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
    network_domain: example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# update a network
- local_action:
    module: cs_network
    name: my network
    display_text: network of domain example.local
    network_domain: example.local
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# restart a network with clean up
- local_action:
    module: cs_network
    name: my network
    clean_up: yes
    state: restared
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# remove a network
- local_action:
    module: cs_network
    name: my network
    state: absent

Inputs

    
vpc:
    default: null
    description:
    - Name of the VPC of the network.
    required: false

name:
    description:
    - Name (case sensitive) of the network.
    required: true

vlan:
    default: null
    description:
    - The ID or VID of the network.
    required: false

zone:
    default: null
    description:
    - Name of the zone in which the network should be deployed.
    - If not set, default zone is used.
    required: false

state:
    choices:
    - present
    - absent
    - restarted
    default: present
    description:
    - State of the network.
    required: false

domain:
    default: null
    description:
    - Domain the network is related to.
    required: false

end_ip:
    default: null
    description:
    - The ending IPv4 address of the network belongs to.
    - If not specified, value of C(start_ip) is used.
    - Only considered on create.
    required: false

account:
    default: null
    description:
    - Account the network is related to.
    required: false

api_key:
    description:
    - API key of the CloudStack API.
    - If not given, the C(CLOUDSTACK_KEY) env variable is considered.
    required: true
    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.
    required: true
    type: str

gateway:
    default: null
    description:
    - The gateway of the network.
    - Required for shared networks and isolated networks when it belongs to a VPC.
    - Only considered on create.
    required: false

netmask:
    default: null
    description:
    - The netmask of the network.
    - Required for shared networks and isolated networks when it belongs to a VPC.
    - Only considered on create.
    required: false

project:
    default: null
    description:
    - Name of the project the network to be deployed in.
    required: false

acl_type:
    choices:
    - account
    - domain
    default: account
    description:
    - Access control type.
    - Only considered on create.
    required: false

clean_up:
    default: false
    description:
    - Cleanup old network elements.
    - Only considered on C(state=restarted).
    required: false

end_ipv6:
    default: null
    description:
    - The ending IPv6 address of the network belongs to.
    - If not specified, value of C(start_ipv6) is used.
    - Only considered on create.
    required: false

start_ip:
    default: null
    description:
    - The beginning IPv4 address of the network belongs to.
    - Only considered on create.
    required: false

cidr_ipv6:
    default: null
    description:
    - CIDR of IPv6 network, must be at least /64.
    - Only considered on create.
    required: false

api_secret:
    description:
    - Secret key of the CloudStack API.
    - If not set, the C(CLOUDSTACK_SECRET) env variable is considered.
    required: true
    type: str

poll_async:
    default: true
    description:
    - Poll async jobs until job has finished.
    required: false

start_ipv6:
    default: null
    description:
    - The beginning IPv6 address of the network belongs to.
    - Only considered on create.
    required: false

api_timeout:
    default: 10
    description:
    - HTTP timeout in seconds.
    - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered.
    type: int

display_text:
    default: null
    description:
    - Display text of the network.
    - If not specified, C(name) will be used as C(display_text).
    required: false

gateway_ipv6:
    default: null
    description:
    - The gateway of the IPv6 network.
    - Required for shared networks.
    - Only considered on create.
    required: false

isolated_pvlan:
    default: null
    description:
    - The isolated private VLAN for this network.
    required: false

network_domain:
    default: null
    description:
    - The network domain.
    required: false

api_http_method:
    choices:
    - get
    - post
    default: get
    description:
    - HTTP method used to query the API endpoint.
    - If not given, the C(CLOUDSTACK_METHOD) env variable is considered.
    type: str

network_offering:
    default: null
    description:
    - Name of the offering for the network.
    - Required if C(state=present).
    required: false

api_verify_ssl_cert:
    description:
    - Verify CA authority cert file.
    - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered.
    type: str

Outputs

account:
  description: Account the network is related to.
  returned: success
  sample: example account
  type: string
acl_type:
  description: Access type of the network (Domain, Account).
  returned: success
  sample: Account
  type: string
broadcast_domain_type:
  description: Broadcast domain type of the network.
  returned: success
  sample: Vlan
  type: string
cidr:
  description: IPv4 network CIDR.
  returned: success
  sample: 10.101.64.0/24
  type: string
cidr_ipv6:
  description: IPv6 network CIDR.
  returned: success
  sample: 2001:db8::/64
  type: string
display_text:
  description: Display text of the network.
  returned: success
  sample: web project
  type: string
dns1:
  description: IP address of the 1st nameserver.
  returned: success
  sample: 1.2.3.4
  type: string
dns2:
  description: IP address of the 2nd nameserver.
  returned: success
  sample: 1.2.3.4
  type: string
domain:
  description: Domain the network is related to.
  returned: success
  sample: ROOT
  type: string
gateway:
  description: IPv4 gateway.
  returned: success
  sample: 10.101.64.1
  type: string
gateway_ipv6:
  description: IPv6 gateway.
  returned: success
  sample: 2001:db8::1
  type: string
id:
  description: UUID of the network.
  returned: success
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
  type: string
is_persistent:
  description: Whether the network is persistent or not.
  returned: success
  sample: false
  type: boolean
name:
  description: Name of the network.
  returned: success
  sample: web project
  type: string
netmask:
  description: IPv4 netmask.
  returned: success
  sample: 255.255.255.0
  type: string
network_domain:
  description: The network domain
  returned: success
  sample: example.local
  type: string
network_offering:
  description: The network offering name.
  returned: success
  sample: DefaultIsolatedNetworkOfferingWithSourceNatService
  type: string
project:
  description: Name of project.
  returned: success
  sample: Production
  type: string
state:
  description: State of the network (Allocated, Implemented, Setup).
  returned: success
  sample: Allocated
  type: string
tags:
  description: List of resource tags associated with the network.
  returned: success
  sample: '[ { "key": "foo", "value": "bar" } ]'
  type: dict
traffic_type:
  description: Traffic type of the network.
  returned: success
  sample: Guest
  type: string
type:
  description: Type of the network.
  returned: success
  sample: Isolated
  type: string
zone:
  description: Name of zone.
  returned: success
  sample: ch-gva-2
  type: string