cisco.intersight.intersight_pool_reservation module – Manage pool identifier reservations in Cisco Intersight

Note

This module is part of the cisco.intersight collection (version 2.20.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 cisco.intersight.

To use it in a playbook, specify: cisco.intersight.intersight_pool_reservation.

Synopsis

  • Reserve and release identifiers (IP, UUID, MAC, WWNN, WWPN) from Intersight pools.

  • Handles the Intersight reservation API’s one-time-use constraint by performing a pre-flight check before attempting to reserve, ensuring idempotent playbook runs.

  • Reserved identifiers are consumed when a policy using them is attached to a server profile or when the server profile is deployed.

  • Reservation of identifiers is only supported for Fabric Interconnect-attached servers.

  • For more information see Cisco Intersight.

Parameters

Parameter

Comments

allocation_type

string

Whether the reservation is static (specific value) or dynamic (next available from pool).

When static, identity is required.

When dynamic, the pool assigns the next available identifier.

Choices:

  • "static" ← (default)

  • "dynamic"

api_bearer_token

string

Bearer token for OAuth2 authentication with the Intersight API.

When provided, api_key_id and api_private_key are not required and the cryptography Python library is not needed.

If not set, the value of the INTERSIGHT_API_BEARER_TOKEN environment variable is used.

api_key_id

string

Public API Key ID associated with the private key.

If not set, the value of the INTERSIGHT_API_KEY_ID environment variable is used.

Required if api_bearer_token is not provided.

api_private_key

path

Filename (absolute path) or string of PEM formatted private key data to be used for Intersight API authentication.

If a string is used, Ansible vault should be used to encrypt string data.

Ex. ansible-vault encrypt_string --vault-id tme@/Users/dsoper/Documents/vault_password_file ‘-----BEGIN EC PRIVATE KEY-----

<your private key data>

-----END EC PRIVATE KEY-----’

If not set, the value of the INTERSIGHT_API_PRIVATE_KEY environment variable is used.

Required if api_bearer_token is not provided.

api_uri

string

URI used to access the Intersight API.

If not set, the value of the INTERSIGHT_API_URI environment variable is used.

Default: "https://intersight.com/api/v1"

identity

string

The specific identifier value to reserve (e.g., an IP address, UUID, MAC address).

Required when state is present.

organization

string

The name of the Organization the pool belongs to.

Default: "default"

pool_name

string / required

Name of the pool to reserve from.

pool_type

string / required

The type of pool to manage reservations for.

Choices:

  • "ip"

  • "uuid"

  • "mac"

  • "wwnn"

  • "wwpn"

state

string

If present, will reserve the identifier in the pool.

If absent, will release the reservation.

Choices:

  • "present" ← (default)

  • "absent"

use_proxy

boolean

If no, it will not use a proxy, even if one is defined in an environment variable on the target hosts.

Choices:

  • false

  • true ← (default)

validate_certs

boolean

Boolean control for verifying the api_uri TLS certificate

Choices:

  • false

  • true ← (default)

Examples

- name: Reserve a specific IP address from a pool
  cisco.intersight.intersight_pool_reservation:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    pool_type: ip
    pool_name: IP-Pool-01
    identity: "10.10.10.100"

- name: Reserve a specific UUID from a pool
  cisco.intersight.intersight_pool_reservation:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    pool_type: uuid
    pool_name: UUID-Pool-01
    identity: "550e8400-e29b-41d4-a716-446655440000"

- name: Reserve a MAC address
  cisco.intersight.intersight_pool_reservation:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    pool_type: mac
    pool_name: MAC-Pool-01
    identity: "00:25:B5:00:00:01"

- name: Release a reservation
  cisco.intersight.intersight_pool_reservation:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    pool_type: ip
    pool_name: IP-Pool-01
    identity: "10.10.10.100"
    state: absent

- name: Reserve next available IP (dynamic)
  cisco.intersight.intersight_pool_reservation:
    api_private_key: "{{ api_private_key }}"
    api_key_id: "{{ api_key_id }}"
    pool_type: ip
    pool_name: IP-Pool-01
    allocation_type: dynamic

Return Values

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

Key

Description

api_response

dictionary

The API response from the reservation operation.

Returned: always

Sample: {"api_response": {"AllocationType": "static", "Identity": "10.10.10.100", "Moid": "63a1b2c3d4e5f6a7b8c9d0e1"}}

Authors

  • Steve Fulmer (@stevefulme1)