- Docs »
- cloudscale_ch.cloud.subnet – Manages subnets on the cloudscale.ch IaaS service
-
You are reading an older version of the Ansible documentation. Use the version selection to the left if you want the latest stable released version.
cloudscale_ch.cloud.subnet – Manages subnets on the cloudscale.ch IaaS service
Note
This plugin is part of the cloudscale_ch.cloud collection (version 1.3.1).
To install it use: ansible-galaxy collection install cloudscale_ch.cloud
.
To use it in a playbook, specify: cloudscale_ch.cloud.subnet
.
New in version 1.3.0: of cloudscale_ch.cloud
Parameter |
Choices/Defaults |
Comments |
api_timeout
integer
|
Default:
30
|
Timeout in seconds for calls to the cloudscale.ch API.
|
api_token
string
/ required
|
|
cloudscale.ch API token.
This can also be passed in the CLOUDSCALE_API_TOKEN environment variable.
|
api_url
string
added in 1.3.0 of cloudscale_ch.cloud
|
Default:
"https://api.cloudscale.ch/v1"
|
cloudscale.ch API URL.
This can also be passed in the CLOUDSCALE_API_URL environment variable.
|
cidr
string
|
|
The cidr of the subnet.
Required if state=present.
|
dns_servers
list
/ elements=string
|
|
A list of DNS resolver IP addresses, that act as DNS servers.
If not set, the cloudscale.ch default resolvers are used.
|
gateway_address
string
|
|
The gateway address of the subnet. If not set, no gateway is used.
Cannot be within the DHCP range, which is the lowest .101-.254 in the subnet.
|
network
dictionary
|
|
The name of the network the subnet is related to.
Required if state=present.
|
|
name
string
|
|
The uuid of the network.
|
|
uuid
string
|
|
The uuid of the network.
|
|
zone
string
|
|
The zone the network allocated in.
|
reset
boolean
|
|
Resets gateway_address and dns_servers to default values by the API.
Note: Idempotency is not given.
|
state
string
|
Choices:
present ←
- absent
|
State of the subnet.
|
tags
dictionary
|
|
Tags associated with the subnet. Set this to {} to clear any tags.
|
uuid
string
|
|
UUID of the subnet.
|
---
- name: Ensure subnet exists
cloudscale_ch.cloud.subnet:
cidr: 172.16.0.0/24
network:
uuid: 2db69ba3-1864-4608-853a-0771b6885a3a
api_token: xxxxxx
- name: Ensure subnet exists
cloudscale_ch.cloud.subnet:
cidr: 192.168.1.0/24
gateway_address: 192.168.1.1
dns_servers:
- 192.168.1.10
- 192.168.1.11
network:
name: private
zone: lpg1
api_token: xxxxxx
- name: Ensure a subnet is absent
cloudscale_ch.cloud.subnet:
cidr: 172.16.0.0/24
network:
name: private
zone: lpg1
state: absent
api_token: xxxxxx
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
cidr
string
|
success |
The CIDR of the subnet.
Sample:
172.16.0.0/24
|
dns_servers
list
/ elements=string
|
success |
List of DNS resolver IP addresses.
Sample:
['9.9.9.9', '149.112.112.112']
|
gateway_address
string
|
success |
The gateway address of the subnet.
Sample:
192.168.42.1
|
href
string
|
success |
API URL to get details about the subnet.
Sample:
https://api.cloudscale.ch/v1/subnets/33333333-1864-4608-853a-0771b6885a3
|
network
complex
|
success |
The network object of the subnet.
|
|
href
string
|
success |
API URL to get details about the network.
Sample:
https://api.cloudscale.ch/v1/networks/33333333-1864-4608-853a-0771b6885a3
|
|
name
string
|
success |
The name of the network.
Sample:
my network
|
|
uuid
string
|
success |
The unique identifier for the network.
Sample:
33333333-1864-4608-853a-0771b6885a3
|
|
zone
dictionary
added in 1.4.0 of cloudscale_ch.cloud |
success |
The zone the network is allocated in.
Sample:
{'slug': 'rma1'}
|
state
string
|
success |
State of the subnet.
Sample:
present
|
tags
dictionary
|
success |
Tags associated with the subnet.
Sample:
{'project': 'my project'}
|
uuid
string
|
success |
The unique identifier for the subnet.
Sample:
33333333-1864-4608-853a-0771b6885a3
|