community.general.infinity (8.5.0) — module

Manage Infinity IPAM using Rest API

Authors: Meirong Liu (@MeganLiu)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage Infinity IPAM using REST API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- 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

Inputs

    
action:
    choices:
    - add_network
    - delete_network
    - get_network
    - get_network_id
    - release_ip
    - release_network
    - reserve_network
    - reserve_next_available_ip
    description:
    - Action to perform
    required: true
    type: str

password:
    description:
    - Infinity password.
    required: true
    type: str

username:
    description:
    - Username to access Infinity.
    - The user must have REST API privileges.
    required: true
    type: str

server_ip:
    description:
    - Infinity server_ip with IP address.
    required: true
    type: str

ip_address:
    description:
    - IP Address for a reservation or a release.
    type: str

network_id:
    description:
    - Network ID.
    type: str

network_name:
    description:
    - The name of a network.
    type: str

network_size:
    description:
    - Network bitmask (e.g. 255.255.255.220) or CIDR format (e.g., /26).
    type: str

network_type:
    choices:
    - lan
    - shared_lan
    - supernet
    default: lan
    description:
    - Network type defined by Infinity
    type: str

network_family:
    choices:
    - '4'
    - '6'
    - dual
    default: '4'
    description:
    - Network family defined by Infinity, e.g. IPv4, IPv6 and Dual stack
    type: str

network_address:
    description:
    - Network address with CIDR format (e.g., 192.168.310.0).
    type: str

network_location:
    default: -1
    description:
    - The parent network id for a given network.
    type: int

Outputs

ip_info:
  description: 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}'
  type: str
network_id:
  description: id for a given network
  returned: success
  sample: '1501'
  type: str
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
  sample:
    description: null
    network_address: 192.168.10.32/28
    network_family: '4'
    network_id: 3102
    network_location: '3085'
    network_name: '''reserve_new_ansible_network'''
    network_size: null
    network_type: lan
    ranges:
      first_ip: null
      id: 0
      last_ip: null
      name: null
      type: null
  type: str