community.hrobot.reset 模块 – 重置专用服务器

注意

此模块是 community.hrobot 集合 (版本 2.0.2) 的一部分。

如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.hrobot

要在 playbook 中使用它,请指定:community.hrobot.reset

community.hrobot 1.2.0 中的新增功能

概要

  • 使用软件或硬件重置,或通过请求手动重置来重置专用服务器。

参数

参数

注释

hetzner_password

字符串 / 必需

Robot 网络服务用户的密码。

hetzner_user

字符串 / 必需

Robot 网络服务用户的用户名。

reset_type

字符串 / 必需

如何重置服务器。

software 是软件重置。这应该类似于在键盘上按 Ctrl+Alt+Del。

power 是类似于按电源按钮的硬件重置。将发送 ACPI 信号,如果服务器配置正确,这将触发常规关机。

hardware 是类似于按重启按钮的硬件重置。服务器的电源将被循环。

manual 是手动重置。这会请求技术人员在查看屏幕输出时手动执行关机。小心,仅在真正必要时使用此选项!

请注意,并非每个服务器都支持每种重置方法!

选择

  • "software"

  • "hardware"

  • "power"

  • "manual"

server_number

整数 / 必需

要重置的服务器的服务器编号。

属性

属性

支持

描述

action_group

操作组: community.hrobot.robot

在 community.hrobot 1.6.0 中添加

module_defaults 中使用 group/community.hrobot.robot 来为此模块设置默认值。

check_mode

支持:完全

可以在 check_mode 中运行并返回更改状态预测,而无需修改目标。

diff_mode

支持:

在 diff 模式下运行时,将返回有关已更改(或可能需要在 check_mode 中更改)的详细信息。

示例

- name: Send ACPI signal to server to request controlled shutdown
  community.hrobot.reset:
    hetzner_user: foo
    hetzner_password: bar
    failover_ip: 1.2.3.4
    state: power

- name: Make sure that the server supports manual reset
  community.hrobot.reset:
    hetzner_user: foo
    hetzner_password: bar
    server_number: 1234
    reset_type: manual
  check_mode: true

- name: Request a manual reset (by a technican)
  community.hrobot.reset:
    hetzner_user: foo
    hetzner_password: bar
    server_number: 1234
    reset_type: manual

作者

  • Felix Fontein (@felixfontein)