community.hrobot.storagebox_info module – Query information on one or more storage boxes

Note

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

New in community.hrobot 2.1.0

Synopsis

  • Query information on one or more storage box.

Parameters

Parameter

Comments

full_info

boolean

Whether to provide full information for every storage box.

Setting this to true requires one REST call per storage box, which is slow and reduces your rate limit. Use with care.

When storagebox_id is specified, this option is always treated as having value true.

Choices:

  • false ← (default)

  • true

hetzner_password

string / required

The password for the Robot web-service user.

hetzner_user

string / required

The username for the Robot web-service user.

linked_server_number

integer

Limit result list to storage boxes linked to the server with this number.

Ignored when storagebox_id has been specified.

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

storagebox_id

integer

Limit result list to storage boxes with this ID.

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

This action does not modify state.

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

diff_mode

Support: N/A

This action does not modify state.

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

idempotent

Support: full

This action does not modify state.

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: Query a list of all storage boxes
  community.hrobot.storagebox_info:
    hetzner_user: foo
    hetzner_password: bar
  register: result

- name: Query a specific storage box
  community.hrobot.storagebox_info:
    hetzner_user: foo
    hetzner_password: bar
    storagebox_id: 23
  register: result

- name: Output data on specific storage box
  ansible.builtin.debug:
    msg: "Storage box name: {{ result.storageboxes[0].name }}"

Return Values

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

Key

Description

storageboxes

list / elements=dictionary

List of storage boxes matching the provided options.

Returned: success

cancelled

boolean

Whether the storage box has been cancelled.

The cancellation can still be un-done until storageboxes[].paid_until has been exceeded.

Returned: success

Sample: false

disk_quota

integer

Total amount of MB available.

Returned: when full_info=true

Sample: 10240000

disk_usage

integer

The amount of MB in use.

Returned: when full_info=true

Sample: 900

disk_usage_data

integer

The amount of MB used by files.

Returned: when full_info=true

Sample: 500

disk_usage_snapshots

integer

The amount of MB used by snapshots.

Returned: when full_info=true

Sample: 400

external_reachability

boolean

Whether the storage box is reachable externally.

Returned: when full_info=true

Sample: true

host_system

string

Identifier of the storage box’s host.

Returned: when full_info=true

Sample: "FSN1-BX355"

id

integer

The storage box’s ID.

Returned: success

Sample: 123456

linked_server

integer

The ID (server number) of the connected server, if available. Is null otherwise.

Returned: success

Sample: 123456

location

string

The storage box’s location.

Returned: success

Sample: "FSN1"

locked

boolean

Whether the IP is locked.

Returned: success

Sample: false

login

string

The storage box’s login name.

Returned: success

Sample: "u12345"

name

string

The storage box’s name.

Returned: success

Sample: "Backup Server 1"

paid_until

string

The date until which the storage box has been paid for.

Returned: success

Sample: "2015-10-23"

product

string

The product name.

Returned: success

Sample: "BX60"

samba

boolean

Whether SAMBA is active.

Returned: when full_info=true

Sample: true

server

string

The storage box’s hostname.

Returned: when full_info=true

Sample: "u12345.your-storagebox.de"

ssh

boolean

Whether SSH is active.

Returned: when full_info=true

Sample: true

webdav

boolean

Whether WebDAV is active.

Returned: when full_info=true

Sample: true

zfs

boolean

Shows whether the ZFS directory is visible.

Returned: when full_info=true

Sample: false

Authors

  • Felix Fontein (@felixfontein)