�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z m Z d d l
m Z d
e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
module: infinity
short_description: Manage Infinity IPAM using Rest API
description:
- Manage Infinity IPAM using REST API.
version_added: "2.4"
author:
- Meirong Liu (@MeganLiu)
options:
server_ip:
description:
- Infinity server_ip with IP address.
type: str
required: true
username:
description:
- Username to access Infinity.
- The user must have REST API privileges.
type: str
required: true
password:
description:
- Infinity password.
type: str
required: true
action:
description:
- Action to perform
type: str
required: true
choices: [add_network, delete_network, get_network, get_network_id, release_ip, release_network, reserve_network, reserve_next_available_ip ]
network_id:
description:
- Network ID.
type: str
default: ''
ip_address:
description:
- IP Address for a reservation or a release.
type: str
default: ''
network_address:
description:
- Network address with CIDR format (e.g., 192.168.310.0).
type: str
default: ''
network_size:
description:
- Network bitmask (e.g. 255.255.255.220) or CIDR format (e.g., /26).
type: str
default: ''
network_name:
description:
- The name of a network.
type: str
default: ''
network_location:
description:
- The parent network id for a given network.
type: int
default: -1
network_type:
description:
- Network type defined by Infinity
type: str
choices: [ lan, shared_lan, supernet ]
default: lan
network_family:
description:
- Network family defined by Infinity, e.g. IPv4, IPv6 and Dual stack
type: str
choices: [ 4, 6, dual ]
default: 4
s�
---
- hosts: localhost
connection: local
strategy: debug
tasks:
- name: Reserve network into Infinity IPAM
infinity:
server_ip: 80.75.107.12
username: username
password: password
action: reserve_network
network_name: reserve_new_ansible_network
network_family: 4
network_type: lan
network_id: 1201
network_size: /28
register: infinity
s}
network_id:
description: id for a given network
returned: success
type: str
sample: '1501'
ip_info:
description: when reserve next available ip address from a network, the ip address info ) is returned.
returned: success
type: str
sample: '{"address": "192.168.10.3", "hostname": "", "FQDN": "", "domainname": "", "id": 3229}'
network_info:
description: when reserving a LAN network from a Infinity supernet by providing network_size, the information about the reserved network is returned.
returned: success
type: str
sample: {"network_address": "192.168.10.32/28","network_family": "4", "network_id": 3102,
"network_size": null,"description": null,"network_location": "3085",
"ranges": { "id": 0, "name": null,"first_ip": null,"type": null,"last_ip": null},
"network_type": "lan","network_name": "'reserve_new_ansible_network'"}
( t
AnsibleModulet json( t open_urlt Infinityc B` s� e Z d Z d � Z d d d d d d � Z d d � Z d d d � Z d d � Z d d d
� Z d d d � Z
d d d d d d d d
� Z d d d d � Z d d d d d d d � Z
RS( s<