ngine_io.cloudstack.cs_network module – Manages networks on Apache CloudStack based clouds.
Note
This module is part of the ngine_io.cloudstack collection (version 2.5.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ngine_io.cloudstack
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ngine_io.cloudstack.cs_network
.
New in ngine_io.cloudstack 0.1.0
Synopsis
Create, update, restart and delete networks.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
cs >= 0.9.0
Parameters
Parameter |
Comments |
---|---|
Account the network is related to. |
|
The name of the access control list for the VPC network tier. |
|
Access control type for the network. If not specified, Cloudstack will default to and Only considered on create. Choices:
|
|
HTTP method used to query the API endpoint. If not given, the Choices:
|
|
API key of the CloudStack API. If not given, the |
|
Secret key of the CloudStack API. If not set, the |
|
HTTP timeout in seconds. If not given, the Default: |
|
URL of the CloudStack API e.g. https://cloud.example.com/client/api. If not given, the |
|
Verify CA authority cert file. If not given, the |
|
CIDR of IPv6 network, must be at least /64. Only considered on create. |
|
Cleanup old network elements. Only considered on state=restarted. Choices:
|
|
Display text of the network. If not specified, name will be used as display_text. |
|
Domain the network is related to. |
|
The ending IPv4 address of the network belongs to. If not specified, value of start_ip is used. Only considered on create. |
|
The ending IPv6 address of the network belongs to. If not specified, value of start_ipv6 is used. Only considered on create. |
|
The gateway of the network. Required for shared networks and isolated networks when it belongs to a VPC. Only considered on create. |
|
The gateway of the IPv6 network. Required for shared networks. Only considered on create. |
|
The isolated private VLAN for this network. |
|
Name (case sensitive) of the network. |
|
The netmask of the network. Required for shared networks and isolated networks when it belongs to a VPC. Only considered on create. |
|
The network domain. |
|
Name of the offering for the network. Required if state=present. |
|
Poll async jobs until job has finished. Choices:
|
|
Name of the project the network to be deployed in. |
|
The beginning IPv4 address of the network belongs to. Only considered on create. |
|
The beginning IPv6 address of the network belongs to. Only considered on create. |
|
State of the network. Choices:
|
|
Defines whether to allow subdomains to use networks dedicated to their parent domain(s). Should be used with acl_type=domain. Only considered on create. Choices:
|
|
List of tags. Tags are a list of dictionaries having keys key and value. To delete all tags, set a empty list e.g. tags: []. |
|
If If not given, the This should only be used on personally controlled sites using self-signed certificates. Choices:
|
|
The ID or VID of the network. |
|
Name of the VPC of the network. |
|
Name of the zone in which the network should be deployed. |
Notes
Note
A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
This module supports check mode.
Examples
- name: Create a network
ngine_io.cloudstack.cs_network:
name: my network
zone: gva-01
network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
network_domain: example.com
- name: Create a network with start and end IP
ngine_io.cloudstack.cs_network:
name: Private Network
network_offering: PrivNet
start_ip: 10.12.9.10
end_ip: 10.12.9.100
netmask: 255.255.255.0
zone: gva-01
- name: Create a VPC tier
ngine_io.cloudstack.cs_network:
name: my VPC tier 1
zone: gva-01
vpc: my VPC
network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks
gateway: 10.43.0.1
netmask: 255.255.255.0
acl: my web acl
- name: Update a network
ngine_io.cloudstack.cs_network:
name: my network
zone: zone01
display_text: network of domain example.local
network_domain: example.local
- name: Restart a network with clean up
ngine_io.cloudstack.cs_network:
name: my network
zone: zone01
clean_up: yes
state: restarted
- name: Remove a network
ngine_io.cloudstack.cs_network:
name: my network
zone: zone01
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Account the network is related to. Returned: success Sample: |
|
Name of the access control list for the VPC network tier. Returned: success Sample: |
|
ID of the access control list for the VPC network tier. Returned: success Sample: |
|
Access type of the network (Domain, Account). Returned: success Sample: |
|
Broadcast domain type of the network. Returned: success Sample: |
|
IPv4 network CIDR. Returned: success Sample: |
|
IPv6 network CIDR. Returned: if available Sample: |
|
Display text of the network. Returned: success Sample: |
|
IP address of the 1st nameserver. Returned: success Sample: |
|
IP address of the 2nd nameserver. Returned: success Sample: |
|
Domain the network is related to. Returned: success Sample: |
|
IPv4 gateway. Returned: success Sample: |
|
IPv6 gateway. Returned: if available Sample: |
|
UUID of the network. Returned: success Sample: |
|
Whether the network is persistent or not. Returned: success Sample: |
|
Whether the network is system related or not. Returned: success Sample: |
|
Name of the network. Returned: success Sample: |
|
IPv4 netmask. Returned: success Sample: |
|
The network domain Returned: success Sample: |
|
The network offering name. Returned: success Sample: |
|
The availability of the network offering the network is created from Returned: success Sample: |
|
Whether the network offering has IP conserve mode enabled or not. Returned: success Sample: |
|
The network offering display text. Returned: success Sample: |
|
Name of project. Returned: success Sample: |
|
State of the network (Allocated, Implemented, Setup). Returned: success Sample: |
|
List of resource tags associated with the network. Returned: success Sample: |
|
Traffic type of the network. Returned: success Sample: |
|
Type of the network. Returned: success Sample: |
|
Name of the VPC. Returned: if available Sample: |
|
Name of zone. Returned: success Sample: |