community.hrobot.storagebox_set_password module – (Re)set the password for a storage box

Note

This module is part of the community.hrobot collection (version 2.8.0).

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

New in community.hrobot 2.1.0

Synopsis

  • (Re)set the password for a storage box.

Parameters

Parameter

Comments

hetzner_password

string

The password for the Robot web-service user.

If hetzner_password is specified, hetzner_user must also be specified, and hetzner_token must not be specified.

This option is deprecated for this module, and support will be removed in community.hrobot 3.0.0.

hetzner_token

string

added in community.hrobot 2.5.0

The API token for the Robot web-service user.

One of hetzner_token and hetzner_user must be specified.

This option will be required from community.hrobot 3.0.0 on.

hetzner_user

string

The username for the Robot web-service user.

One of hetzner_token and hetzner_user must be specified.

If hetzner_user is specified, hetzner_password must also be specified, and hetzner_token must not be specified.

This option is deprecated for this module, and support will be removed in community.hrobot 3.0.0.

id

integer / required

The ID of the storage box to modify.

password

string

The new password for the storage box.

If not provided, a random password will be created by the Robot API and returned as password.

This option is required if hetzner_token is provided, since the new API does not support setting (and returning) a random password.

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

Attributes

Attribute

Support

Description

action_group

Action groups: community.hrobot.api, community.hrobot.robot

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

The group/community.hrobot.robot group is deprecated for this module; the module will be removed from the group in community.hrobot 3.0.0.

check_mode

Support: none

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

This module performs an action on every invocation.

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: Set the password
  community.hrobot.storagebox_set_password:
    id: 123
    password: "newpassword"

- name: Set a random password (only works with the legacy Robot API)
  community.hrobot.storagebox_set_password:
    id: 123
  register: result

- name: Output new password
  ansible.builtin.debug:
    msg: "New password: {{ result.password }}"

Return Values

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

Key

Description

password

string

The new password for the storage box.

Note that if the password has been provided as password, ansible-core before 2.22 will censor this return value to something like VALUE_SPECIFIED_IN_NO_LOG_PARAMETER.

Returned: success

Sample: "newpassword"

Authors

  • Matthias Hurdebise (@matthiashurdebise)