W3cubDocs

/Ansible 2.11

ngine_io.cloudstack.cs_physical_network – Manages physical networks on Apache CloudStack based clouds.

Note

This plugin is part of the ngine_io.cloudstack collection (version 2.0.0).

To install it use: ansible-galaxy collection install ngine_io.cloudstack.

To use it in a playbook, specify: ngine_io.cloudstack.cs_physical_network.

New in version 0.1.0: of ngine_io.cloudstack

Synopsis

  • Create, update and remove networks.
  • Enabled and disabled Network Service Providers
  • Enables Internal LoadBalancer and VPC/VirtualRouter elements as required

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6
  • cs >= 0.9.0

Parameters

Parameter Choices/Defaults Comments
api_http_method
string
    Choices:
  • get
  • post
HTTP method used to query the API endpoint.
If not given, the CLOUDSTACK_METHOD env variable is considered.
api_key
string / required
API key of the CloudStack API.
If not given, the CLOUDSTACK_KEY env variable is considered.
api_secret
string / required
Secret key of the CloudStack API.
If not set, the CLOUDSTACK_SECRET env variable is considered.
api_timeout
integer
Default:
10
HTTP timeout in seconds.
If not given, the CLOUDSTACK_TIMEOUT env variable is considered.
api_url
string / required
URL of the CloudStack API e.g. https://cloud.example.com/client/api.
If not given, the CLOUDSTACK_ENDPOINT env variable is considered.
api_verify_ssl_cert
string
Verify CA authority cert file.
If not given, the CLOUDSTACK_VERIFY env variable is considered.
broadcast_domain_range
string
    Choices:
  • POD
  • ZONE
broadcast domain range for the physical network[Pod or Zone].
domain
string
Domain the network is owned by.
isolation_method
string
    Choices:
  • VLAN
  • GRE
  • L3
Isolation method for the physical network.
name
string / required
Name of the physical network.

aliases: physical_network
network_speed
string
    Choices:
  • 1G
  • 10G
The speed for the physical network.
nsps_disabled
list / elements=string
List of Network Service Providers to disable.
nsps_enabled
list / elements=string
List of Network Service Providers to enable.
poll_async
boolean
    Choices:
  • no
  • yes
Poll async jobs until job has finished.
state
string
    Choices:
  • present
  • absent
  • disabled
  • enabled
State of the physical network.
tags
string
A tag to identify this network.
Physical networks support only one tag.
To remove an existing tag pass an empty string.

aliases: tag
vlan
string
The VLAN/VNI Ranges of the physical network.
zone
string / required
Name of the zone in which the network belongs.

Notes

Note

  • A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
  • This module supports check mode.

Examples

- name: Ensure a network is present
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    isolation_method: VLAN
    broadcast_domain_range: ZONE

- name: Set a tag on a network
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    tag: overlay

- name: Remove tag on a network
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    tag: ""

- name: Ensure a network is enabled with specific nsps enabled
  ngine_io.cloudstack.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

- name: Ensure a network is disabled
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    state: disabled

- name: Ensure a network is enabled
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    state: enabled

- name: Ensure a network is absent
  ngine_io.cloudstack.cs_physical_network:
    name: net01
    zone: zone01
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
broadcast_domain_range
string
success
broadcastdomainrange of the network [POD / ZONE].

Sample:
ZONE
domain
string
success
Name of domain the network is in.

Sample:
domain1
id
string
success
UUID of the network.

Sample:
3f8f25cd-c498-443f-9058-438cfbcbff50
isolation_method
string
success
isolationmethod of the network [VLAN/GRE/L3].

Sample:
VLAN
name
string
success
Name of the network.

Sample:
net01
network_speed
string
success
networkspeed of the network [1G/10G].

Sample:
1G
nsps
complex
on enabling/disabling of Network Service Providers
list of enabled or disabled Network Service Providers

disabled
list / elements=string
on Network Service Provider disabling
list of Network Service Providers that were disabled

Sample:
['internallbvm']
enabled
list / elements=string
on Network Service Provider enabling
list of Network Service Providers that were enabled

Sample:
['virtualrouter']
state
string
success
State of the network [Enabled/Disabled].

Sample:
Enabled
zone
string
success
Name of zone the physical network is in.

Sample:
ch-gva-2


Authors

  • Netservers Ltd. (@netservers)
  • Patryk Cichy (@PatTheSilent)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/ngine_io/cloudstack/cs_physical_network_module.html