community.proxmox.proxmox_ipam_info module – Retrieve information about IPAMs.

Note

This module is part of the community.proxmox collection (version 1.4.0).

You might already have this collection installed if you are using the ansible package. 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.proxmox. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.proxmox.proxmox_ipam_info.

New in community.proxmox 1.4.0

Synopsis

  • Retrieve all IPs under IPAM and limit it by IP or IPAM.

Requirements

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

  • proxmoxer >= 2.0

  • requests

Parameters

Parameter

Comments

api_host

string / required

Specify the target host of the Proxmox VE cluster.

Uses the PROXMOX_HOST environment variable if not specified.

api_password

string

Specify the password to authenticate with.

Uses the PROXMOX_PASSWORD environment variable if not specified.

api_port

integer

Specify the target port of the Proxmox VE cluster.

Uses the PROXMOX_PORT environment variable if not specified.

api_token_id

string

Specify the token ID.

Uses the PROXMOX_TOKEN_ID environment variable if not specified.

api_token_secret

string

Specify the token secret.

Uses the PROXMOX_TOKEN_SECRET environment variable if not specified.

api_user

string / required

Specify the user to authenticate with.

Uses the PROXMOX_USER environment variable if not specified.

ipam

string

Limit results to a single IPAM.

validate_certs

boolean

If false, SSL certificates will not be validated.

This should only be used on personally controlled sites using self-signed certificates.

Uses the PROXMOX_VALIDATE_CERTS environment variable if not specified.

Choices:

  • false ← (default)

  • true

vmid

integer

Get IP of a VM under IPAM.

Attributes

Attribute

Support

Description

action_group

Action group: community.proxmox.proxmox

Use group/community.proxmox.proxmox in module_defaults to set defaults for this module.

check_mode

Support: full

This action does not modify state.

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

diff_mode

Support: N/A

This action does not modify state.

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

Examples

- name: Get all IPs under all IPAM
  community.proxmox.proxmox_ipam_info:
    api_user: "{{ pc.proxmox.api_user }}"
    api_token_id: "{{ pc.proxmox.api_token_id }}"
    api_token_secret: "{{ vault.proxmox.api_token_secret }}"
    api_host: "{{ pc.proxmox.api_host }}"
    validate_certs: false

- name: Get all IPs under pve IPAM
  community.proxmox.proxmox_ipam_info:
    api_user: "{{ pc.proxmox.api_user }}"
    api_token_id: "{{ pc.proxmox.api_token_id }}"
    api_token_secret: "{{ vault.proxmox.api_token_secret }}"
    api_host: "{{ pc.proxmox.api_host }}"
    validate_certs: false
    ipam: pve

- name: Get IP under IPAM of vmid 102
  community.proxmox.proxmox_ipam_info:
    api_user: "{{ pc.proxmox.api_user }}"
    api_token_id: "{{ pc.proxmox.api_token_id }}"
    api_token_secret: "{{ vault.proxmox.api_token_secret }}"
    api_host: "{{ pc.proxmox.api_host }}"
    validate_certs: false
    vmid: 102

Return Values

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

Key

Description

ipams

dictionary

List of all IPAMs and IPs under them.

Returned: on success

Sample: {"pve": [{"gateway": 1, "ip": "10.10.1.0", "subnet": "10.10.1.0/24", "vnet": "test2", "zone": "test1"}, {"hostname": "ns3.proxmox.pc.test3", "ip": "10.10.0.6", "mac": "BC:24:11:0E:72:04", "subnet": "10.10.0.0/24", "vmid": 102, "vnet": "test2", "zone": "test1"}, {"hostname": "ns4.proxmox.pc", "ip": "10.10.0.7", "mac": "BC:24:11:D5:CD:82", "subnet": "10.10.0.0/24", "vmid": 103, "vnet": "test2", "zone": "test1"}, {"gateway": 1, "ip": "10.10.0.1", "subnet": "10.10.0.0/24", "vnet": "test2", "zone": "test1"}, {"hostname": "ns2.proxmox.pc.test3", "ip": "10.10.0.5", "mac": "BC:24:11:86:77:56", "subnet": "10.10.0.0/24", "vmid": 101, "vnet": "test2", "zone": "test1"}]}

ips

list / elements=dictionary

Filter by vmid

Returned: on success

Sample: [{"hostname": "ns3.proxmox.pc", "ip": "10.10.5.5", "mac": "BC:24:11:0E:72:04", "subnet": "10.10.5.0/24", "vmid": 102, "vnet": "test", "zone": "ans1"}, {"hostname": "ns3.proxmox.pc", "ip": "10.10.0.8", "mac": "BC:24:11:F3:B1:81", "subnet": "10.10.0.0/24", "vmid": 102, "vnet": "test2", "zone": "test1"}]

Authors

  • Jana Hoch