community.proxmox.proxmox_pool_member module – Add or delete members from Proxmox VE cluster pools
Note
This module is part of the community.proxmox collection (version 2.0.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_pool_member.
Synopsis
Add or remove members from a pool in Proxmox VE clusters.
Each member is a dict with either a
vmkey (vmid or VM name) or astoragekey.When
exclusive=true, the pool membership is reconciled to match exactlymembers, ignoringstate.
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer >= 2.3
requests
Parameters
Parameter |
Comments |
|---|---|
Specify the target host of the Proxmox VE cluster. Uses the |
|
Specify the OTP. Uses the |
|
Specify the password to authenticate with. Uses the |
|
Specify the target port of the Proxmox VE cluster. Uses the |
|
Time limit for requests towards the Proxmox VE API. Default: |
|
Specify the token ID. Uses the |
|
Specify the token secret. Uses the |
|
Specify the user to authenticate with. Uses the |
|
Path to a local certificate, which will be used to verify TLS connections. Ignored if |
|
When Members present in the pool but absent from Members in
This option is not loop aware, so if you use `with_’ , it will be exclusive per iteration of the loop. If you want multiple members in the pool you need to pass them all to `members’ in a single batch. Choices:
|
|
List of members to add or remove from the pool. Each item is a dict with either a |
|
Storage name. |
|
VM id or VM name. |
|
The pool ID. |
|
Desired state for each member listed in Ignored when Choices:
|
|
Validate the TLS certificates used for the connection to the Proxmox VE API. May be set through the environment variable Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Action group: community.proxmox.proxmox |
Use |
|
Support: full |
Can run in |
|
Support: full |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- Authentication
Complete guide for the Proxmox API authentication
Examples
- name: Add VMs and a storage to a pool
community.proxmox.proxmox_pool_member:
api_host: node1
api_user: root@pam
api_password: password
poolid: test
members:
- vm: 101
- vm: pxe.home.arpa
- storage: zfs-data
- name: Remove a VM and a storage from a pool
community.proxmox.proxmox_pool_member:
api_host: node1
api_user: root@pam
api_password: password
poolid: test
state: absent
members:
- vm: 101
- storage: zfs-data
- name: Enforce exact pool membership (exclusive mode)
community.proxmox.proxmox_pool_member:
api_host: node1
api_user: root@pam
api_password: password
poolid: test
exclusive: true
members:
- vm: 101
- storage: zfs-data
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Final list of members in the pool after the operation. Returned: success Sample: |
|
A short message on what the module did. Returned: always Sample: |
|
The pool ID. Returned: success Sample: |