community.proxmox.proxmox_ceph_pool module – Manage Ceph Pool.

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_ceph_pool.

New in community.proxmox 2.0.0

Synopsis

  • Add, edit or delete pool of a ceph cluster.

Requirements

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

  • proxmoxer >= 2.3

  • requests

Parameters

Parameter

Comments

add_storages

boolean

Add the new pool to the cluster storage configuration.

Choices:

  • false

  • true

api_host

string / required

Specify the target host of the Proxmox VE cluster.

Uses the PROXMOX_HOST environment variable if not specified.

api_otp

string

Specify the OTP.

Uses the PROXMOX_OTP 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_timeout

integer

Time limit for requests towards the Proxmox VE API.

Default: 5

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.

ca_path

path

Path to a local certificate, which will be used to verify TLS connections.

Ignored if validate_certs=false.

crush_rule

string

The rule to use for mapping object placement in the cluster.

min_size

integer

Minimum number of replicas per object.

name

string / required

The name of the pool. It must be unique.

node

string / required

The cluster node name.

pg_autoscale_mode

string

The automatic placement groups scaling mode of the pool.

Choices:

  • "on"

  • "off"

  • "warn"

pg_num

integer

Number of placement groups.

pg_num_min

integer

Minimal number of placement groups.

size

integer

Number of replicas per object.

state

string / required

Indicate whether the Ceph pool should be present (created if missing) or absent (deleted if it exists).

Choices:

  • "present"

  • "absent"

target_size

string

The estimated target size of the pool for the placement groups autoscaler.

target_size_ratio

integer

The estimated target ratio of the pool for the placement groups autoscaler.

timeout

integer

Timeout for operations.

Default: 5

validate_certs

boolean

Validate the TLS certificates used for the connection to the Proxmox VE API.

May be set through the environment variable PROXMOX_VALIDATE_CERTS.

Choices:

  • false

  • true ← (default)

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: none

This action does not modify state.

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

See Also

See also

Authentication

Complete guide for the Proxmox API authentication

Examples

- name: Add a ceph pool
  community.proxmox.proxmox_ceph_pool:
    api_host: proxmox
    api_user: root@pam
    api_password: secret
    node: proxmox
    name: ceph-pool
    state: present

- name: Add a ceph pool and storage
  community.proxmox.proxmox_ceph_pool:
    api_host: proxmox
    api_user: root@pam
    api_password: secret
    node: proxmox
    name: ceph-pool
    state: present
    add_storages: true

- name: Delete a ceph pool
  community.proxmox.proxmox_ceph_pool:
    api_host: proxmox
    api_user: root@pam
    api_password: secret
    node: proxmox
    name: ceph-pool
    state: absent

Return Values

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

Key

Description

msg

string

The output message that the module generates.

Returned: always

Authors

  • Vial Nicolas (@teslamania)