subnet
Manages subnets on the cloudscale.ch IaaS service
Collection: cloudscale_ch.cloud
Full Name: cloudscale_ch.cloud.subnet
Synopsis
Manages subnets on the cloudscale.ch IaaS service
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| api_url | str | Cloudscale API URL; defaults from CLOUDSCALE_API_URL or https://api.cloudscale.ch/v1. | ||
| api_token | str | API bearer token; defaults from CLOUDSCALE_API_TOKEN. | ||
| api_timeout | int | Request timeout seconds; defaults from CLOUDSCALE_API_TIMEOUT or 45. | ||
| cidr | str | The cidr of the subnet. Required if I(state=present). | ||
| dns_servers | list | A list of DNS resolver IP addresses, that act as DNS servers. If not set, the cloudscale.ch default resolvers are used. | ||
| gateway_address | str | 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 | dict | The name of the network the subnet is related to. Required if I(state=present). | ||
| reset | bool | false | Resets I(gateway_address) and I(dns_servers) to default values by the API. Note: Idempotency is not given. | |
| state | str | present | State of the subnet. | |
| tags | dict | Tags associated with the subnet. Set this to C({}) to clear any tags. | ||
| uuid | str | UUID of the subnet. |
Example
yaml
- 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