hetzner.hcloud.storage_box_info module – Gather infos about Hetzner Storage Boxes.

Note

This module is part of the hetzner.hcloud collection (version 6.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 hetzner.hcloud. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: hetzner.hcloud.storage_box_info.

Synopsis

Aliases: hcloud_storage_box_info

Requirements

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

  • python-dateutil >= 2.7.5

  • requests >=2.20

Parameters

Parameter

Comments

api_endpoint

aliases: endpoint

string

The endpoint for the Hetzner Cloud API.

You can also set this option by using the HCLOUD_ENDPOINT environment variable.

Default: "https://api.hetzner.cloud/v1"

api_endpoint_hetzner

string

The endpoint for the Hetzner API.

You can also set this option by using the HETZNER_ENDPOINT environment variable.

Default: "https://api.hetzner.com/v1"

api_token

string / required

The token for the Hetzner Cloud API.

You can also set this option by using the HCLOUD_TOKEN environment variable.

id

integer

ID of the Storage Box to get.

If the ID is invalid, the module will fail.

label_selector

string

Label selector to filter the Storage Boxes to get.

name

string

Name of the Storage Box to get.

See Also

See also

Documentation for Hetzner APIs

Complete reference for the Hetzner APIs.

Examples

- name: Gather all Storage Boxes
  hetzner.hcloud.storage_box_info:
  register: output
- name: Print the gathered infos
  debug:
    var: output.hcloud_storage_box_info

- name: Gather Storage Boxes by label
  hetzner.hcloud.storage_box_info:
    label_selector: env=prod
  register: output
- name: Print the gathered infos
  debug:
    var: output.hcloud_storage_box_info

- name: Gather a Storage Box by name
  hetzner.hcloud.storage_box_info:
    name: backups
  register: output
- name: Print the gathered infos
  debug:
    var: output.hcloud_storage_box_info[0]

- name: Gather a Storage Box by id
  hetzner.hcloud.storage_box_info:
    name: 12345
  register: output
- name: Print the gathered infos
  debug:
    var: output.hcloud_storage_box_info[0]

Return Values

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

Key

Description

hcloud_storage_box_info

list / elements=dictionary

List of Storage Boxes.

Returned: always

access_settings

dictionary

Access settings of the Storage Box.

Returned: always

reachable_externally

boolean

Whether access from outside the Hetzner network is allowed.

Returned: always

Sample: false

samba_enabled

boolean

Whether the Samba subsystem is enabled.

Returned: always

Sample: false

ssh_enabled

boolean

Whether the SSH subsystem is enabled.

Returned: always

Sample: true

webdav_enabled

boolean

Whether the WebDAV subsystem is enabled.

Returned: always

Sample: false

zfs_enabled

boolean

Whether the ZFS snapshot folder is visible.

Returned: always

Sample: false

delete_protection

boolean

Protect the Storage Box from deletion.

Returned: always

Sample: false

id

integer

ID of the Storage Box.

Returned: always

Sample: 1937415

labels

dictionary

User-defined labels (key-value pairs) of the Storage Box.

Returned: always

Sample: {"env": "prod"}

location

string

Name of the Location of the Storage Box.

Returned: always

Sample: "fsn1"

name

string

Name of the Storage Box.

Returned: always

Sample: "my-storage-box"

server

string

FQDN of the Storage Box.

Returned: always

Sample: "u505337.your-storagebox.de"

stats

dictionary

Statistics of the Storage Box.

Returned: always

size

integer

Current disk usage in bytes.

Returned: always

Sample: 10485760

size_data

integer

Current disk usage for data in bytes.

Returned: always

Sample: 10485760

size_snapshots

integer

Current disk usage for snapshots in bytes.

Returned: always

Sample: 10485760

status

string

Status of the Storage Box.

Returned: always

Sample: "active"

storage_box_type

string

Name of the Storage Box Type.

Returned: always

Sample: "bx11"

system

string

Host system of the Storage Box.

Returned: always

Sample: "HEL1-BX136"

username

string

User name of the Storage Box.

Returned: always

Sample: "u505337"

Authors

  • Jonas Lammler (@jooola)