community.proxmox.proxmox_ceph_osd module – Manage osd.

Note

This module is part of the community.proxmox collection (version 1.6.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_osd.

New in community.proxmox 1.5.0

Synopsis

  • This module allows you to add or delete an osd.

  • You can also in, out or scrub an osd.

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

cleanup

boolean

If set remove partition table entries.

Used with state=absent.

Choices:

  • false ← (default)

  • true

crush_device_class

string

Set the device class of the OSD in crush.

Used with state=present.

db_dev

string

Block device name for block.db.

Used with state=present.

db_dev_size

integer

If a block.db is requested but the size is not given, will be automatically selected by

bluestore_block_db_size from the ceph database (osd or global section) or config (osd or global section) in that order.

If this is not available, it will be sized 10% of the size of the OSD device.

Fails if the available size is not enough.

Used with state=present.

deep

boolean

If set, instructs a deep scrub instead of a normal one.

Used with state=scrub.

Choices:

  • false ← (default)

  • true

dev

string

Block device name.

Required when state=present.

encrypted

boolean

Enables encryption of the OSD.

Used with state=present.

Choices:

  • false ← (default)

  • true

node

string / required

The cluster node name.

osdid

integer

Osd id.

Required when state=absent, state=in, state=out, state=scrub, state=start, state=stop or O-state=restart).

osds_per_device

integer

OSD services per physical device.

Used with state=present.

state

string / required

create, delete, in, out or scrub

Choices:

  • "present"

  • "absent"

  • "in"

  • "out"

  • "scrub"

  • "start"

  • "stop"

  • "restart"

validate_certs

boolean

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

Currently defaults to false and changes default to true with community.proxmox 2.0.0.

Uses the PROXMOX_VALIDATE_CERTS environment variable if not specified.

Choices:

  • false

  • true

wal_dev

string

Block device name for block.wal.

Used with state=present.

wal_dev_size

integer

If a block.wal is requested but the size is not given, will be automatically selected by

bluestore_block_wal_size from the ceph database (osd or global section) or config (osd or global section) in that order.

If this is not available, it will be sized 1% of the size of the OSD device.

Fails if the available size is not enough.

Used with state=present.

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.

Examples

- name: Add an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    dev: /dev/sdb
    state: present

- name: Delete an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    cleanup: true
    state: absent

- name: Scrub an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    deep: true
    state: scrub

- name: Out an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    state: out

- name: In an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    state: in

- name: Start an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    state: start

- name: Stop an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    state: stop

- name: Restart an osd
  community.proxmox.proxmox_ceph_osd:
    api_host: proxmox-01.example.com
    api_user: root@pam
    api_password: secret
    node: proxmox-01
    osdid: 2
    state: restart

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)