PARALLAX

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

NameTypeRequiredDefaultDescription
api_urlstrCloudscale API URL; defaults from CLOUDSCALE_API_URL or https://api.cloudscale.ch/v1.
api_tokenstrAPI bearer token; defaults from CLOUDSCALE_API_TOKEN.
api_timeoutintRequest timeout seconds; defaults from CLOUDSCALE_API_TIMEOUT or 45.
cidrstrThe cidr of the subnet. Required if I(state=present).
dns_serverslistA list of DNS resolver IP addresses, that act as DNS servers. If not set, the cloudscale.ch default resolvers are used.
gateway_addressstrThe 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.
networkdictThe name of the network the subnet is related to. Required if I(state=present).
resetboolfalseResets I(gateway_address) and I(dns_servers) to default values by the API. Note: Idempotency is not given.
statestrpresentState of the subnet.
tagsdictTags associated with the subnet. Set this to C({}) to clear any tags.
uuidstrUUID 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
Search
    ↑ ↓ move↵ openesc close