ngine_io.cloudstack.cs_network – Manages networks on Apache CloudStack based clouds.
Note
This plugin is part of the ngine_io.cloudstack collection (version 2.2.2).
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
.
To use it in a playbook, specify: ngine_io.cloudstack.cs_network
.
New in version 0.1.0: of ngine_io.cloudstack
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: 10 |
|
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: []. |
|
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: “example account” |
|
Name of the access control list for the VPC network tier. Returned: success Sample: “My ACL” |
|
ID of the access control list for the VPC network tier. Returned: success Sample: “dfafcd55-0510-4b8c-b6c5-b8cedb4cfd88” |
|
Access type of the network (Domain, Account). Returned: success Sample: “Account” |
|
Broadcast domain type of the network. Returned: success Sample: “Vlan” |
|
IPv4 network CIDR. Returned: success Sample: “10.101.64.0/24” |
|
IPv6 network CIDR. Returned: if available Sample: “2001:db8::/64” |
|
Display text of the network. Returned: success Sample: “web project” |
|
IP address of the 1st nameserver. Returned: success Sample: “1.2.3.4” |
|
IP address of the 2nd nameserver. Returned: success Sample: “1.2.3.4” |
|
Domain the network is related to. Returned: success Sample: “ROOT” |
|
IPv4 gateway. Returned: success Sample: “10.101.64.1” |
|
IPv6 gateway. Returned: if available Sample: “2001:db8::1” |
|
UUID of the network. Returned: success Sample: “04589590-ac63-4ffc-93f5-b698b8ac38b6” |
|
Whether the network is persistent or not. Returned: success Sample: false |
|
Whether the network is system related or not. Returned: success Sample: false |
|
Name of the network. Returned: success Sample: “web project” |
|
IPv4 netmask. Returned: success Sample: “255.255.255.0” |
|
The network domain Returned: success Sample: “example.local” |
|
The network offering name. Returned: success Sample: “DefaultIsolatedNetworkOfferingWithSourceNatService” |
|
The availability of the network offering the network is created from Returned: success Sample: “Optional” |
|
Whether the network offering has IP conserve mode enabled or not. Returned: success Sample: false |
|
The network offering display text. Returned: success Sample: “Offering for Isolated Vpc networks with Source Nat service enabled” |
|
Name of project. Returned: success Sample: “Production” |
|
State of the network (Allocated, Implemented, Setup). Returned: success Sample: “Allocated” |
|
List of resource tags associated with the network. Returned: success Sample: “[ { \”key\”: \”foo\”, \”value\”: \”bar\” } ]” |
|
Traffic type of the network. Returned: success Sample: “Guest” |
|
Type of the network. Returned: success Sample: “Isolated” |
|
Name of the VPC. Returned: if available Sample: “My VPC” |
|
Name of zone. Returned: success Sample: “ch-gva-2” |
Authors
René Moser (@resmo)