community.hrobot.storagebox_snapshot module – Create, update, or delete a snapshot of a storage box

Note

This module is part of the community.hrobot collection (version 2.4.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.hrobot.

To use it in a playbook, specify: community.hrobot.storagebox_snapshot.

New in community.hrobot 2.3.0

Synopsis

  • Create, update comment, or delete a snapshot of a storage box.

Parameters

Parameter

Comments

hetzner_password

string / required

The password for the Robot web-service user.

hetzner_user

string / required

The username for the Robot web-service user.

rate_limit_retry_timeout

integer

added in community.hrobot 2.1.0

Timeout (in seconds) for waiting when rate limit exceeded errors are returned.

Set to 0 to not retry.

Set to a negative value like -1 to retry forever.

Default: -1

snapshot_comment

string

The comment to set for the snapshot.

snapshot_name

string

The name of the snapshot to comment or delete.

The snapshot name is automatically generated and should not be specified when creating a snapshot.

Required when setting state to absent, or when snapshot_comment is specified.

state

string

The state of the snapshot.

Choices:

  • "present" ← (default)

  • "absent"

storagebox_id

integer / required

The ID of the storage box to snapshot.

Attributes

Attribute

Support

Description

action_group

Action group: community.hrobot.robot

Use group/community.hrobot.robot in module_defaults to set defaults for this module.

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

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

idempotent

Support: partial

This module is not idempotent when creating a snapshot.

When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change.

This assumes that the system controlled/queried by the module has not changed in a relevant way.

Examples

---
- name: Create a snapshot
  community.hrobot.storagebox_snapshot:
    storagebox_id: 12345
    # The snapshot name is automatically generated and should not be specified.

- name: Delete a snapshot
  community.hrobot.storagebox_snapshot:
    storagebox_id: 12345
    snapshot_name: "2025-01-21T12-40-38"
    state: absent

- name: Update snapshot comment
  community.hrobot.storagebox_snapshot:
    storagebox_id: 12345
    snapshot_name: "2025-01-21T12-40-38"
    snapshot_comment: "This is an updated comment"

Return Values

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

Key

Description

snapshot

dictionary

The snapshot that was created.

Returned: success and state=present

name

string

The name of the snapshot.

Returned: success

Sample: "2025-01-21T12-40-38"

size

integer

The size of the snapshot in MB.

Returned: success

Sample: 400

timestamp

string

Timestamp of snapshot in UTC

Returned: success

Sample: "2025-01-21T12:40:38+00:00"

Authors

  • Matthias Hurdebise (@matthiashurdebise)