community.general.infinity module – Manage Infinity IPAM using Rest API

Note

This module is part of the community.general collection (version 6.6.9).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.infinity.

Synopsis

  • Manage Infinity IPAM using REST API.

Parameters

Parameter

Comments

action

string / required

Action to perform

Choices:

  • "add_network"

  • "delete_network"

  • "get_network"

  • "get_network_id"

  • "release_ip"

  • "release_network"

  • "reserve_network"

  • "reserve_next_available_ip"

ip_address

string

IP Address for a reservation or a release.

network_address

string

Network address with CIDR format (e.g., 192.168.310.0).

network_family

string

Network family defined by Infinity, e.g. IPv4, IPv6 and Dual stack

Choices:

  • "4" ← (default)

  • "6"

  • "dual"

network_id

string

Network ID.

network_location

integer

The parent network id for a given network.

Default: -1

network_name

string

The name of a network.

network_size

string

Network bitmask (e.g. 255.255.255.220) or CIDR format (e.g., /26).

network_type

string

Network type defined by Infinity

Choices:

  • "lan" ← (default)

  • "shared_lan"

  • "supernet"

password

string / required

Infinity password.

server_ip

string / required

Infinity server_ip with IP address.

username

string / required

Username to access Infinity.

The user must have REST API privileges.

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

---
- hosts: localhost
  connection: local
  strategy: debug
  tasks:
    - name: Reserve network into Infinity IPAM
      community.general.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

Return Values

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

Key

Description

ip_info

string

when reserve next available ip address from a network, the ip address info ) is returned.

Returned: success

Sample: "{\"address\": \"192.168.10.3\", \"hostname\": \"\", \"FQDN\": \"\", \"domainname\": \"\", \"id\": 3229}"

network_id

string

id for a given network

Returned: success

Sample: "1501"

network_info

string

when reserving a LAN network from a Infinity supernet by providing network_size, the information about the reserved network is returned.

Returned: success

Sample: "{'description': None, 'network_address': '192.168.10.32/28', 'network_family': '4', 'network_id': 3102, 'network_location': '3085', 'network_name': \"'reserve_new_ansible_network'\", 'network_size': None, 'network_type': 'lan', 'ranges': {'first_ip': None, 'id': 0, 'last_ip': None, 'name': None, 'type': None}}"

Authors

  • Meirong Liu (@MeganLiu)