community.proxmox.proxmox_storage module – Manage storage in PVE clusters and nodes
Note
This module is part of the community.proxmox collection (version 1.3.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_storage
.
New in community.proxmox 1.3.0
Synopsis
Manage storage in PVE clusters and nodes.
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer >= 2.0
requests
Parameters
Parameter |
Comments |
---|---|
Specify the target host of the Proxmox VE cluster. Uses the |
|
Specify the password to authenticate with. Uses the |
|
Specify the target port of the Proxmox VE cluster. Uses the |
|
Specify the token ID. Uses the |
|
Specify the token secret. Uses the |
|
Specify the user to authenticate with. Uses the |
|
Extended information for adding CephFS storage. |
|
The client keyring to be used. |
|
The Ceph filesystem name |
|
The hostname or IP address of the monhost. |
|
The required password for the storage system. |
|
The path to be used within the CephFS. Default: |
|
The subdir to be used within the CephFS. |
|
The required username for the storage system. |
|
Extended information for adding CIFS storage. |
|
The required domain for the CIFS share. |
|
The required password for the storage system. |
|
The hostname or IP address of the remote storage system. |
|
The share to be used from the remote storage system. |
|
The minimum SMB version to use for. |
|
The required username for the storage system. |
|
The desired content that should be used with this storage type. Required when Choices:
|
|
Extended information for adding iSCSI storage. |
|
The hostname or IP address of the remote storage system as the portal address. |
|
The required iSCSI target. |
|
The name of the storage displayed in the storage list. |
|
Extended information for adding NFS storage. |
|
The required NFS export path. |
|
Additional NFS related mount options (e.g., version, pNFS). |
|
The hostname or IP address of the remote storage system. |
|
A list of Proxmox VE nodes on which the target storage is enabled. Required when |
|
Extended information for adding Proxmox Backup Server as storage. |
|
The required datastore to use from the Proxmox Backup Server. |
|
The required fingerprint of the Proxmox Backup Server system. |
|
The required password for the Proxmox Backup Server. |
|
The hostname or IP address of the Proxmox Backup Server. |
|
The required username for the Proxmox Backup Server. |
|
The state of the defined storage type to perform. Choices:
|
|
The storage type/protocol to use when adding the storage. Choices:
|
|
If This should only be used on personally controlled sites using self-signed certificates. Uses the Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Action group: community.proxmox.proxmox |
Use |
|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Add PBS storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
api_host: proxmoxhost
api_user: root@pam
api_password: password123
validate_certs: false
nodes: ["de-cgn01-virt01", "de-cgn01-virt02"]
state: present
name: backup-backupserver01
type: pbs
pbs_options:
server: proxmox-backup-server.example.com
username: backup@pbs
password: password123
datastore: backup
fingerprint: "F3:04:D2:C1:33:B7:35:B9:88:D8:7A:24:85:21:DC:75:EE:7C:A5:2A:55:2D:99:38:6B:48:5E:CA:0D:E3:FE:66"
export: "/mnt/storage01/b01pbs01"
content: ["backup"]
- name: Add NFS storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
api_host: proxmoxhost
api_user: root@pam
api_password: password123
validate_certs: false
nodes: ["de-cgn01-virt01", "de-cgn01-virt02"]
state: present
name: net-nfsshare01
type: nfs
nfs_options:
server: 10.10.10.94
export: "/mnt/storage01/s01nfs01"
content: ["rootdir", "images"]
- name: Add iSCSI storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
api_host: proxmoxhost
api_user: root@pam
api_password: password123
validate_certs: false
nodes: ["de-cgn01-virt01", "de-cgn01-virt02", "de-cgn01-virt03"]
state: present
type: iscsi
name: net-iscsi01
iscsi_options:
portal: 10.10.10.94
target: "iqn.2005-10.org.freenas.ctl:s01-isci01"
content: ["rootdir", "images"]
- name: Remove storage from Proxmox VE Cluster
community.proxmox.proxmox_storage:
api_host: proxmoxhost
api_user: root@pam
api_password: password123
validate_certs: false
state: absent
name: net-nfsshare01
type: nfs
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Status message about the storage action. Returned: success Sample: |