community.general.cs_physical_network (0.1.1) — module

Manages physical networks on Apache CloudStack based clouds.

Authors: Netservers Ltd. (@netservers), Patryk Cichy (@PatTheSilent)

preview | 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 networks.

Enabled and disabled Network Service Providers

Enables Internal LoadBalancer and VPC/VirtualRouter elements as required


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a network is present
  cs_physical_network:
    name: net01
    zone: zone01
    isolation_method: VLAN
    broadcast_domain_range: ZONE
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set a tag on a network
  cs_physical_network:
    name: net01
    tag: overlay
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove tag on a network
  cs_physical_network:
    name: net01
    tag: ""
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a network is enabled with specific nsps enabled
  cs_physical_network:
    name: net01
    zone: zone01
    isolation_method: VLAN
    vlan: 100-200,300-400
    broadcast_domain_range: ZONE
    state: enabled
    nsps_enabled:
      - virtualrouter
      - internallbvm
      - vpcvirtualrouter
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a network is disabled
  cs_physical_network:
    name: net01
    zone: zone01
    state: disabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a network is enabled
  cs_physical_network:
    name: net01
    zone: zone01
    state: enabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a network is absent
  cs_physical_network:
    name: net01
    zone: zone01
    state: absent
  delegate_to: localhost

Inputs

    
name:
    aliases:
    - physical_network
    description:
    - Name of the physical network.
    required: true
    type: str

tags:
    aliases:
    - tag
    description:
    - A tag to identify this network.
    - Physical networks support only one tag.
    - To remove an existing tag pass an empty string.
    type: str

vlan:
    description:
    - The VLAN/VNI Ranges of the physical network.
    type: str

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

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

domain:
    description:
    - Domain the network is owned by.
    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

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

nsps_enabled:
    description:
    - List of Network Service Providers to enable.
    type: list

network_speed:
    choices:
    - 1G
    - 10G
    description:
    - The speed for the physical network.
    type: str

nsps_disabled:
    description:
    - List of Network Service Providers to disable.
    type: list

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

isolation_method:
    choices:
    - VLAN
    - GRE
    - L3
    description:
    - Isolation method for the physical network.
    type: str

broadcast_domain_range:
    choices:
    - POD
    - ZONE
    description:
    - broadcast domain range for the physical network[Pod or Zone].
    type: str

Outputs

broadcast_domain_range:
  description: broadcastdomainrange of the network [POD / ZONE].
  returned: success
  sample: ZONE
  type: str
domain:
  description: Name of domain the network is in.
  returned: success
  sample: domain1
  type: str
id:
  description: UUID of the network.
  returned: success
  sample: 3f8f25cd-c498-443f-9058-438cfbcbff50
  type: str
isolation_method:
  description: isolationmethod of the network [VLAN/GRE/L3].
  returned: success
  sample: VLAN
  type: str
name:
  description: Name of the network.
  returned: success
  sample: net01
  type: str
network_speed:
  description: networkspeed of the network [1G/10G].
  returned: success
  sample: 1G
  type: str
nsps:
  contains:
    disabled:
      description: list of Network Service Providers that were disabled
      returned: on Network Service Provider disabling
      sample:
      - internallbvm
      type: list
    enabled:
      description: list of Network Service Providers that were enabled
      returned: on Network Service Provider enabling
      sample:
      - virtualrouter
      type: list
  description: list of enabled or disabled Network Service Providers
  returned: on enabling/disabling of Network Service Providers
  type: complex
state:
  description: State of the network [Enabled/Disabled].
  returned: success
  sample: Enabled
  type: str
zone:
  description: Name of zone the physical network is in.
  returned: success
  sample: ch-gva-2
  type: str