linuxfabrik.lfops.exoscale_private_network¶
Manage an Exoscale private network
Synopsis¶
- Creates or deletes an Exoscale private network in a zone, identified by name, using the Exoscale v2 API.
- With cidr, the network is a managed one, where Exoscale hands out addresses by DHCP. The range runs from the second address of the network to the third last, which leaves room for a gateway and the broadcast address.
- An existing network is never changed, since other instances may depend on its addressing.
- Attaching instances is done by
linuxfabrik.lfops.exoscale_instance. - Supports
--checkand--diff.
Available since LFOps 10.0.0.
Mandatory Parameters¶
api_key
- Exoscale API key.
- Type: String.
api_secret
- Exoscale API secret matching api_key.
- Type: String.
name
- Name of the private network. Must be unique in the zone.
- Type: String.
zone
- Exoscale zone, for example
ch-gva-2. - Type: String.
Optional Parameters¶
cidr
- IPv4 network in CIDR notation, for example
192.0.2.0/24. Only used when the network is created. Without it, the network is unmanaged, and the instances have to configure their addresses themselves. - Type: String.
operation_timeout
- Seconds to wait for an asynchronous Exoscale operation to finish.
- Type: Number.
- Default:
600
state
presentcreates the network if it is missing.absentdeletes the network. Exoscale refuses this while an instance is still attached to it.- Type: String. One of
absent,present. - Default:
present
Examples¶
- name: 'Create a managed private network'
linuxfabrik.lfops.exoscale_private_network:
api_key: '{{ exoscale_api_key }}'
api_secret: '{{ exoscale_api_secret }}'
zone: 'ch-gva-2'
name: 'net-prod01'
cidr: '192.0.2.0/24'
delegate_to: 'localhost'
Return Values¶
private_network
- The private network as returned by the Exoscale API. Empty when
state=absent, or when it would be created in check mode. - Type: Dictionary.
- Returned: always.
Authors¶
- Linuxfabrik GmbH, Zurich, Switzerland (info (at) linuxfabrik (dot) ch)