ngine_io.cloudstack.cs_vlan_ip_range – Manages VLAN IP ranges on Apache CloudStack based clouds.

From Get docs
Ansible/docs/2.11/collections/ngine io/cloudstack/cs vlan ip range module


ngine_io.cloudstack.cs_vlan_ip_range – Manages VLAN IP ranges on Apache CloudStack based clouds.

Note

This plugin is part of the ngine_io.cloudstack collection (version 2.0.0).

To install it use: ansible-galaxy collection install ngine_io.cloudstack.

To use it in a playbook, specify: ngine_io.cloudstack.cs_vlan_ip_range.


New in version 0.1.0: of ngine_io.cloudstack


Synopsis

  • Create and delete VLAN IP range.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6
  • cs >= 0.9.0

Parameters

Parameter Choices/Defaults Comments

account

string

Account who owns the VLAN.

Mutually exclusive with project.

api_http_method

string

  • get

  • post

HTTP method used to query the API endpoint.

If not given, the CLOUDSTACK_METHOD env variable is considered.

api_key

string / required

API key of the CloudStack API.

If not given, the CLOUDSTACK_KEY env variable is considered.

api_secret

string / required

Secret key of the CloudStack API.

If not set, the CLOUDSTACK_SECRET env variable is considered.

api_timeout

integer

Default:

10

HTTP timeout in seconds.

If not given, the CLOUDSTACK_TIMEOUT env variable is considered.

api_url

string / required

URL of the CloudStack API e.g. https://cloud.example.com/client/api.

If not given, the CLOUDSTACK_ENDPOINT env variable is considered.

api_verify_ssl_cert

string

Verify CA authority cert file.

If not given, the CLOUDSTACK_VERIFY env variable is considered.

cidr_ipv6

string

The CIDR of IPv6 network, must be at least /64.

domain

string

Domain of the account owning the VLAN.

end_ip

string

The ending IPv4 address in the VLAN IP range.

If not specified, value of start_ip is used.

Only considered on create.

end_ipv6

string

The ending IPv6 address in the IPv6 network range.

If not specified, value of start_ipv6 is used.

Only considered on create.

for_system_vms

boolean

  • no

  • yes

yes if IP range is set to system vms, no if not

for_virtual_network

boolean

added in 1.0.0 of ngine_io.cloudstack

  • no

  • yes

yes if VLAN is of Virtual type, no if Direct.

If set to yes but neither physical_network or network is set CloudStack will try to add the VLAN range to the Physical Network with a Public traffic type.

gateway

string

The gateway of the VLAN IP range.

Required if state=present.

gateway_ipv6

string

The gateway of the IPv6 network.

Only considered on create.

netmask

string

The netmask of the VLAN IP range.

Required if state=present.

network

string

The network name or id.

Required if for_virtual_network and physical_network are not set.

physical_network

string

The physical network name or id.

pod

string

added in 1.0.0 of ngine_io.cloudstack

Name of the pod.

project

string

Project who owns the VLAN.

Mutually exclusive with account.

start_ip

string / required

The beginning IPv4 address in the VLAN IP range.

Only considered on create.

start_ipv6

string

The beginning IPv6 address in the IPv6 network range.

Only considered on create.

state

string

  • present

  • absent

State of the network ip range.

vlan

string

The ID or VID of the network.

If not specified, will be defaulted to the vlan of the network.

zone

string / required

The Zone ID of the VLAN IP range.



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 VLAN IP range for network test
  ngine_io.cloudstack.cs_vlan_ip_range:
    network: test
    vlan: 98
    start_ip: 10.2.4.10
    end_ip: 10.2.4.100
    gateway: 10.2.4.1
    netmask: 255.255.255.0
    zone: zone-02

- name: remove a VLAN IP range for network test
  ngine_io.cloudstack.cs_vlan_ip_range:
    state: absent
    network: test
    start_ip: 10.2.4.10
    end_ip: 10.2.4.100
    zone: zone-02

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

account

string

if available

Account who owns the network.


Sample:

example account

cidr_ipv6

string

if available

The CIDR of IPv6 network.


Sample:

2001:db8::/64

domain

string

success

Domain name of the VLAN IP range.


Sample:

ROOT

end_ip

string

success

The end ip of the VLAN IP range.


Sample:

10.2.4.100

end_ipv6

string

if available

The end ipv6 of the VLAN IP range.


Sample:

2001:db8::50

for_systemvms

boolean

success

Whether VLAN IP range is dedicated to system vms or not.


for_virtual_network

boolean

success

Whether VLAN IP range is of Virtual type or not.


gateway

string

success

IPv4 gateway.


Sample:

10.2.4.1

gateway_ipv6

string

if available

IPv6 gateway.


Sample:

2001:db8::1

id

string

success

UUID of the VLAN IP range.


Sample:

04589590-ac63-4ffc-93f5-b698b8ac38b6

netmask

string

success

IPv4 netmask.


Sample:

255.255.255.0

network

string

if available

The network of vlan range


Sample:

test

physical_network

string

success

The physical network VLAN IP range belongs to.


Sample:

04589590-ac63-4ffc-93f5-b698b8ac38b6

project

string

if available

Project who owns the network.


Sample:

example project

start_ip

string

success

The start ip of the VLAN IP range.


Sample:

10.2.4.10

start_ipv6

string

if available

The start ipv6 of the VLAN IP range.


Sample:

2001:db8::10

vlan

string

success

The ID or VID of the VLAN.


Sample:

vlan://98

zone

string

success

Name of zone.


Sample:

zone-02




Authors

  • David Passante (@dpassante)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/ngine_io/cloudstack/cs_vlan_ip_range_module.html