community.hrobot.boot 模块 – 设置启动配置

注意

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

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

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

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

community.hrobot 1.2.0 中的新增功能

概要

  • 设置专用服务器的启动配置。

参数

参数

注释

hetzner_password

字符串 / 必需

Robot Web 服务用户的密码。

hetzner_user

字符串 / 必需

Robot Web 服务用户的用户名。

install_cpanel

字典

如果提供了此选项,则将在下次启动时激活 cPanel 安装。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

arch

整数

用于安装的架构。

并非所有发行版都支持所有架构。

默认为 64

选项

  • 32

  • 64

dist

字符串 / 必需

要安装的发行版。

hostname

字符串 / 必需

主机名。

lang

字符串 / 必需

用于操作系统的语言。

install_linux

字典

如果提供了此选项,则将在下次启动时激活 Linux 系统安装。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

arch

整数

用于安装的架构。

并非所有发行版都支持所有架构。

默认为 64

选项

  • 32

  • 64

authorized_keys

列表 / 元素=字符串

一个或多个 SSH 密钥指纹,用于为救援系统配备。

只能使用在 Robot API 中存放的 SSH 密钥的指纹。

您可以使用 community.hrobot.ssh_key_info 模块来查询您可以使用的 SSH 密钥,并使用 community.hrobot.ssh_key 模块来添加或更新 SSH 密钥。

dist

字符串 / 必需

要安装的发行版。

lang

字符串 / 必需

用于操作系统的语言。

install_plesk

字典

如果提供了此选项,则将在下次启动时激活 Plesk 安装。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

arch

整数

用于安装的架构。

并非所有发行版都支持所有架构。

默认为 64

选项

  • 32

  • 64

dist

字符串 / 必需

要安装的发行版。

hostname

字符串 / 必需

主机名。

lang

字符串 / 必需

用于操作系统的语言。

install_vnc

字典

如果提供了此选项,则将在下次启动时激活 VNC 安装。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

arch

整数

用于安装的架构。

并非所有发行版都支持所有架构。

默认为 64

选项

  • 32

  • 64

dist

字符串 / 必需

要安装的发行版。

lang

字符串 / 必需

用于操作系统的语言。

install_windows

字典

如果提供了此选项,则将在下次启动时激活 Windows 安装。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

lang

字符串 / 必需

用于 Windows 的语言。

regular_boot

布尔值

如果提供了此选项,则将删除所有特殊的启动配置,并且下次将启动已安装的操作系统(假设它是可启动的)。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

选项

  • false

  • true

rescue

字典

如果提供了此选项,则将在下次启动时激活救援系统。

必须提供 regular_bootrescueinstall_linuxinstall_vncinstall_windowsinstall_pleskinstall_cpanel 中的一个。

arch

整数

用于救援系统的架构。

并非所有操作系统都支持所有架构。

默认为 64

选项

  • 32

  • 64

authorized_keys

列表 / 元素=字符串

一个或多个 SSH 密钥指纹,用于为救援系统配备。

只能使用在 Robot API 中存放的 SSH 密钥的指纹。

您可以使用 community.hrobot.ssh_key_info 模块来查询您可以使用的 SSH 密钥,并使用 community.hrobot.ssh_key 模块来添加或更新 SSH 密钥。

os

字符串 / 必需

用于救援系统的操作系统。可能的选择会随着时间的推移而变化。

当前,linuxlinuxoldfreebsdfreebsdoldfreebsdaxfreebsdbetaaxvkvmvkvmold 似乎可用。

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 中可能需要更改的内容)。

另请参阅

另请参阅

community.hrobot.ssh_key

添加、删除或更新 SSH 密钥

community.hrobot.ssh_key_info

查询 SSH 密钥的信息

示例

- name: Disable all special boot configurations
  community.hrobot.boot:
    hetzner_user: foo
    hetzner_password: bar
    regular_boot: true

- name: Enable a rescue system (64bit Linux) for the next boot
  community.hrobot.boot:
    hetzner_user: foo
    hetzner_password: bar
    rescue:
      os: linux

- name: Enable a Linux install for the next boot
  community.hrobot.boot:
    hetzner_user: foo
    hetzner_password: bar
    install_linux:
      dist: CentOS 5.5 minimal
      lang: en
      authorized_keys:
        - 56:29:99:a4:5d:ed:ac:95:c1:f5:88:82:90:5d:dd:10
        - 15:28:b0:03:95:f0:77:b3:10:56:15:6b:77:22:a5:bb

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

configuration_type

字符串

描述活动的启动配置。

返回: 成功

只能返回

  • "regular_boot"

  • "rescue"

  • "install_linux"

  • "install_vnc"

  • "install_windows"

  • "install_plesk"

  • "install_cpanel"

密码

字符串

活动启动配置的 root 密码(如果可用)。

对于非救援启动配置,建议尽快更改 root 密码。

返回: 成功,并且如果 configuration_type 不是 regular_boot

作者

  • Felix Fontein (@felixfontein)